text:
import logging

from rest_framework.exceptions import ValidationError
from rest_framework.serializers import ListSerializer

logger = logging.getLogger(__name__)

class NestedListSerializer(ListSerializer):

    field_id = None
    parent_name = None

    def update(self, qs, parent, validated_data):
        created_ids, updated_ids, deleted_ids = self._extract_id(
            qs, validated_data
        )

        qs.filter(**{self.field_id + '__in': list(deleted_ids)}).delete()

        objects_list = list(qs.all())
        objects_list = sorted(objects_list,
                              key=lambda x: getattr(x, self.field_id))

        ajust = 0

        validated_data = sorted(validated_data, key=lambda x: x[self.field_id])

        for index, data in enumerate(validated_data):
            data[self.parent_name] = parent.id
            if data[self.field_id] in created_ids:
                self.child.create(data)
                ajust += 1
            else:
                self.child.update(objects_list[index - ajust], data)

    def create(self, parent, validated_data):

        for data in validated_data:
            data[self.parent_name] = parent.id
            self.child.create(data)

    def _extract_id(self, qs, validated_data):
        validated_ids = {data[self.field_id] for data in validated_data}
        db_ids = {values[0] for values in qs.values_list(self.field_id)}
        updated_ids = validated_ids & db_ids
        created_ids = validated_ids - db_ids
        deleted_ids = db_ids - validated_ids
        return created_ids, updated_ids, deleted_ids

    def validate(self, data):
        """
        ensure that field_id is unique among children
        """
        data = super().validate(data)

        if self.field_id:
            if len(data) != len({f[self.field_id] for f in data}):
                msg = 'The fields {field_id} must make a unique set.'.format(
                    field_id=self.field_id
                )
                raise ValidationError(msg)

        return data

class NestedListSerializerDummyUpdate(NestedListSerializer):

    def update(self, qs, parent, validated_data):
        qs.all().delete()
        return self.create(parent, validated_data)


text:
"""string multiplication"""
from runtime import *

def main():
	print 'testing string multiplication'
	assert 'hi'*2 == 'hihi'
	a = 'hi'

	## this fails because `a` is not a string literal,
	## operator overloading must be used for this to work.
	#assert a*2 == 'hihi'

	with oo:
		b = a * 2

	assert( b == 'hihi' )

	## you can also be verbose, and use `__mul__` directly
	assert a.__mul__(2) == 'hihi'
	print 'OK'

main()

redpajama_set_name: RedPajamaGithub


text:
By default Diem brings you a flavored Markdown editor.
But sometimes, the customer wants a WYSIWYG...

So this plugin integrates the best open source editor: [CkEditor](http://ckeditor.com/ "").

Currently only admin forms can receive ckEditors.
Later, this plugin will be updated with a front ckEditorWidget.

The plugin is fully extensible. Only works with [Diem 5.0](http://diem-project.org/) installed.

Documentation
-------------

See the online documentation : [Diem ckEditor plugin documentation](http://diem-project.org/plugins/dmckeditorplugin)


text:
-- phpMyAdmin SQL Dump
-- version 3.4.11.1deb2
-- http://www.phpmyadmin.net
--
-- Server: localhost
-- Time of generation: 07 jul 2014 at 21:00
-- Server version: 5.5.35
-- PHP-Version: 5.5.12-1

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `WTherm`
--

CREATE DATABASE IF NOT EXISTS WTherm;
USE WTherm;

-- --------------------------------------------------------

--
-- Table structure for `archive`
--

CREATE TABLE IF NOT EXISTS `archive` (
  `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `max_temp` float(3,1) NOT NULL,
  `min_temp` float(3,1) NOT NULL,
  `outside_max_temp` float(3,1) NOT NULL,
  `outside_min_temp` float(3,1) NOT NULL,
  `max_humidity` int(10) NOT NULL,
  `min_humidity` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for `log`
--

CREATE TABLE IF NOT EXISTS `log` (
  `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `temp` float(3,1) NOT NULL,
  `outside_temp` float(3,1) NOT NULL,
  `target_temp` float(3,1) NOT NULL,
  `humidity` int(10) NOT NULL,
  `heating` tinyint(1) NOT NULL,
  `override` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for `status`
--

CREATE TABLE IF NOT EXISTS `status` (
  `TEMP` float(3,1) NOT NULL,
  `HUMIDITY` int(10) NOT NULL,
  `TARGET_TEMP` float(3,1) NOT NULL,
  `HEATING` tinyint(1) NOT NULL,
  `OVERRIDE` tinyint(1) NOT NULL,
  `LAST_UPDATE` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Data for `status`
--

INSERT INTO `status` (`TEMP`, `HUMIDITY`, `TARGET_TEMP`, `HEATING`, `OVERRIDE`, `LAST_UPDATE`) VALUES
(22.0, 50, 15.0, 0, 1, '2014-07-07 21:00:00');

-- --------------------------------------------------------

--
-- Table structure for `users`
--

CREATE TABLE IF NOT EXISTS `users` (
  `username` varchar(100) NOT NULL,
  `password` varchar(256) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;


text:
package com.jeequan.jeepay.components.mq.vender.rocketmq.receive;

import com.jeequan.jeepay.components.mq.constant.MQVenderCS;
import com.jeequan.jeepay.components.mq.model.ResetIsvMchAppInfoConfigMQ;
import com.jeequan.jeepay.components.mq.vender.IMQMsgReceiver;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

/**
* rocketMQ消息接收器:仅在vender=rocketMQ时 && 项目实现IMQReceiver接口时 进行实例化
* 业务:  更新服务商/商户/商户应用配置信息
*
* @author terrfly
* @site https://www.jeequan.com
* @date 2021/7/22 17:06
*/
@Component
@ConditionalOnProperty(name = MQVenderCS.YML_VENDER_KEY, havingValue = MQVenderCS.ROCKET_MQ)
@ConditionalOnBean(ResetIsvMchAppInfoConfigMQ.IMQReceiver.class)
@RocketMQMessageListener(topic = ResetIsvMchAppInfoConfigMQ.MQ_NAME, consumerGroup = ResetIsvMchAppInfoConfigMQ.MQ_NAME, messageModel = MessageModel.BROADCASTING)
public class ResetIsvMchAppInfoRocketMQReceiver implements IMQMsgReceiver, RocketMQListener<String> {

    @Autowired
    private ResetIsvMchAppInfoConfigMQ.IMQReceiver mqReceiver;

    /** 接收 【 MQSendTypeEnum.BROADCAST  】 广播类型的消息 **/
    @Override
    public void receiveMsg(String msg){
        mqReceiver.receive(ResetIsvMchAppInfoConfigMQ.parse(msg));
    }

    @Override
    public void onMessage(String message) {
        this.receiveMsg(message);
    }

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>C - Documenting Tilescreen with YUIDoc</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="icon" href="../assets/favicon.ico">

            API Docs for: 1.0.0

APIs

Classes

Modules

                            <input type="search" id="api-filter" placeholder="Type to filter APIs">

C

U

                    Show:

                        <input type="checkbox" id="api-show-inherited" checked>
                        Inherited

                        <input type="checkbox" id="api-show-protected">
                        Protected

                        <input type="checkbox" id="api-show-private">
                        Private

                        <input type="checkbox" id="api-show-deprecated">
                        Deprecated

C Class

            Defined in: js/internal/config.js:2

Index

Methods

Properties

Item Index

Methods

                                build_setup_tile

                                print_msg

Properties

                                appMgr

                                b_transparency

                                date

                                gugle_key

                                HIDDEN_ROLES

                                iconMap

                                last_longpress

                                mosaic

                                only_big

                                smalls

                                storage

                                TS_UPD_SETUP_TILE

Methods

build_setup_tile

        ()

            String

        private

                Defined in
        js/internal/apps.js:63

Builds the setup-tile

Returns:

                        String:

a div with location and date info

print_msg

        ()

            String

        private

                Defined in
        js/internal/apps.js:50

Prints set up message

Returns:

                        String:

a div indicating to select this homescreen as default

Properties

appMgr

    Object

                Defined in
        js/internal/config.js:113

Object mgmt for managing the apps

b_transparency

    Integer

                Defined in
        js/internal/config.js:17

1 = semi-transparent background colors  VS 0 = solid background colors

Default: 1

date

    Class

                Defined in
        js/internal/config.js:84

Date Object

gugle_key

    String

                Defined in
        js/internal/config.js:96

API KEY for Google geolocation

HIDDEN_ROLES

    Array

                Defined in
        js/internal/config.js:27

Constant for excluding not interesting apps in roster

iconMap

    Object

                Defined in
        js/internal/config.js:57

WeakMap for storing the icons

last_longpress

    Integer

                Defined in
        js/internal/config.js:105

Unix timestamp of the last longpress event... for avoid to make a click after it

mosaic

    String

                Defined in
        js/internal/config.js:48

DIV apps container

only_big

    Integer

                Defined in
        js/internal/config.js:7

Value for showing small or big icons

Default: 0

smalls

    Array

                Defined in
        js/internal/config.js:66

Array container for small indexes

storage

    Array

                Defined in
        js/internal/config.js:75

Object for storing in LocalStorage usage of icons

TS_UPD_SETUP_TILE

    Integer

                Defined in
        js/internal/config.js:37

Time for refresh the setup-tile

Default: 3600000 [ 1 hour ]


text:
<!DOCTYPE html>

    <title>Packuilon</title>
    <meta charset="utf-8">

    <textarea id="source">

class: center, middle

# Monitoring Packuilon builds

---

# Agenda

- What is Packuilon?
- What's the problem?
- What's the solution?
- Interesting tools.
- Next steps?

---

# What is Packuilon?

**Packer** + **Aquilon** = **Packuilon**

- Packuilon watches for newly compiled profiles in Aquilon
- Checks if the profile has changed
- Makes a Packer build file for the (personality + OS) combo
- Triggers a Packer build
- Updates the memberships of the created image

.footnote[.red.bold[*] _Taken from Tom's slides about Packuilon._]

---

# What's the problem?

Well, let's force Packuilon to run a build.
~~~
$ ./packuilon.py --personality inventory
~~~
---

# What's the problem?

Well, let's force Packuilon to run a build.
~~~
$ ./packuilon.py --personality inventory
~~~
We get some JSON:
~~~json
{'metadata': ...,
 'system':
   {'personality': {'name': 'inventory'}, ...,
 'os':
   {'distribution': {'name': 'sl'}, ...}}}
~~~

---

# What's the problem?

Well, let's force Packuilon to run a build.
~~~
$ ./packuilon.py --personality inventory
~~~
We get some JSON:
~~~json
{'metadata': ...,
 'system':
   {'personality': {'name': 'inventory'}, ...,
 'os':
   {'distribution': {'name': 'sl'}, ...}}}
~~~

...

---

# What's the problem?

Well, let's force Packuilon to run a build.
~~~
$ ./packuilon.py --personality inventory
~~~
We get some JSON:
~~~json
{'metadata': ...,
 'system':
   {'personality': {'name': 'inventory'}, ...,
 'os':
   {'distribution': {'name': 'sl'}, ...}}}
~~~

... *and nothing else!*

The only way to find out if a build had finished was to look at the log files manually.
---

# What's the solution?

[A web interface.](vm318.nubes.stfc.ac.uk:5000)

---

# Interesting tools.

- Haskell
- setuptools
- Flask
- humanize
- ansi2html
- Pytest & Hypothesis

---

# Haskell?!

_Very easy to do constant-memory streaming._
 - important so you don't read the entire log file into memory

_Type-checker makes it harder to write incorrect code._
 - side-effects are contained within the `IO` type – so debugging and testing becomes much easier.

_Incredibly abstract, yet lightning fast._
  - because Haskell is 'pure', the compiler can make huge optimisations

  - Haskell's Warp server does 81,244 RPS
  - Python's Django does 2,455 RPS

_Rich package ecosystem._
 - Hackage is nowhere near CPAN – yet!

**Look up _Real World Haskell_ for a practical introduction to Haskell.**

---

# Layout

~~~
packuilon-monitor
├── setup.py
├── pytest.ini
├── setup.cfg
├── packuilon_monitor
│   ├── __init__.py
│   ├── monitor.py
│   ├── ...
│   └── templates
│       ├── log.css
│       ├── log.html
│       ├── monitor.css
│       └── monitor.html
└── test
    ├── test_parse_log.py
    └── log
        ├── inventory-sl6x.managed.json.1499871318.log
        └── ...
~~~

---

# setuptools

Makes installing `packuilon-monitor` as easy as
>    `$ sudo pip install .`

from inside the cloned repo.

---

# Flask

**Flask** is a simple web framework.

~~~python
from flask import Flask, render_template
app = Flask('packuilon_monitor')

@app.route('/')
def monitor():
    builds = get_builds()
    running_builds = filter(lambda b: b.status == 'running', builds)
    finished_builds = filter(lambda b: b.status != 'running', builds)
    return render_template(
        'monitor.html',
        running_builds         = sort_running_builds(running_builds),
        finished_builds        = sort_finished_builds(finished_builds),
        display_start_time     = display_start_time,
        display_build_duration = display_build_duration)

~~~

---

# Jinja

Flask uses **Jinja** to generate HTML with *templates*.

~~~html

      ...
      {% for build in running_builds %}

            ...

            {{ build.name }}

          {{ display_start_time(build) }}

      {% endfor %}

~~~
---

# humanize

A PyPI package which translates machine-readable values (dates, numbers, time differences, etc.) into fuzzy, intuitive strings.

|unreadable||readable|
|-|-|-|
|`983899` (seconds elapsed) |→| `"11 days ago"`|
|`17283940` (unitless) |→| `"17.3 million"`|
|`1500546243` (epoch) |→| `"yesterday"`|

---

# ansi2html

PyPI package which converts Ansi colour codes (etc.) to HTML – which can then be customised by editing the CSS.

Currently is very difficult to customise! I copied the output CSS into `log.css` and edited it by hand.

[An example of the output.](http://vm318.nubes.stfc.ac.uk:5000/log/inventory-sl6x-x86_64.managed.json.1499943808.log)

---

# Hypothesis

*Property-based testing* for Python (based on Haskell's QuickCheck library). Integrates with the Pytest runner.

~~~python
from hypothesis import given, example
from hypothesis.strategies import integers

@example(42, 13)
@given(integers(0), integers(0))
def test_parse_valid_status_line(t, e):
    line = ('rabbit2packer: Build finished at ' +
            str(t) +
            ' (epoch) with exit code ' +
            str(e))
    assert pm.parse_status_line(line) == (t, e)
~~~

If it finds a counterexample:

> `Falsifying example: parse_status_line(...)`

Hypothesis tries to *shrink* its counterexamples.

---

# Next steps?

**Big things**
- Live updates
 - Flask + SocketIO = Flask-SocketIO
 - Tailing log files
 - Threading
- Ripping out the monitoring interface

**Small things**
- Back button on log view
- 'Always-scroll-to-bottom' (for live output)

---

# Questions?

You can find these slides in the `doc/` folder of:
- `github.com/daantjie/packuilon-monitor` (will be moved to `stfc`)

Other links:
- [`flask.pocoo.org`](flask.pocoo.org)
- [`pypi.python.org/pypi/humanize`](pypi.python.org/pypi/humanize)
- [`realworldhaskell.com/read`](realworldhaskell.com/read)

    </textarea>


text:
// Copyright (c) Dapplo and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Dapplo.Jira.Enums;

/// <summary>
///     Used to specify the size for the avatar
/// </summary>
public enum AvatarSizes
{
    /// <summary>
    ///     Used to specify the 48x48 avatar
    /// </summary>
    ExtraLarge,

    /// <summary>
    ///     Used to specify the 16x16 avatar
    /// </summary>
    Small,

    /// <summary>
    ///     Used to specify the 24x24 avatar
    /// </summary>
    Medium,

    /// <summary>
    ///     Used to specify the 32x32 avatar
    /// </summary>
    Large
}


text:
import os
import shutil

import config
import core.Admin as admin
import core.School as sch
import core.Staff as stf
import utils.defaults as defaults
import utils.helpers as helpers

def save_setup_data(setup_data):
    admin_data = setup_data['admin']
    school_data = setup_data['school']
    proprietor = setup_data['proprietor']
    admin.create_admin_account(admin_data)
    proprietor_name_parts = helpers.get_human_name_parts(proprietor['name'])
    _staff_info = dict(
        fname=proprietor_name_parts.first, lname=proprietor_name_parts.last)
    if proprietor_name_parts.middle:
        _staff_info['mname'] = proprietor_name_parts.middle
    proprietor_id = stf.create_staff(_staff_info).id
    school_data['grading_scheme'] = defaults.GRADING_SCHEME
    school_data['grading_keys'] = defaults.GRADING_KEYS
    school_data['rating_scale'] = defaults.RATING_SCALE
    school_data['proprietor_id'] = proprietor_id
    school_data['proprietor_type'] = proprietor['proprietor_type']
    # copy the logo from the logo path to the new school
    # data directory
    shutil.copy(school_data['logo_path'],
                os.path.join(school_data['data_dir'], 'logo.png'))
    del school_data['logo_path']
    sch_id = sch.create_new_school(school_data)
    return sch_id

def is_valid_admin_details(username, password):
    details = admin.get_admin_info()
    if not details:
        raise ValueError('No current admin exists.')
    if details.username != username or details.password != password:
        return False
    return True

def is_first_time_launch():
    return admin.get_admin_info() is None


text:
NS_ASSUME_NONNULL_BEGIN

@interface SNKHSecureTextEntryLabel : UILabel

@property (nonatomic, assign) BOOL kh_secureTextEntry;
@property (nonatomic, copy, readonly) NSString *kh_originText;
@property (nonatomic, copy, readonly) NSString *kh_secureText;

@end

NS_ASSUME_NONNULL_END


text:
package com.itude.mobile.mobbl.core.util;

import com.itude.mobile.android.util.DataUtil;
import com.itude.mobile.android.util.FileUtil;
import com.itude.mobile.android.util.StringUtil;
import com.itude.mobile.android.util.log.MBLog;
import com.itude.mobile.mobbl.core.configuration.mvc.MBDocumentDefinition;
import com.itude.mobile.mobbl.core.model.MBDocument;
import com.itude.mobile.mobbl.core.model.parser.MBXmlDocumentParser;
import com.itude.mobile.mobbl.core.services.MBMetadataService;

import java.io.File;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Map;
import java.util.Set;

public class MBCacheManager {
    public static final String CACHE_DIR = "cache";
    public static final String CACHE_REGISTRY_FILE = "cache_registry.plist";
    public static final String CACHE_TTL_FILE = "cache_ttl.plist";

    private static MBCacheManager _instance;
    private Map<String, String> _registry;
    private Map<String, String> _documentTypes;
    private Hashtable<String, String> _ttls;
    private Map<String, byte[]> _temporaryMemoryCache;
    private final String _registryFileName = CACHE_DIR + File.separator + CACHE_REGISTRY_FILE;
    private final String _ttlsFileName = CACHE_DIR + File.separator + CACHE_TTL_FILE;

    @SuppressWarnings("unchecked")
    protected void init() {
        MBLog.d(MBConstants.APPLICATION_NAME, "init CacheManager");

    /*
     * AD: When writing our ttls to a file we should also read them.
     * Otherwise what will happen when closing and reopening the application is that the _ttls hashtable is empty
     * even though we've set values in this before closing down the application.
     * Not reading the _ttls from the file can result in the doGetValueForKey method not finding the ttl value for the given key
     * Not finding the ttl will disregard any ttl values that belong to the key.
     * When disregarding the ttl the document will ALWAYS be loaded from the cache (if available).
     */
        _ttls = (Hashtable<String, String>) FileUtil.getInstance().readObjectFromFile(_ttlsFileName);
        if (_ttls == null) {
            _ttls = new Hashtable<String, String>();
        }

        _documentTypes = new Hashtable<String, String>();
        _registry = new HashMap<String, String>();
        _temporaryMemoryCache = new HashMap<String, byte[]>();
    }

    protected MBCacheManager() {
        init();

        @SuppressWarnings("unchecked")
        Hashtable<String, String> combined = (Hashtable<String, String>) FileUtil.getInstance().readObjectFromFile(_registryFileName);
        if (combined == null) {
            combined = new Hashtable<String, String>();
        }

        for (String key : combined.keySet()) {
            String value = combined.get(key);
            String[] split = value.split(":");

            _registry.put(key, split[0]);
            if (split.length > 1) {
                _documentTypes.put(key, split[1]);
            }
        }
    }

    public static MBCacheManager getInstance() {
        if (_instance == null) {
            _instance = new MBCacheManager();
        }

        return _instance;
    }

    public static void setCacheManager(MBCacheManager manager) {
        _instance = manager;
    }

    protected byte[] doGetValueForKey(String key) {

        String fileName = null;
        synchronized (_registry) {
            fileName = _registry.get(key);

            // check ttl
            if (fileName != null) {
                String ttl = _ttls.get(key);
                if (StringUtil.isNotBlank(ttl)) {
                    long maxAge = Long.parseLong(ttl);
                    if (maxAge != 0 && maxAge < System.currentTimeMillis()) {
                        fileName = null;
                        doExpireDataForKey(key);
                    }
                }
            }
        }
        if (fileName == null) {
            return null;
        }
        // First try to get it from the temporary memory cache; a writer could be busy writing the file right now:

        byte[] data = null;
        synchronized (_temporaryMemoryCache) {
            data = _temporaryMemoryCache.get(key);
        }

        if (data == null) {
            data = FileUtil.getInstance().getByteArray(CACHE_DIR + File.separator + fileName);
        }

        return data;
    }

    protected void doSetValue(byte[] data, String key, int ttl) {
        // Put the data in the temporary memory cache; to avoid reading a file a writer is not yet done with:
        synchronized (_temporaryMemoryCache) {
            _temporaryMemoryCache.put(key, data);
        }

        String fileName = null;
        synchronized (_registry) {
            fileName = _registry.get(key);
            if (fileName == null) {
                int maxKey = 0;
                for (String value : _registry.values()) {
                    maxKey = Math.max(maxKey, Integer.parseInt(value));
                }
                maxKey++;
                fileName = "" + maxKey;
                _registry.put(key, fileName);
            }

            // Set maximum age based on ttl and the time of 'now':
            long maxAge = 0;
            if (ttl > 0) {
                maxAge = System.currentTimeMillis() + (ttl * 1000);
            }
            _ttls.put(key, "" + maxAge);

            MBCacheWriter writer = new MBCacheWriter(_registry, _registryFileName, _documentTypes, _ttls, _ttlsFileName, CACHE_DIR
                    + File.separator
                    + fileName, data,
                    _temporaryMemoryCache, key);
            writer.run();
        }
    }

    private void flushRegistry() {
        MBCacheWriter writer = new MBCacheWriter(_registry, _registryFileName, _documentTypes, _ttls, _ttlsFileName, null, null,
                _temporaryMemoryCache, null);
        writer.start();
    }

    private void deleteCachedFile(String key) {
        synchronized (_registry) {
            String fileName = _registry.get(key);
            _registry.remove(key);
            _ttls.remove(key);
            _temporaryMemoryCache.remove(key);
            _documentTypes.remove(key);

            FileUtil.getInstance().remove(CACHE_DIR + File.separator + fileName);
        }
    }

    private void doExpireDataForKey(String key) {
        MBLog.d(MBConstants.APPLICATION_NAME, "removing " + key + "from cache");
        deleteCachedFile(key);
        flushRegistry();
    }

    private void doExpireAllDocuments() {

        Set<String> keySet = new HashSet<String>(_registry.keySet());

        boolean doneOne = false;
        for (String key : keySet) {
            int indexOfColon = key.indexOf(":");
            if (indexOfColon != -1) {
                String documentName = key.substring(0, indexOfColon);

                // Is it a valid document? If so delete the entry
                if (MBMetadataService.getInstance().getDefinitionForDocumentName(documentName, false) != null) {
                    deleteCachedFile(key);
                    doneOne = true;
                }
            }
        }
        if (doneOne) flushRegistry();
    }

    private MBDocument doGetDocumentForKey(String key) {
        byte[] zipped = doGetValueForKey(key);
        if (zipped == null) return null;

        byte[] data = DataUtil.getInstance().decompress(zipped);
        if (data == null) {
            MBLog.e(MBConstants.APPLICATION_NAME, "Error decompressing cached document");
            return null;
        }

        String documentName = _documentTypes.get(key);
        MBDocumentDefinition def = MBMetadataService.getInstance().getDefinitionForDocumentName(documentName);
        MBXmlDocumentParser parser = new MBXmlDocumentParser();
        return parser.getDocumentWithData(data, def);
    }

    private void doSetDocument(MBDocument document, String key, int ttl) {
        String docType = document.getDocumentName();
        _documentTypes.put(key, docType);
        try {
            StringBuffer sb = new StringBuffer(4096);
            byte[] data = document.asXmlWithLevel(sb, 0, true).toString().getBytes(MBConstants.C_ENCODING);
            byte[] zipped = DataUtil.getInstance().compress(data);

            doSetValue(zipped, key, ttl);
        } catch (UnsupportedEncodingException e) {
            MBLog.w(MBConstants.APPLICATION_NAME, e);
        }
    }

    public static byte[] getDataForKey(String key) {
        return getInstance().doGetValueForKey(key);
    }

    public static void setData(byte[] data, String key, int ttl) {
        getInstance().doSetValue(data, key, ttl);
    }

    public static void expireDataForKey(String key) {
        getInstance().doExpireDataForKey(key);
    }

    public static void expireDocumentForKey(String key) {
        getInstance().doExpireDataForKey(key);
    }

    public static void expireAllDocuments() {
        getInstance().doExpireAllDocuments();
    }

    public static MBDocument documentForKey(String key) {
        return getInstance().doGetDocumentForKey(key);
    }

    public static void setDocument(MBDocument document, String key, int ttl) {
        getInstance().doSetDocument(document, key, ttl);
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:noecard="http://schemas.android.com/apk/res-auto">
    <item
        android:id="@+id/actionb_destination_visited"
        android:icon="@drawable/ic_check"
        noecard:showAsAction="always|collapseActionView"
        android:title="@string/title_menu_visited"
        />
    <item
        android:id="@+id/actionb_favorit_star"
        android:icon="@drawable/ic_star_outline"
        noecard:showAsAction="always|collapseActionView"
        android:title="@string/title_menu_favorit"
        />
    <item
        android:id="@+id/actionb_navigate_to_dest"
        android:icon="@drawable/ic_navigation"
        noecard:showAsAction="ifRoom|collapseActionView"
        android:title="@string/title_menu_to_destination"
        />
	<item
        android:id="@+id/actionb_show_in_map"
        android:icon="@drawable/ic_mini_world_map"
        noecard:showAsAction="ifRoom|collapseActionView"
        android:title="@string/title_menu_show_on_map"
        />
    <item
        android:id="@+id/actionb_upload_picture"
        android:icon="@drawable/ic_add_a_photo"
        noecard:showAsAction="ifRoom|collapseActionView"
        android:title="@string/title_menu_add_photo"
        />

</menu>


text:
package com.stc.pattysmorestuff.tileentity.furnaces;

import com.stc.pattysmorestuff.blocks.furnaces.BlockUltimateFurnace;
import com.stc.pattysmorestuff.configuration.ConfigPreInit;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.*;
import net.minecraft.item.*;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntityLockable;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable;
import net.minecraft.util.NonNullList;
import net.minecraft.util.datafix.DataFixer;
import net.minecraft.util.datafix.FixTypes;
import net.minecraft.util.datafix.walkers.ItemStackDataLists;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class TileEntityUltimateFurnace extends TileEntityLockable implements ITickable, ISidedInventory {

    private static final int[] SLOTS_TOP = new int[] {0};
    private static final int[] SLOTS_BOTTOM = new int[] {2, 1};
    private static final int[] SLOTS_SIDES = new int[] {1};
    /** The ItemStacks that hold the items currently being used in the furnace */
    private NonNullList<ItemStack> furnaceItemStacks = NonNullList.<ItemStack>withSize(3, ItemStack.EMPTY);
    /** The number of ticks that the furnace will keep burning */
    private int furnaceBurnTime;
    /** The number of ticks that a fresh copy of the currently-burning item would keep the furnace burning for */
    private int currentItemBurnTime;
    private int cookTime;
    private int totalCookTime;
    private String furnaceCustomName;

    /**
     * Returns the number of slots in the inventory.
     */
    public int getSizeInventory()
    {
        return this.furnaceItemStacks.size();
    }

    public boolean isEmpty()
    {
        for (ItemStack itemstack : this.furnaceItemStacks)
        {
            if (!itemstack.isEmpty())
            {
                return false;
            }
        }

        return true;
    }

    /**
     * Returns the stack in the given slot.
     */
    public ItemStack getStackInSlot(int index)
    {
        return this.furnaceItemStacks.get(index);
    }

    /**
     * Removes up to a specified number of items from an inventory slot and returns them in a new stack.
     */
    public ItemStack decrStackSize(int index, int count)
    {
        return ItemStackHelper.getAndSplit(this.furnaceItemStacks, index, count);
    }

    /**
     * Removes a stack from the given slot and returns it.
     */
    public ItemStack removeStackFromSlot(int index)
    {
        return ItemStackHelper.getAndRemove(this.furnaceItemStacks, index);
    }

    /**
     * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
     */
    public void setInventorySlotContents(int index, ItemStack stack)
    {
        ItemStack itemstack = (ItemStack)this.furnaceItemStacks.get(index);
        boolean flag = !stack.isEmpty() && stack.isItemEqual(itemstack) && ItemStack.areItemStackTagsEqual(stack, itemstack);
        this.furnaceItemStacks.set(index, stack);

        if (stack.getCount() > this.getInventoryStackLimit())
        {
            stack.setCount(this.getInventoryStackLimit());
        }

        if (index == 0 && !flag)
        {
            this.totalCookTime = this.getCookTime(stack);
            this.cookTime = 0;
            this.markDirty();
        }
    }

    /**
     * Get the name of this object. For players this returns their username
     */
    public String getName()
    {
        return this.hasCustomName() ? this.furnaceCustomName : "Ultimate Furnace";
    }

    /**
     * Returns true if this thing is named
     */
    public boolean hasCustomName()
    {
        return this.furnaceCustomName != null && !this.furnaceCustomName.isEmpty();
    }

    public void setCustomInventoryName(String p_145951_1_)
    {
        this.furnaceCustomName = p_145951_1_;
    }

    public static void registerFixesFurnace(DataFixer fixer)
    {
        fixer.registerWalker(FixTypes.BLOCK_ENTITY, new ItemStackDataLists(TileEntityObsidianFurnace.class, new String[] {"Items"}));
    }

    public void readFromNBT(NBTTagCompound compound)
    {
        super.readFromNBT(compound);
        this.furnaceItemStacks = NonNullList.<ItemStack>withSize(this.getSizeInventory(), ItemStack.EMPTY);
        ItemStackHelper.loadAllItems(compound, this.furnaceItemStacks);
        this.furnaceBurnTime = compound.getInteger("BurnTime");
        this.cookTime = compound.getInteger("CookTime");
        this.totalCookTime = compound.getInteger("CookTimeTotal");
        this.currentItemBurnTime = getItemBurnTime(this.furnaceItemStacks.get(1));

        if (compound.hasKey("CustomName", 8))
        {
            this.furnaceCustomName = compound.getString("CustomName");
        }
    }

    public NBTTagCompound writeToNBT(NBTTagCompound compound)
    {
        super.writeToNBT(compound);
        compound.setInteger("BurnTime", (short)this.furnaceBurnTime);
        compound.setInteger("CookTime", (short)this.cookTime);
        compound.setInteger("CookTimeTotal", (short)this.totalCookTime);
        ItemStackHelper.saveAllItems(compound, this.furnaceItemStacks);

        if (this.hasCustomName())
        {
            compound.setString("CustomName", this.furnaceCustomName);
        }

        return compound;
    }

    /**
     * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended.
     */
    public int getInventoryStackLimit()
    {
        return 64;
    }

    /**
     * Furnace isBurning
     */
    public boolean isBurning()
    {
        return this.furnaceBurnTime > 0;
    }

    @SideOnly(Side.CLIENT)
    public static boolean isBurning(IInventory inventory)
    {
        return inventory.getField(0) > 0;
    }

    /**
     * Like the old updateEntity(), except more generic.
     */
    public void update()
    {
        boolean flag = this.isBurning();
        boolean flag1 = false;

        if (this.isBurning())
        {
            --this.furnaceBurnTime;
        }

        if (!this.world.isRemote)
        {
            ItemStack itemstack = this.furnaceItemStacks.get(1);

            if (this.isBurning() || !itemstack.isEmpty() && !((ItemStack)this.furnaceItemStacks.get(0)).isEmpty())
            {
                if (!this.isBurning() && this.canSmelt())
                {
                    this.furnaceBurnTime = getItemBurnTime(itemstack);
                    this.currentItemBurnTime = this.furnaceBurnTime;

                    if (this.isBurning())
                    {
                        flag1 = true;

                        if (!itemstack.isEmpty())
                        {
                            Item item = itemstack.getItem();
                            itemstack.shrink(1);

                            if (itemstack.isEmpty())
                            {
                                ItemStack item1 = item.getContainerItem(itemstack);
                                this.furnaceItemStacks.set(1, item1);
                            }
                        }
                    }
                }

                if (this.isBurning() && this.canSmelt())
                {
                    ++this.cookTime;

                    if (this.cookTime == this.totalCookTime)
                    {
                        this.cookTime = 0;
                        this.totalCookTime = this.getCookTime(this.furnaceItemStacks.get(0));
                        this.smeltItem();
                        flag1 = true;
                    }
                }
                else
                {
                    this.cookTime = 0;
                }
            }
            else if (!this.isBurning() && this.cookTime > 0)
            {
                this.cookTime = MathHelper.clamp(this.cookTime - 2, 0, this.totalCookTime);
            }

            if (flag != this.isBurning())
            {
                flag1 = true;
                BlockUltimateFurnace.setState(this.isBurning(), this.world, this.pos);
            }
        }

        if (flag1)
        {
            this.markDirty();
        }
    }

    //Lower the number the faster items cook/smelt
    public int getCookTime(ItemStack stack)
    {
        return ConfigPreInit.ultimateFurnaceCookSpeed;
    }
    /**
     * Returns true if the furnace can smelt an item, i.e. has a source item, destination stack isn't full, etc.
     */
    private boolean canSmelt()
    {
        if (((ItemStack)this.furnaceItemStacks.get(0)).isEmpty())
        {
            return false;
        }
        else
        {
            ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(this.furnaceItemStacks.get(0));

            if (itemstack.isEmpty())
            {
                return false;
            }
            else
            {
                ItemStack itemstack1 = this.furnaceItemStacks.get(2);

                if (itemstack1.isEmpty())
                {
                    return true;
                }
                else if (!itemstack1.isItemEqual(itemstack))
                {
                    return false;
                }
                else if (itemstack1.getCount() + itemstack.getCount() <= this.getInventoryStackLimit() && itemstack1.getCount() + itemstack.getCount() <= itemstack1.getMaxStackSize())  // Forge fix: make furnace respect stack sizes in furnace recipes
                {
                    return true;
                }
                else
                {
                    return itemstack1.getCount() + itemstack.getCount() <= itemstack.getMaxStackSize(); // Forge fix: make furnace respect stack sizes in furnace recipes
                }
            }
        }
    }

    /**
     * Turn one item from the furnace source stack into the appropriate smelted item in the furnace result stack
     */
    public void smeltItem()
    {
        if (this.canSmelt())
        {
            ItemStack itemstack = (ItemStack)this.furnaceItemStacks.get(0);
            ItemStack itemstack1 = FurnaceRecipes.instance().getSmeltingResult(itemstack);
            ItemStack itemstack2 = (ItemStack)this.furnaceItemStacks.get(2);

            if (itemstack2.isEmpty())
            {
                this.furnaceItemStacks.set(2, itemstack1.copy());
            }
            else if (itemstack2.getItem() == itemstack1.getItem())
            {
                itemstack2.grow(itemstack1.getCount());
            }

            if (itemstack.getItem() == Item.getItemFromBlock(Blocks.SPONGE) && itemstack.getMetadata() == 1 && !((ItemStack)this.furnaceItemStacks.get(1)).isEmpty() && ((ItemStack)this.furnaceItemStacks.get(1)).getItem() == Items.BUCKET)
            {
                this.furnaceItemStacks.set(1, new ItemStack(Items.WATER_BUCKET));
            }

            itemstack.shrink(1);
        }
    }

    /**
     * Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't
     * fuel
     */
    public static int getItemBurnTime(ItemStack stack)
    {
        if (stack.isEmpty())
        {
            return 0;
        }
        else
        {
            Item item = stack.getItem();

            if (item instanceof net.minecraft.item.ItemBlock && Block.getBlockFromItem(item) != Blocks.AIR)
            {
                Block block = Block.getBlockFromItem(item);

                if (block == Blocks.WOODEN_SLAB)
                {
                    return ConfigPreInit.ultimateFWoodenSlabBurnTime;
                }

                if (block.getDefaultState().getMaterial() == Material.WOOD)
                {
                    return ConfigPreInit.ultimateFWoodMaterialBurnTime;
                }

                if (block == Blocks.COAL_BLOCK)
                {
                    return ConfigPreInit.ultimateFCoalBlockBurnTime;
                }
            }

            if (item instanceof ItemTool && "WOOD".equals(((ItemTool)item).getToolMaterialName())) return ConfigPreInit.ultimateFToolWoodBurnTime;
            if (item instanceof ItemSword && "WOOD".equals(((ItemSword)item).getToolMaterialName())) return ConfigPreInit.ultimateFSwordWoodBurnTime;
            if (item instanceof ItemHoe && "WOOD".equals(((ItemHoe)item).getMaterialName())) return ConfigPreInit.ultimateFHoeWoodBurnTime;
            if (item == Items.STICK) return ConfigPreInit.ultimateFStickBurnTime;
            if (item == Items.COAL) return ConfigPreInit.ultimateFCoalBurnTime;
            if (item == Items.LAVA_BUCKET) return ConfigPreInit.ultimateFLavaBucketBurnTime;
            if (item == Item.getItemFromBlock(Blocks.SAPLING)) return ConfigPreInit.ultimateFSaplingBurnTime;
            if (item == Items.BLAZE_ROD) return ConfigPreInit.ultimateFBlazeRodBurnTime;
            return net.minecraftforge.fml.common.registry.GameRegistry.getFuelValue(stack);
        }
    }

    public static boolean isItemFuel(ItemStack stack)
    {
        /**
         * Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't
         * fuel
         */
        return getItemBurnTime(stack) > 0;
    }

    /**
     * Don't rename this method to canInteractWith due to conflicts with Container
     */
    public boolean isUsableByPlayer(EntityPlayer player)
    {
        if (this.world.getTileEntity(this.pos) != this)
        {
            return false;
        }
        else
        {
            return player.getDistanceSq((double)this.pos.getX() + 0.5D, (double)this.pos.getY() + 0.5D, (double)this.pos.getZ() + 0.5D) <= 64.0D;
        }
    }

    public void openInventory(EntityPlayer player)
    {
    }

    public void closeInventory(EntityPlayer player)
    {
    }

    /**
     * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. For
     * guis use Slot.isItemValid
     */
    public boolean isItemValidForSlot(int index, ItemStack stack)
    {
        if (index == 2)
        {
            return false;
        }
        else if (index != 1)
        {
            return true;
        }
        else
        {
            ItemStack itemstack = (ItemStack)this.furnaceItemStacks.get(1);
            return isItemFuel(stack) || SlotFurnaceFuel.isBucket(stack) && itemstack.getItem() != Items.BUCKET;
        }
    }

    public int[] getSlotsForFace(EnumFacing side)
    {
        if (side == EnumFacing.DOWN)
        {
            return SLOTS_BOTTOM;
        }
        else
        {
            return side == EnumFacing.UP ? SLOTS_TOP : SLOTS_SIDES;
        }
    }

    /**
     * Returns true if automation can insert the given item in the given slot from the given side.
     */
    public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction)
    {
        return this.isItemValidForSlot(index, itemStackIn);
    }

    /**
     * Returns true if automation can extract the given item in the given slot from the given side.
     */
    public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction)
    {
        if (direction == EnumFacing.DOWN && index == 1)
        {
            Item item = stack.getItem();

            if (item != Items.WATER_BUCKET && item != Items.BUCKET)
            {
                return false;
            }
        }

        return true;
    }

    public String getGuiID()
    {
        return "minecraft:furnace";
    }

    public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn)
    {
        return new ContainerFurnace(playerInventory, this);
    }

    public int getField(int id)
    {
        switch (id)
        {
            case 0:
                return this.furnaceBurnTime;
            case 1:
                return this.currentItemBurnTime;
            case 2:
                return this.cookTime;
            case 3:
                return this.totalCookTime;
            default:
                return 0;
        }
    }

    public void setField(int id, int value)
    {
        switch (id)
        {
            case 0:
                this.furnaceBurnTime = value;
                break;
            case 1:
                this.currentItemBurnTime = value;
                break;
            case 2:
                this.cookTime = value;
                break;
            case 3:
                this.totalCookTime = value;
        }
    }

    public int getFieldCount()
    {
        return 4;
    }

    public void clear()
    {
        this.furnaceItemStacks.clear();
    }

    net.minecraftforge.items.IItemHandler handlerTop = new net.minecraftforge.items.wrapper.SidedInvWrapper(this, net.minecraft.util.EnumFacing.UP);
    net.minecraftforge.items.IItemHandler handlerBottom = new net.minecraftforge.items.wrapper.SidedInvWrapper(this, net.minecraft.util.EnumFacing.DOWN);
    net.minecraftforge.items.IItemHandler handlerSide = new net.minecraftforge.items.wrapper.SidedInvWrapper(this, net.minecraft.util.EnumFacing.WEST);

    @SuppressWarnings("unchecked")
    @Override
    public <T> T getCapability(net.minecraftforge.common.capabilities.Capability<T> capability, net.minecraft.util.EnumFacing facing)
    {
        if (facing != null && capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
            if (facing == EnumFacing.DOWN)
                return (T) handlerBottom;
            else if (facing == EnumFacing.UP)
                return (T) handlerTop;
            else
                return (T) handlerSide;
        return super.getCapability(capability, facing);
    }
}


text:
In material design, the physical properties of paper are translated to the screen.
The background of an application resembles the flat,
opaque texture of a sheet of paper,
and an application's behavior mimics paper's ability to be re-sized, shuffled,
and bound together in multiple sheets.

```javascript
Paper.propTypes = {

  // The component used for the root node.
  // Either a string to use a DOM element or a component.
  // default: 'div'
  component: PropTypes.string,

  // Shadow depth, corresponds to dp in the spec.
  // It's accepting values between 0 and 24 inclusive.
  // default: 2
  elevation: PropTypes.number,

  // If true, rounded corners are disabled.
  // default: false
  square: PropTypes.bool
}
```


text:
namespace UnityWinForms
{
    using UnityEngine;

    using UnityWinForms.Examples;

    public class UnitWinFormsExamples : MonoBehaviour
    {
        public static Material s_chartGradient;
        public Material ChartGradient;

        private void Start()
        {
            s_chartGradient = ChartGradient;

            var form = new FormExamples();

            form.Show();
        }
    }
}


text:
package org.esupportail.dining.domainservices.domain;

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

import org.esupportail.commons.services.logging.Logger;
import org.esupportail.commons.services.logging.LoggerImpl;
import org.esupportail.dining.domain.beans.User;
import org.springframework.beans.factory.InitializingBean;

/**
 * @author Yves Deschamps (Universite de Lille 1) - 2010
 *
 */
public class DomainServiceImpl implements DomainService, InitializingBean {

	/**
	 * For Serialize.
	 */
	private static final long serialVersionUID = 5562208937407153456L;

	/**
	 * For Logging.
	 */
	@SuppressWarnings("unused")
	private final Logger logger = new LoggerImpl(this.getClass());

	/**
	 * En l'absence de Dao et de Ldap, on constitue ici une liste... limitee de
	 * fait a l'utilisateur courant.
	 */
	private List<User> users;

	/**
	 * Constructor.
	 */
	public DomainServiceImpl() {
		super();
		users = new ArrayList<User>();
	}

	public void afterPropertiesSet() throws Exception {
		// nothing to do yet.
	}

	public User getUser(String uid) {
		User user = null;
		for (User userInList : users) {
			if (userInList.getLogin().equals(uid)) {
				user = userInList;
				break;
			}
		}
		if (user == null) {
			user = new User();
			user.setLogin(uid);
			// On cree l'utilisateur, son nom complet prend la valeur de
			// l'Uid.
			user.setDisplayName(uid);
			user.setLanguage("fr");
			users.add(user);
		}
		return user;
	}

}


text:
package de.tsystems.mms.apm.performancesignature.ui.util;

import com.gargoylesoftware.htmlunit.html.DomText;

import java.util.List;

public class TestUtils {

    private TestUtils() {
    }

    public static boolean containsMeasure(List<?> list, String search) {
        return list.stream().anyMatch(text -> ((DomText) text).getWholeText().trim().equals(search));
    }
}


text:
<!DOCTYPE html>

	<title>OH-HELL Play</title>
	<link rel="stylesheet" type="text/css" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="/app/css/cover.css">
	<link rel="stylesheet" type="text/css" href="/bower_components/jquery-ui/themes/smoothness/jquery-ui.css">
	<link rel="stylesheet" type="text/css" href="/app/css/index.css">

Number of Players

2

					BACK

					NEXT


text:
package org.openweathermap.api.query.currentweather;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.openweathermap.api.query.QueryRequestPartBuilder;
import org.openweathermap.api.query.Type;

@EqualsAndHashCode(callSuper = true)
@Data
public class ByCityName extends AbstractCurrentWeatherOneLocationQuery {
    private final String cityName;
    private String countryCode;
    private Type type;

    public ByCityName(String cityName) {
        this.cityName = cityName;
    }

    @Override
    protected String getRequestPart() {
        return QueryRequestPartBuilder.byCityName(getCityName(), getCountryCode(), getType());
    }
}


text:
.progressWrapper {
	width: 357px;
	overflow: hidden;
}

.progressContainer {
	margin: 5px;
	padding: 4px;
	border: solid 1px #E8E8E8;
	background-color: #F7F7F7;
	overflow: hidden;
}
/* Message */
.message {
	margin: 1em 0;
	padding: 10px 20px;
	border: solid 1px #FFDD99;
	background-color: #FFFFCC;
	overflow: hidden;
}
/* Error */
.red {
	border: solid 1px #B50000;
	background-color: #FFEBEB;
}

/* Current */
.green {
	border: solid 1px #DDF0DD;
	background-color: #EBFFEB;
}

/* Complete */
.blue {
	border: solid 1px #CEE2F2;
	background-color: #F0F5FF;
}

.progressName {
	font-size: 8pt;
	font-weight: 700;
	color: #555;
	width: 323px;
	height: 14px;
	text-align: left;
	white-space: nowrap;
	overflow: hidden;
}

.progressBarInProgress,
.progressBarComplete,
.progressBarError {
	font-size: 0;
	width: 0%;
	height: 2px;
	background-color: blue;
	margin-top: 2px;
}

.progressBarComplete {
	width: 100%;
	background-color: green;
	visibility: hidden;
}

.progressBarError {
	width: 100%;
	background-color: red;
	visibility: hidden;
}

.progressBarStatus {
	margin-top: 2px;
	width: 337px;
	font-size: 7pt;
	font-family: Arial;
	text-align: left;
	white-space: nowrap;
}

a.progressCancel {
	font-size: 0;
	display: block;
	height: 14px;
	width: 14px;
	background-image: url(../images/cancelbutton.gif);
	background-repeat: no-repeat;
	background-position: -14px 0px;
	float: right;
}

a.progressCancel:hover {
	background-position: 0px 0px;
}

#thumbnails ul li{float:left;list-style-type:none;width:105px;margin-left:5px;}
#thumbnails .button{display:block;position: relative;right:-84px;top: -118px;width: 30px;z-index: 1103;cursor:pointer;}
#pic_list li{padding:0 0 0 5px;}


text:
package org.openksavi.sponge.features.model.geo;

import java.io.Serializable;

import org.openksavi.sponge.SpongeException;

/**
 * A geo position.
 */
public class GeoPosition implements Serializable, Cloneable {

    private static final long serialVersionUID = -711901067929339815L;

    private Double latitude;

    private Double longitude;

    public GeoPosition(Double latitude, Double longitude) {
        this.latitude = latitude;
        this.longitude = longitude;
    }

    public GeoPosition() {
    }

    public GeoPosition withLatitude(Double latitude) {
        setLatitude(latitude);
        return this;
    }

    public GeoPosition withLongitude(Double longitude) {
        setLongitude(longitude);
        return this;
    }

    public Double getLatitude() {
        return latitude;
    }

    public void setLatitude(Double latitude) {
        this.latitude = latitude;
    }

    public Double getLongitude() {
        return longitude;
    }

    public void setLongitude(Double longitude) {
        this.longitude = longitude;
    }

    @Override
    public GeoPosition clone() {
        try {
            return (GeoPosition) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new SpongeException(e);
        }
    }
}


text:
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
  DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
  SOURCE="$(readlink "$SOURCE")"
  [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

pushd $DIR
java -jar bin/emodb-web-local-*.jar server conf/config-local.yaml conf/config-ddl-local.yaml conf/cassandra.yaml -z
popd


text:
venv/bin/python --version >/dev/null 2>&1 || virtualenv venv
./in-venv.sh pip install -r requirements.txt


text:
/*!
 \file  basetypes.h
 \brief This file contains base type definitions

 \author David C. Anastasiu
 */

#ifndef _L2AP_BASETYPES_H_
#define _L2AP_BASETYPES_H_

/* Index type should be a signed int type */
#ifdef IDXTYPE_LONG
	#define PRNT_IDXTYPE "%ld"
	typedef int64_t idx_t;
#elif defined IDXTYPE_SHORT
	#define PRNT_IDXTYPE "%hi"
	typedef short idx_t;
#else
	#define IDXTYPE_INT
	#define PRNT_IDXTYPE "%d"
	typedef int32_t idx_t;
#endif

/* Pointer type should be a signed int type, but can also be unsigned */
#ifdef PTRTYPE_SSZIE
	#define PRNT_PTRTYPE "%zu"
	typedef ssize_t ptr_t;
//#elif defined PTRTYPE_SIZE	/* TODO: Bug when using unsigned pointer types */
//	#define PRNT_PTRTYPE "%zd"
//	typedef size_t ptr_t;
//#elif defined PTRTYPE_ULONG
//	#define PRNT_PTRTYPE "%lu"
//	typedef uint64_t ptr_t;
#elif defined PTRTYPE_LONG
	#define PRNT_PTRTYPE "%ld"
	typedef int64_t ptr_t;
//#elif defined PTRTYPE_UINT
//	#define PRNT_PTRTYPE "%u"
//	typedef uint32_t ptr_t;
#else
	#define PTRTYPE_INT
	#define PRNT_PTRTYPE "%d"
	typedef int32_t ptr_t;
#endif

/* Value type should be a float or double */
#ifdef VALTYPE_DOUBLE
	typedef double val_t;
	#define PRNT_VALTYPE "%g"
#else
	#define VALTYPE_FLOAT
	#define PRNT_VALTYPE "%f"
	typedef float val_t;
#endif

/* Accumulator type should be a float or double */
#ifdef ACCUMTYPE_DOUBLE
	typedef double accum_t;
	#define PRNT_ACCUMTYPE "%g"
#else
	#define ACCUMTYPE_FLOAT
	#define PRNT_ACCUMTYPE "%f"
	typedef float accum_t;
#endif

#define MAXIDX	(1<<8*sizeof(idx_t)-2)

#endif