text:
package org.visualeagle.gui.projectnavigation;

import org.visualeagle.gui.editorwindow.EditorWindow;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.IOException;
import java.util.List;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.event.TreeExpansionEvent;
import javax.swing.event.TreeWillExpandListener;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.ExpandVetoException;
import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel;
import org.visualeagle.project.projectloaders.ProjectStructure;
import org.visualeagle.project.vnodes.AbstractVNode;
import org.visualeagle.project.vnodes.VirtualFolderVNode;
import org.visualeagle.utils.ImageManager;
import org.visualeagle.utils.Lookup;

/**
 * @author Dmitry
 */
public class ProjectNavigationWindow extends JInternalFrame {

    private JTree jtree;
    private DefaultMutableTreeNode root;

    public ProjectNavigationWindow(String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable) {
        super(title, resizable, closable, maximizable, iconifiable);
        initGui();
    }

    private void initGui() {
        JScrollPane scrollPane = new JScrollPane();
        root = new DefaultMutableTreeNode();
        root.setAllowsChildren(true);
        jtree = new JTree(root);
        jtree.setRootVisible(false);
        jtree.setShowsRootHandles(true);
        jtree.setCellRenderer(createCellRenderer());
        jtree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
        jtree.addTreeWillExpandListener(new TreeWillExpandListener() {
            @Override
            public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException {
                onTreeWillExpand(event);
            }

            @Override
            public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException {
                onTreeWillCollapse(event);
            }
        });

        jtree.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                if (e.getClickCount() >= 2) {
                    try {
                        onTreeItemSelected();
                    } catch (IOException ex) {
                        ex.printStackTrace();
                    }
                }
            }
        });

        scrollPane.getViewport().add(jtree);
        setLayout(new BorderLayout(0, 0));
        add(scrollPane);
    }

    private void onTreeItemSelected() throws IOException {
        TreePath selectionPath = jtree.getSelectionPath();
        if (selectionPath != null) {
            DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) selectionPath.getLastPathComponent();
            AbstractVNode vnode = (AbstractVNode) treeNode.getUserObject();
            if (!vnode.isLeaf()) {
                return;
            }

            EditorWindow editorWindow = Lookup.get().get(EditorWindow.class);
            editorWindow.editFile(vnode);
        }
    }

    private void sortVNodes(List<AbstractVNode> files) {

        files.sort((AbstractVNode o1, AbstractVNode o2) -> {
            if (o1.isLeaf() == o2.isLeaf()) {
                return o1.getName().compareToIgnoreCase(o2.getName());
            }
            if (!o1.isLeaf()) {
                return -1;
            }
            return 1;
        });

    }

    private void onTreeWillExpand(TreeExpansionEvent event) {
        DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) event.getPath().getLastPathComponent();
        AbstractVNode vnode = (AbstractVNode) treeNode.getUserObject();
        treeNode.removeAllChildren();
        if (!vnode.isLeaf()) {
            List<AbstractVNode> children = vnode.getChildren();
            if (!(vnode instanceof VirtualFolderVNode)) {
                sortVNodes(children);
            }
            for (AbstractVNode child : children) {

                DefaultMutableTreeNode childNode = new DefaultMutableTreeNode(child);
                childNode.setAllowsChildren(!child.isLeaf());
                if (!child.isLeaf()) {
                    childNode.add(createDummyTreeNode());
                } else {
                    String extension = child.getExtension();
                    if (extension.equals("h") || extension.equals("hpp")) {
                        child.setIcon(ImageManager.get().getIcon("fileH"));
                    }else
                    if (extension.equals("c")) {
                        child.setIcon(ImageManager.get().getIcon("fileC"));
                    }else
                    if (extension.equals("cpp")) {
                        child.setIcon(ImageManager.get().getIcon("fileCpp"));
                    }
                }

                treeNode.add(childNode);
            }
        }
    }

    private void onTreeWillCollapse(TreeExpansionEvent event) {

    }

    private DefaultMutableTreeNode createDummyTreeNode() {
        return new DefaultMutableTreeNode("DUMMY_NODE");
    }

    public void closeCurrentProject() {
        ((DefaultTreeModel)jtree.getModel()).setRoot(null);
        ((DefaultTreeModel)jtree.getModel()).reload();
    }

    public void loadProject(ProjectStructure projectStructure) {
        DefaultMutableTreeNode projectRootNode = new DefaultMutableTreeNode(projectStructure.getRootProjectVFile());
        projectRootNode.setUserObject(projectStructure.getRootProjectVFile());
        root = new DefaultMutableTreeNode();
        root.setAllowsChildren(true);
        root.add(projectRootNode);
        projectRootNode.add(createDummyTreeNode());
        DefaultTreeModel treeModel = (DefaultTreeModel) jtree.getModel();
        treeModel.setRoot(root);
    }

    private DefaultTreeCellRenderer createCellRenderer() {
        return new DefaultTreeCellRenderer() {
            @Override
            public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
                JLabel component = (JLabel) super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); //To change body of generated methods, choose Tools | Templates.
                DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value;
                if (!(treeNode.getUserObject() instanceof AbstractVNode)) {
                    return component;
                }

                AbstractVNode vnode = (AbstractVNode) treeNode.getUserObject();
                if (vnode == null) {
                    return component;
                }

                component.setIcon(vnode.getIcon());
                component.setText(vnode.getName());
                return component;
            }
        };
    }
}


text:
<?php

namespace Jimdo\Logbook\Web\Validator;

use PHPUnit\Framework\TestCase;

class DateValidatorTest extends TestCase
{
    /**
     * @test
     */
    public function itShouldValidateDate()
    {
        $validator = new DateValidator();
        $this->assertFalse($validator->isValid(1.1));
        $this->assertFalse($validator->isValid(true));
        $this->assertFalse($validator->isValid([]));
        $this->assertFalse($validator->isValid(new \stdClass()));
        $this->assertFalse($validator->isValid(null));
        $this->assertFalse($validator->isValid('Integer'));
        $this->assertFalse($validator->isValid(''));
        $this->assertFalse($validator->isValid(1));

        $this->assertFalse($validator->isValid('32.11.11'));
        $this->assertFalse($validator->isValid('31.13.11'));
        $this->assertFalse($validator->isValid('31.12.-11'));
        $this->assertFalse($validator->isValid('31.-12.11'));
        $this->assertFalse($validator->isValid('-31.12.11'));
        $this->assertFalse($validator->isValid('1111.12.11'));

        $this->assertTrue($validator->isValid('1.1.11'));
        $this->assertTrue($validator->isValid('01.01.11'));
        $this->assertTrue($validator->isValid('11.11.11'));
        $this->assertTrue($validator->isValid('11.11.00'));
        $this->assertTrue($validator->isValid('11.11.1100'));
    }

    /**
     * @test
     */
    public function itShouldReturnErrorMessage()
    {
        $validator = new DateValidator();

        $value = 'Hallo';
        $validator->isValid($value);

        $this->assertEquals("'$value' is not a date!", $validator->errorMessage());

        $value = 1.0;
        $validator->isValid($value);

        $this->assertEquals("'$value' is not a date!", $validator->errorMessage());

        $value = new \stdClass();
        $validator->isValid($value);

        $value = get_class($value);

        $this->assertEquals("'$value' is not a date!", $validator->errorMessage());

        $value = '-31.12.11';
        $validator->isValid($value);

        $this->assertEquals("'$value' is not a date!", $validator->errorMessage());
    }

    /**
     * @test
     */
    public function itShouldReturnErrorMessageOnlyOnInvalidState()
    {
        $validator = new DateValidator();
        $validator->isValid('29.08.2016');
        $this->assertEmpty($validator->errorMessage());
    }
}

redpajama_set_name: RedPajamaGithub


text:
(function() {
  this.Api = {
    groupsPath: "/api/:version/groups.json",
    groupPath: "/api/:version/groups/:id.json",
    namespacesPath: "/api/:version/namespaces.json",
    groupProjectsPath: "/api/:version/groups/:id/projects.json",
    projectsPath: "/api/:version/projects.json?simple=true",
    labelsPath: "/api/:version/projects/:id/labels",
    licensePath: "/api/:version/licenses/:key",
    gitignorePath: "/api/:version/gitignores/:key",
    gitlabCiYmlPath: "/api/:version/gitlab_ci_ymls/:key",
    issuableTemplatePath: "/:namespace_path/:project_path/templates/:type/:key",

    group: function(group_id, callback) {
      var url = Api.buildUrl(Api.groupPath)
        .replace(':id', group_id);
      return $.ajax({
        url: url,
        data: {
          private_token: gon.api_token
        },
        dataType: "json"
      }).done(function(group) {
        return callback(group);
      });
    },
    // Return groups list. Filtered by query
    // Only active groups retrieved
    groups: function(query, skip_ldap, callback) {
      var url = Api.buildUrl(Api.groupsPath);
      return $.ajax({
        url: url,
        data: {
          private_token: gon.api_token,
          search: query,
          per_page: 20
        },
        dataType: "json"
      }).done(function(groups) {
        return callback(groups);
      });
    },
    // Return namespaces list. Filtered by query
    namespaces: function(query, callback) {
      var url = Api.buildUrl(Api.namespacesPath);
      return $.ajax({
        url: url,
        data: {
          private_token: gon.api_token,
          search: query,
          per_page: 20
        },
        dataType: "json"
      }).done(function(namespaces) {
        return callback(namespaces);
      });
    },
    // Return projects list. Filtered by query
    projects: function(query, order, callback) {
      var url = Api.buildUrl(Api.projectsPath);
      return $.ajax({
        url: url,
        data: {
          private_token: gon.api_token,
          search: query,
          order_by: order,
          per_page: 20
        },
        dataType: "json"
      }).done(function(projects) {
        return callback(projects);
      });
    },
    newLabel: function(project_id, data, callback) {
      var url = Api.buildUrl(Api.labelsPath)
        .replace(':id', project_id);
      data.private_token = gon.api_token;
      return $.ajax({
        url: url,
        type: "POST",
        data: data,
        dataType: "json"
      }).done(function(label) {
        return callback(label);
      }).error(function(message) {
        return callback(message.responseJSON);
      });
    },
    // Return group projects list. Filtered by query
    groupProjects: function(group_id, query, callback) {
      var url = Api.buildUrl(Api.groupProjectsPath)
        .replace(':id', group_id);
      return $.ajax({
        url: url,
        data: {
          private_token: gon.api_token,
          search: query,
          per_page: 20
        },
        dataType: "json"
      }).done(function(projects) {
        return callback(projects);
      });
    },
    // Return text for a specific license
    licenseText: function(key, data, callback) {
      var url = Api.buildUrl(Api.licensePath)
        .replace(':key', key);
      return $.ajax({
        url: url,
        data: data
      }).done(function(license) {
        return callback(license);
      });
    },
    gitignoreText: function(key, callback) {
      var url = Api.buildUrl(Api.gitignorePath)
        .replace(':key', key);
      return $.get(url, function(gitignore) {
        return callback(gitignore);
      });
    },
    gitlabCiYml: function(key, callback) {
      var url = Api.buildUrl(Api.gitlabCiYmlPath)
        .replace(':key', key);
      return $.get(url, function(file) {
        return callback(file);
      });
    },
    issueTemplate: function(namespacePath, projectPath, key, type, callback) {
      var url = Api.buildUrl(Api.issuableTemplatePath)
        .replace(':key', key)
        .replace(':type', type)
        .replace(':project_path', projectPath)
        .replace(':namespace_path', namespacePath);
      $.ajax({
        url: url,
        dataType: 'json'
      }).done(function(file) {
        callback(null, file);
      }).error(callback);
    },
    buildUrl: function(url) {
      if (gon.relative_url_root != null) {
        url = gon.relative_url_root + url;
      }
      return url.replace(':version', gon.api_version);
    }
  };

}).call(this);


text:
#include <modules/brushingandlinking/datastructures/indexlist.h>

#include <inviwo/core/datastructures/bitset.h>          // for BitSet
#include <inviwo/core/io/serialization/deserializer.h>  // for Deserializer
#include <inviwo/core/io/serialization/serializer.h>    // for Serializer
#include <inviwo/core/util/stdextensions.h>             // for map_erase_remove_if, transform
#include <inviwo/core/util/typetraits.h>                // for identity, alwaysTrue

#include <functional>  // for __base
#include <utility>     // for make_pair, pair

namespace inviwo {

bool IndexList::empty() const { return indices_.empty(); }

size_t IndexList::size() const { return indices_.size(); }

void IndexList::clear() {
    indices_.clear();
    indicesBySource_.clear();
    indicesDirty_ = false;
}

const BitSet& IndexList::getIndices() const {
    update();
    return indices_;
}

bool IndexList::set(std::string_view src, const BitSet& indices) {
    const std::string source(src);
    auto it = indicesBySource_.find(source);

    if (it == indicesBySource_.end()) {
        if (indices.empty()) return false;

        indicesBySource_.emplace(std::make_pair(source, indices));
    } else {
        if (it->second == indices) return false;

        if (indices.empty()) {
            indicesBySource_.erase(it);
        } else {
            it->second = indices;
        }
    }
    indicesDirty_ = true;
    return true;
}

bool IndexList::contains(uint32_t idx) const {
    update();
    return indices_.contains(idx);
}

bool IndexList::removeSources(const std::vector<std::string>& sources) {
    size_t modified = 0u;
    for (auto& source : sources) {
        modified += indicesBySource_.erase(source);
    }
    indicesDirty_ |= (modified != 0);
    return (modified != 0);
}

void IndexList::update() const {
    if (!indicesDirty_) return;

    using T = std::unordered_map<std::string, BitSet>::value_type;
    util::map_erase_remove_if(indicesBySource_, [](const T& p) { return p.second.empty(); });

    auto bitsets =
        util::transform(indicesBySource_, [](auto& p) -> const BitSet* { return &p.second; });
    indices_ = BitSet::fastUnion(bitsets);

    indicesDirty_ = false;
}

void IndexList::serialize(Serializer& s) const {
    s.serialize("source", indicesBySource_, "indices");
}

void IndexList::deserialize(Deserializer& d) {
    indicesBySource_.clear();
    d.deserialize("source", indicesBySource_, "indices");
    indicesDirty_ = true;
}

}  // namespace inviwo


text:
import { RouteHandler } from './route_handler';
import { Promise } from 'angular2/src/core/facade/async';
import { Type } from 'angular2/src/core/facade/lang';
export declare class SyncRouteHandler implements RouteHandler {
    componentType: Type;
    data: {
        [key: string]: any;
    };
    constructor(componentType: Type, data?: {
        [key: string]: any;
    });
    resolveComponentType(): Promise<any>;
}


text:
<?php

declare(strict_types=1);

namespace Novuso\Common\Domain\Value\Money;

/**
 * Interface MoneyFormatter
 */
interface MoneyFormatter
{
    /**
     * Retrieves a formatted string for a monetary value
     */
    public function format(Money $money): string;
}


text:
[Vagrant](https://www.vagrantup.com/)

## Running Demo

### 1. Boot virtual machines

```bash
vagrant up
```

### 2. Evaluate Requests

* Raw web server request: http://localhost:8080/
* Edge request: http://localhost:8081/

## Accessing VMs

```sh
vagrant ssh web
# or
vagrant ssh edge
```

## varnishtest example

```sh
# from within "edge" VM
cd /vagrant
varnishtest response-cache.vtc
```

## VCL editing

When the edge VM is provisioned the `default.vcl` file is copied to `/etc/varnish` to replace the default VCL.

The `default.vcl` file includes `/vagrant/actual.vcl` which is the VCL file containing the _actual_ VCL code.

You can make adjustments to `actual.vcl` on your workstation and then reload them from within edge VM as follows:

```sh
# from within "edge" VM

# live reload
sudo service varnish reload

# or

# hard restart
sudo service varnish restart
```

```sh
# from within "edge" VM
cd /vagrant
varnishtest response-cache.vtc
```

## More reading

* https://www.w3.org/TR/esi-lang
* https://www.w3.org/TR/edge-arch/
* https://www.varnish-cache.org/docs/4.0/users-guide/esi.html
* https://www.akamai.com/us/en/support/esi.jsp
* https://blog.cloudflare.com/making-edge-side-includes-esi-automatic-and-e/
* https://www.fastly.com/blog/using-esi-part-1-simple-edge-side-include

### Varnish test resources

* http://www.clock.co.uk/blog/getting-started-with-varnishtest
* http://book.varnish-software.com/4.0/chapters/Examining_Varnish_Server_s_Output.html
* http://blog.zenika.com/2012/08/27/introducing-varnishtest/


text:
import storm

class OutputWriter(object):

    def __init__(self, scriptname, streamname):
        self.scriptname = scriptname
        self.streamname = streamname

    def write(self, output):
        result = output if isinstance(output, list) else [output]
        try:
            storm.emit(result, stream=self.streamname)
            storm.log("Dispel4Py ------> %s: Emitted to stream %s."
                      % (self.scriptname, self.streamname))
        except TypeError:
            # encode manually
            encoded = encode_types(result)
            storm.emit(encoded, stream=self.streamname)
            storm.log("Dispel4Py ------> %s: Emitted to stream %s."
                      % (self.scriptname, self.streamname))

# import io
# import numpy
# import base64
# import pickle
# from obspy.core import read as obread
# from obspy.core.stream import Stream

def encode_types(obj):
    # storm.log('encoding %s' % str(obj))
    new_obj = obj
    if isinstance(obj, (tuple, list)):
        new_obj = []
        for i in obj:
            new_obj.append(encode_types(i))
    elif isinstance(obj, set):
        new_obj = set()
        for i in obj:
            new_obj.add(encode_types(i))
    elif isinstance(obj, dict):
        new_obj = dict()
        for k, v in obj.iteritems():
            new_obj[k] = encode_types(v)
    # elif isinstance(obj, Stream):
    #     buf = io.BytesIO()
    #     obj.write(buf, "MSEED")
    #     new_obj = {
    #         '__dispel4py.type__': 'obspy.Stream',
    #         'data': base64.b64encode(buf.getvalue())
    #     }
    #     responses = []
    #     for tr in obj:
    #         try:
    #             responses.append(pickle.dumps(tr.stats.response))
    #         except:
    #             pass
    #     if responses:
    #         new_obj['response'] = responses
    # elif isinstance(obj, numpy.ndarray):
    #     new_obj = {
    #         '__dispel4py.type__': 'numpy.ndarray',
    #         'dtype': obj.dtype.name,
    #         'data': base64.b64encode(obj)
    #     }
    return new_obj

def decode_types(obj):
    new_obj = obj
    if isinstance(obj, (tuple, list)):
        new_obj = type(obj)()
        for i in obj:
            new_obj.append(decode_types(i))
    elif isinstance(obj, set):
        new_obj = set()
        for i in obj:
            new_obj.add(decode_types(i))
    elif isinstance(obj, dict):
        # try:
        #     objtype = obj['__dispel4py.type__']
        #     if objtype == 'numpy.ndarray':
        #         r = base64.decodestring(obj['data'])
        #         return numpy.frombuffer(r, dtype=obj['dtype'])
        #     elif objtype == 'obspy.Stream':
        #         buf = io.BytesIO()
        #         buf.write(base64.b64decode(obj['data']))
        #         st = obread(buf)
        #         if 'response' in obj:
        #             for tr, resp in zip(st, obj['response']):
        #                 tr.stats.response = pickle.loads(resp)
        #         return st
        # except KeyError:
        #     pass
        # if it's just a normal dictionary then decode recursively
        new_obj = dict()
        for k, v in obj.iteritems():
            new_obj[k] = decode_types(v)
    return new_obj


text:
An Ubuntu Vagrant development box, built with Packer.

You can [download the box on Vagrant Cloud](https://app.vagrantup.com/idearium/boxes/ubuntu-16.04).

## Features

- Ubuntu 16.04 LTS (Xenial Xerus) Server
- Docker
- Docker Compose
- Git
- MongoDB Shell + Tools
- Node.js

## Requirements

Make sure all dependencies have been installed before moving on:

  - [Packer](http://www.packer.io/)
  - [Vagrant](http://vagrantup.com/)
    - [vagrant-hostmanager](https://github.com/devopsgroup-io/vagrant-hostmanager/)
  - [VirtualBox](https://www.virtualbox.org/)
  - [VMWare](http://www.vmware.com/products/fusion.html)

## Setup

1. Download this repository.
1. Make sure your system meets all dependencies.
1. Run `packer build ubuntu-16.04.json` to build the boxes.
1. Upload the boxes in the `builds` folder to [Vagrant Cloud](https://app.vagrantup.com/idearium/boxes/ubuntu-16.04).

## Testing

You can test the built boxes with the provided Vagrant script. Make sure you change the box path if you are using `vmware`.


text:
a:hover{
    text-decoration: none;
}
.confirm,.cancel,#popConfirmBtn{
    width: 140px;height: 38px;font-size: 18px;border: none;margin-right: 55px;cursor: pointer;
    font-family: "Microsoft YaHei";
}
.confirm,#popConfirmBtn{
    float: left;
}
.cancel{
    float: right;
}
/*section .newTb th{*/
/*text-align: left;*/
/*}*/
section textarea{
    color: rgb(137,137,137);font-size: 14px;
}
section .newTb td{
    font-size: 14px;border: none;
    /*text-align: left;*/
}
section .newTb tr{
    border-top: 1px solid #cccccc;
}
.newTb tr:hover{
    background-color:#efeff0 ;
}
ul>li{
    font-size: 14px;
}
.relativePosition{
    position: relative;
}
#ulType>li,#ulAttitude>li,#ulTarget>li,#ulPeriod>li,#ulStatus>li,#ulUser>li,#ulType1>li,#ulPerfect>li,#ulTime1>li,#ulTime2>li,#ulTime3>li,#ulTime4>li,#ulTime5>li,#ulTime6>li,#ulTime7>li,#ulTime8>li,#ulTime9>li,#ulTime10>li,#ulTime11>li,#ulTime12>li,#ulTime13>li,#ulTime14>li,#ulTime15>li,#ulModel>li{
    cursor: pointer;
}
#ulType>li:hover,#ulAttitude>li:hover,#ulType1>li:hover,#ulTarget>li:hover,#ulStatus>li:hover,#ulPeriod>li:hover,#ulUser>li:hover,#ulPerfect>li:hover,#ulTime1>li:hover,#ulTime2>li:hover,#ulTime3>li:hover,#ulTime4>li:hover,#ulTime5>li:hover,#ulTime6>li:hover,#ulTime7>li:hover,#ulTime8>li:hover,#ulTime9>li:hover,#ulTime10>li:hover,#ulTime11>li:hover,#ulTime12>li:hover,#ulTime13>li:hover,#ulTime14>li:hover,#ulTime15>li:hover,#ulModel>li:hover{
    background: #dddddd;
}
#SWFUpload_2,#SWFUpload_1,#SWFUpload_3,#SWFUpload_4,#SWFUpload_0{
    left: 0;
}
.btn,.btn-small,.btn-success,.cancelBtn {
    background-color: #4fb9e3;
    border:none;color: #ffffff;
    padding: 6px;
    /*float: right;*/
}
.btn-success:hover,.cancelBtn:hover,.toNow:hover,.clearInputTime:hover{
    background-color: #3a9ce3;
}
.daterangepicker .ranges{
    padding: 0;
}
.daterangepicker td.active, .daterangepicker td.active:hover{
    color: #fff;background-color:#31A4E3 ;text-align: center;
}
.table-condensed>thead>tr>th{
    font-weight: normal;font-size: 12px;
}

.table-condensed>tbody>tr>td, .table-condensed>tbody>tr>th, .table-condensed>tfoot>tr>td, .table-condensed>tfoot>tr>th, .table-condensed>thead>tr>td, .table-condensed>thead>tr>th{
    padding: 2px;
}
.newTb tr th,.newTb tr td{
    text-align: left;
}
.newTb th:first-child,.newTb td:first-child{
    text-align: center;
}
input[name=word],input[name=keyWords],#calenderAccount,#calenderAccount1,#realType,#realAttitude,#realPeriod,#realStatus,#realIndustry,#realModel,#realHide,#realPerfect,#realUser{
    padding-left: 10px;color: #333333 !important;
}
.searchBtnChange{
    font-size: 16px !important;
}
.realProvince,.realCity,#realType,input[type=text],#realLeader,textarea,#realHide,#realAttitude,#realDiff,#realType1,#realSex,#realCareer,#realPosition,#realIndustry1,#realTime1,#realTime2,#realTime3,#realTime4,#realTime5,#realTime6,#realTime7,#realTime8,#vipInfo2,#vipInfo3,#realTime9,#realTime10,#realTime11,#realTime12,#realTime13,#realTime14,#realTime15{
    padding-left: 10px;color: #333333 !important;
}

.searchOption{
    float: none;
}
.searchArea .searchOption{
    float: left;display: inline-block;
}
.searchArea .searchOption{
    width: 30%;
}
.searchArea .searchOption div>input{
    font-size: 14px;color: rgb(137,137,137);width: 85%;height: 38px;margin-top: 10px;border: 1px solid #cccccc;
}
.searchArea .searchOption>span{
    font-size: 14px;color: rgb(137,137,137);
}

.qflexbox
{
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}
.qflexbox.spacebetween
{
    justify-content:space-between;
}
.qflexbox.justifycontentcenter
{
    justify-content:center;
}

.qflexbox.stretch
{
    -webkit-box-align: stretch;
    -webkit-align-items: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
}

.qflexbox.top
{
    -webkit-box-align: start;
    -webkit-align-items: flex-start;
    -ms-flex-align: start;
    align-items: flex-start;
}

.qflexbox.center
{
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}
.qflexbox.vertical
{
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
}

.qflexbox > .fixiedarea{
    display:block;
    -webkit-box-flex:none;
    -webkit-flex:none;/*相当于none*/
    -ms-flex:none;/*相当于none*/
    flex:none;/*相当于none*/
}
.qflexbox > .fixiedarea.qflexbox{
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}
.qflexbox > .dynamicarea{
    display:block;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
}
.qflexbox > .dynamicarea.qflexbox{
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}

.qinputgroup-box{
    padding:20px;
}
.qinputgroup {
    margin:0.10rem 0;
    position: relative;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}
.qinputgroup .qinputitem{
    height:3em;
    padding:0.1rem 0.1rem;
    border:none;
    display:block;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
}
.qinputgroup .qinputitem:focus{
    outline:none;
}
.qinputgroup .qinputitem-addon{
    font-size: 1.5em;
    margin:0 1em;
    /*display: -webkit-box;*/
    /*display: -webkit-flex;*/
    /*display: -ms-flexbox;*/
    /*display: flex;*/
    /*-webkit-box-align: center;*/
    /*-webkit-align-items: center;*/
    /*-ms-flex-align: center;*/
    /*align-items: center;*/
}
.qflexbox > .dynamicarea.qinputgroup{
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
}
.qflexbox > .fixiedarea.qinputgroup{
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
}
.qinputbox{
    padding:0.2rem;
    background-color:#ffffff;
}

/**/
.qinputgroup.normal{
    border:1px solid #cccccc;
}

/*
form .ng-dirty.ng-valid{
 }
form .ng-invalid{
     background-color: lightpink;
 }
form *:not(input):not(textarea).ng-invalid{
    border:1px solid red;
}
*/

form .ng-invalid{
    border: 1px solid lightpink;
}
form .ng-valid{
    border: 1px solid #cccccc;
}

form  .success{
    /* border:1px solid blue;*/
}
form .danger{
    /*background-color: lightpink;*/
    border-color: lightpink;
}
form *:not(input):not(textarea).danger{
    border:1px solid red;
}
.newline{
    word-break:break-all; word-wrap:break-word;
}

.title{
        font-size: 14px;color: rgb(35,24,21);margin-right: 31px;
}
.part{
    width: 50%;float: left;font-size: 14px;color: rgb(137,137,137);margin-top: 58px;position: relative;
}
.newTb{
    c;width:100%;margin: 10px 0 30px 0;
}
.newTb tr{
    border-top: 1px solid #cccccc;
}
.newTb th{
    font-size: 14px;color: rgb(89,87,87);background-color:#efeff0 ;height: 40px;font-weight: normal;
}
.newTb td{
    height: 40px;overflow: hidden;
}
.bottomBtn{
    margin-top: 50px;text-align: left;
}
.bottomBtn>input{
    border: none;height: 38px;width: 140px;line-height: 38px;text-align: center;font-size: 16px;
}
.inputBox{
    width: 220px;color: rgb(137,137,137);height: 38px;c;
}
.addBox{
    margin: 0 auto;width: 50px;height: 40px;cursor: pointer;
}
.addBtn{
    position: relative;height:40px;width:100px ;text-align: center;line-height: 40px;font-size: 14px;border: none;float: right;
}
.searchImg{
    height: 100%;width: 14px;background: url("image/addwhite.png") center center no-repeat;display: inline-block;float: left;
}
#pompWindow1{
    /*position: fixed;left: 400px;top: 200px;z-index: 11;*/
    position: absolute;top: 200px;z-index: 11;left: 400px;
}
#ulType1>li,#ulSex>li,#ulPosition>li,#ulCareer>li{
    cursor: pointer;
}
#ulType1>li:hover,#ulSex>li:hover,#ulPosition>li:hover,#ulCareer>li:hover{
    background: #dddddd;
}

.qinputgroup2{
  width:250px;
  display: inline-block;
  position: relative;
  border:none;
}
.qinputgroup2 .qinputitem2{
  padding-left:15px;
  border: 1px solid #cccccc;
  width:100%;
  height:2.5em;
  line-height:2.5em;
  display: block;
}
.qinputgroup2 .addson{
  position: absolute;
  right:0px;
  top:50%;
  transform:translate(0%,-50%);
  height:100%;
  width:38px;
}

.calendar-bg{
    background: url('images/calender1.png') center center no-repeat;
}
.dropdown-bg{
    width:38px;
    height: 38px;
    background: url('images/dropDownBg.png') center center no-repeat;
}

.qdatatable   .update,
.qdatatable   .add,
.qdatatable   .delete,
.qdatatable   .detail,
.qdatatable   .moveup,
.qdatatable   .movedown
{
    display: inline-block;
    height: 100%;
    width: 26px;
    cursor: pointer;
}
.qdatatable   .update{
    background: url(images/update.png) center center no-repeat;
}
.qdatatable   .add{
    background: url(images/add.png) center center no-repeat;
}
.qdatatable  .delete{
    background: url(images/delete.png) center center no-repeat;
}
.qdatatable  .detail{
    background: url(images/detail.png) center center no-repeat;
}
.qdatatable  .moveup{
    background: url(images/moveup.png) center center no-repeat;
}
.qdatatable   .movedown{
    background: url(images/movedown.png) center center no-repeat;
}
.actionbtn{
    padding: 1px 6px;
    display:inline-block;
    background-color: #49aad2;
    color: #fff;
    border: none;
    height: 38px;
    width: 140px;
    line-height: 38px;
    text-align: center;
    font-size: 16px;
}

.fieldbox {
    margin-top:10px;
}
.fieldbox.inline {
    display: inline-block;
    vertical-align: middle;
    margin-right: 20px;
    width: 250px;
    height:60px;
}
.fieldbox span{

}
.fieldbox > div{
    margin-top: 5px;
}

.newTb tr th,.newTb tr td{
    text-align: left;
}
.newTb th:first-child,.newTb td:first-child{
    text-align: center;
}
.table-condensed>tbody>tr>td,
.table-condensed>tbody>tr>th,
.table-condensed>tfoot>tr>td,
.table-condensed>tfoot>tr>th,
.table-condensed>thead>tr>td,
.table-condensed>thead>tr>th{
    padding: 2px;
}
.newTb tr th,.newTb tr td{
    text-align: left;
}
.newTb th:first-child,.newTb td:first-child{
    text-align: center;
}
.newTb{
    width:100%;margin: 10px 0 30px 0;
}
.newTb tr{
    border-top: 1px solid #cccccc;
}
.newTb th{
    font-size: 14px;color: rgb(89,87,87);background-color:#efeff0 ;height: 40px;font-weight: normal;
}
.newTb td{
    height: 40px;
    overflow: hidden;
}

.qdatatable{
    padding: 20px;
    width: 100%;
}
  .update,
  .add,
  .delete,
  .detail,
  .moveup,
  .movedown,
  .childnode
{
    display: inline-block;
    height: 100%;
    width: 26px;
    cursor: pointer;
}
  .update{
    background: url(/image/update.png) center center no-repeat;
}
  .add{
    background: url(/image/add.png) center center no-repeat;
}
 .delete{
    background: url(/image/delete.png) center center no-repeat;
}
 .detail{
    background: url(/image/detail.png) center center no-repeat;
}
 .moveup{
    background: url(/image/moveup.png) center center no-repeat;
}
.movedown{
    background: url(/image/movedown.png) center center no-repeat;
}
.childnode{
    background: url(/image/child.png) center center no-repeat;
}
.poppanel{
    position: fixed;
    left:50%;
    top:50%;
    -webkit-transform: translate(-50%,-50%);
    transform: translate(-50%,-50%);
    padding: 10px;
    min-height: 460px;
    max-height:90%;
    background-color:#cccccc;
    overflow: auto;
    z-index: 11;
}
.poppanel .poppanle-inner{
    padding: 30px;
    background-color: #ffffff;
    height: 100%;
    overflow: hidden;
}


text:
//NOT TESTED!!!
public class MHZ16_Example {

	public static void main(String[] args) throws InterruptedException {
		// ! [Interesting]
		// Instantiate a MHZ16 serial CO2 sensor on uart 0.
		upm_mhz16.MHZ16 co2 = new upm_mhz16.MHZ16(0);

		System.out.println("Make sure that the sensor has had at least 3 minutes to warm up");
		System.out.println("or you will not get valid results.");
		System.out.println("The temperature reported is not the ambient temperature,");
		System.out.println("but rather the temperature of the sensor elements.");

		while (true) {
			if (!co2.getData()) {
				System.out.println("Failed to retrieve data");
				continue;
			}
			System.out.println("CO2 concentration: " + co2.getGas() + "PPM, Temperature (in C): "
					+ co2.getTemperature());

			Thread.sleep(2000);
		}
		// ! [Interesting]
	}
}


text:
package org.insightech.er.editor.controller.editpart.outline.dictionary;

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

import org.eclipse.gef.DragTracker;
import org.eclipse.gef.Request;
import org.eclipse.gef.RequestConstants;
import org.eclipse.gef.tools.SelectEditPartTracker;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.ui.PlatformUI;
import org.insightech.er.ERDiagramActivator;
import org.insightech.er.ImageKey;
import org.insightech.er.editor.controller.command.diagram_contents.not_element.dictionary.EditWordCommand;
import org.insightech.er.editor.controller.editpart.outline.AbstractOutlineEditPart;
import org.insightech.er.editor.model.ERDiagram;
import org.insightech.er.editor.model.diagram_contents.element.node.category.Category;
import org.insightech.er.editor.model.diagram_contents.element.node.table.ERTable;
import org.insightech.er.editor.model.diagram_contents.element.node.table.column.ColumnHolder;
import org.insightech.er.editor.model.diagram_contents.element.node.table.column.NormalColumn;
import org.insightech.er.editor.model.diagram_contents.element.node.view.View;
import org.insightech.er.editor.model.diagram_contents.not_element.dictionary.Word;
import org.insightech.er.editor.model.diagram_contents.not_element.group.ColumnGroup;
import org.insightech.er.editor.model.settings.Settings;
import org.insightech.er.editor.view.dialog.word.word.WordDialog;

public class WordOutlineEditPart extends AbstractOutlineEditPart {

    /**
     * {@inheritDoc}
     */
    @Override
    protected List getModelChildren() {
        final List<ColumnHolder> wordHolderList = new ArrayList<ColumnHolder>();

        final List<ERTable> wordHolderList1 = new ArrayList<ERTable>();
        final List<View> wordHolderList2 = new ArrayList<View>();
        final List<ColumnGroup> wordHolderList3 = new ArrayList<ColumnGroup>();

        final ERDiagram diagram = (ERDiagram) getRoot().getContents().getModel();
        final Word word = (Word) getModel();

        final List<NormalColumn> normalColumns = diagram.getDiagramContents().getDictionary().getColumnList(word);

        final Category category = getCurrentCategory();

        for (final NormalColumn normalColumn : normalColumns) {
            final ColumnHolder columnHolder = normalColumn.getColumnHolder();

            if (columnHolder instanceof ERTable) {
                final ERTable table = (ERTable) columnHolder;
                if (wordHolderList1.contains(table)) {
                    continue;
                }

                if (category != null && !category.contains(table)) {
                    continue;
                }

                wordHolderList1.add(table);

            } else if (columnHolder instanceof View) {
                final View view = (View) columnHolder;
                if (wordHolderList2.contains(view)) {
                    continue;
                }

                if (category != null && !category.contains(view)) {
                    continue;
                }

                wordHolderList2.add(view);

            } else if (columnHolder instanceof ColumnGroup) {
                if (wordHolderList3.contains(columnHolder)) {
                    continue;
                }
                wordHolderList3.add((ColumnGroup) columnHolder);
            }
        }

        Collections.sort(wordHolderList1);
        Collections.sort(wordHolderList2);
        Collections.sort(wordHolderList3);

        wordHolderList.addAll(wordHolderList1);
        wordHolderList.addAll(wordHolderList2);
        wordHolderList.addAll(wordHolderList3);

        return wordHolderList;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected void refreshOutlineVisuals() {
        final Word word = (Word) getModel();

        final ERDiagram diagram = (ERDiagram) getRoot().getContents().getModel();

        final int viewMode = diagram.getDiagramContents().getSettings().getOutlineViewMode();

        String name = null;

        if (viewMode == Settings.VIEW_MODE_PHYSICAL) {
            if (word.getPhysicalName() != null) {
                name = word.getPhysicalName();

            } else {
                name = "";
            }
        } else if (viewMode == Settings.VIEW_MODE_LOGICAL) {
            if (word.getLogicalName() != null) {
                name = word.getLogicalName();

            } else {
                name = "";
            }

        } else {
            if (word.getLogicalName() != null) {
                name = word.getLogicalName();

            } else {
                name = "";
            }

            name += "/";

            if (word.getPhysicalName() != null) {
                name += word.getPhysicalName();

            }
        }

        setWidgetText(diagram.filter(name));

        setWidgetImage(ERDiagramActivator.getImage(ImageKey.WORD));
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void performRequest(final Request request) {
        final Word word = (Word) getModel();
        final ERDiagram diagram = getDiagram();

        if (request.getType().equals(RequestConstants.REQ_OPEN)) {
            final WordDialog dialog = new WordDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), word, false, diagram);

            if (dialog.open() == IDialogConstants.OK_ID) {
                final EditWordCommand command = new EditWordCommand(word, dialog.getWord(), diagram);
                execute(command);
            }
        }

        super.performRequest(request);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public DragTracker getDragTracker(final Request req) {
        return new SelectEditPartTracker(this);
    }
}


text:
namespace FatturaElettronica.Tabelle
{
    public class CondizioniPagamento : Tabella
    {
        public override Tabella[] List
        {
            get
            {
                return new Tabella[] {
                    new CondizioniPagamento { Codice = "TP01", Nome = "pagamento a rate" },
                    new CondizioniPagamento { Codice = "TP02", Nome = "pagamento completo" },
                    new CondizioniPagamento { Codice = "TP03", Nome = "anticipo" },
                };
            }
        }
    }
}


text:
[CmdletBinding()]
param()

# Arrange.
. $PSScriptRoot\..\..\..\..\Tests\lib\Initialize-Test.ps1
Microsoft.PowerShell.Core\Import-Module $PSScriptRoot\..
Register-Mock Invoke-VstsTool {
        Write-Error "Some simulated STDERR content" -ErrorAction Continue 2>&1
        "["
        "  {"
        "    `"installationPath`": `"some path`""
        "  }"
        "]"
    } -- -FileName (Resolve-Path $PSScriptRoot\..\vswhere.exe).Path -Arguments "-version [15.0,16.0) -latest -format json" -RequireExitCodeZero

# Act.
$actual = Get-VisualStudio_15_0

# Assert.
Assert-AreEqual -Expected "some path" -Actual $actual.installationPath


text:
$mdBottomSheet opens a bottom sheet over the app and provides a simple promise API.

Restrictions

The bottom sheet's template must have an outer <md-bottom-sheet> element.

Add the md-grid class to the bottom sheet for a grid layout.

Add the md-list class to the bottom sheet for a list layout.

Usage

    <hljs lang="html">

  <md-button ng-click="openBottomSheet()">
    Open a Bottom Sheet!
  </md-button>

</hljs>
<hljs lang="js">
var app = angular.module('app', ['ngMaterial']);
app.controller('MyController', function($scope, $mdBottomSheet) {
  $scope.openBottomSheet = function() {
    $mdBottomSheet.show({
      template: '<md-bottom-sheet>Hello!</md-bottom-sheet>'
    });
  };
});
</hljs>

Methods

$mdBottomSheet.show(options);

Show a bottom sheet with the specified options.

<md-list>
  <md-item>
    <md-item-content class="dashed-bottom">

        Parameter

        Type

        Description

    </md-item-content>
  </md-item>

  <md-item class="api-params-item">
    <md-item-content>

        options

object

object

An options object, with the following properties:

templateUrl - {string=}: The url of an html template file that will
be used as the content of the bottom sheet. Restrictions: the template must
have an outer md-bottom-sheet element.

template - {string=}: Same as templateUrl, except this is an actual
template string.

scope - {object=}: the scope to link the template / controller to. If none is specified, it will create a new child scope.
This scope will be destroyed when the bottom sheet is removed unless preserveScope is set to true.

preserveScope - {boolean=}: whether to preserve the scope when the element is removed. Default is false

controller - {string=}: The controller to associate with this bottom sheet.

locals - {string=}: An object containing key/value pairs. The keys will
be used as names of values to inject into the controller. For example,
locals: {three: 3} would inject three into the controller with the value
of 3.

targetEvent - {DOMClickEvent=}: A click's event object. When passed in as an option,
the location of the click will be used as the starting point for the opening animation
of the the dialog.

resolve - {object=}: Similar to locals, except it takes promises as values
and the bottom sheet will not open until the promises resolve.

controllerAs - {string=}: An alias to assign the controller to on the scope.

parent - {element=}: The element to append the bottom sheet to. The parent may be a function, string,
object, or null. Defaults to appending to the body of the root element (or the root element) of the application.
e.g. angular.element(document.getElementById('content')) or "#content"

disableParentScroll - {boolean=}: Whether to disable scrolling while the bottom sheet is open.
Default true.

    </md-item-content>
  </md-item>

</md-list>

    <md-list>
  <md-item>
    <md-item-content class="dashed-top">

        Returns

        Description

    </md-item-content>
  </md-item>
  <md-item>
    <md-item-content>

promise

A promise that can be resolved with $mdBottomSheet.hide() or
rejected with $mdBottomSheet.cancel().

    </md-item-content>
  </md-item>
</md-list>

$mdBottomSheet.hide([response]);

Hide the existing bottom sheet and resolve the promise returned from
$mdBottomSheet.show(). This call will close the most recently opened/current bottomsheet (if any).

<md-list>
  <md-item>
    <md-item-content class="dashed-bottom">

        Parameter

        Type

        Description

    </md-item-content>
  </md-item>

  <md-item class="api-params-item">
    <md-item-content>

        response

*

(optional)

*

An argument for the resolved promise.

    </md-item-content>
  </md-item>

</md-list>

$mdBottomSheet.cancel([response]);

Hide the existing bottom sheet and reject the promise returned from
$mdBottomSheet.show().

<md-list>
  <md-item>
    <md-item-content class="dashed-bottom">

        Parameter

        Type

        Description

    </md-item-content>
  </md-item>

  <md-item class="api-params-item">
    <md-item-content>

        response

*

(optional)

*

An argument for the rejected promise.

    </md-item-content>
  </md-item>

</md-list>


text:
from elasticsearch_dsl.filter import Not, Type, Term
from rest_framework import viewsets
from rest_framework.pagination import PageNumberPagination
from rest_framework.permissions import AllowAny

from django.template import RequestContext
from django.utils.timezone import now

from bulbs.content.filters import Published
from bulbs.content.models import Content
from bulbs.content.views import ContentListView
from bulbs.special_coverage.models import SpecialCoverage
from bulbs.super_features.utils import get_superfeature_model

from .serializers import GlanceContentSerializer

class RSSView(ContentListView):
    """Really simply, this syndicates Content."""
    template_name = "feeds/rss.xml"
    paginate_by = 20
    feed_title = "RSS Feed"
    utm_params = "utm_medium=RSS&utm_campaign=feeds"

    def get_template_names(self):
        return ["feeds/rss.xml", "feeds/_rss.xml"]

    def get(self, request, *args, **kwargs):
        response = super(RSSView, self).get(request, *args, **kwargs)
        response["Content-Type"] = "application/rss+xml"
        return response

    def get_queryset(self):
        return super(RSSView, self).get_queryset().filter(
            # Exclude all SuperFeatures (until we ever decide to support them)
            Not(filter=Type(value=get_superfeature_model().search_objects.mapping.doc_type))
        ).filter(
            Term(**{'hide_from_rss': False})
        )

    def get_context_data(self, *args, **kwargs):
        context = super(RSSView, self).get_context_data(*args, **kwargs)
        context["full"] = (self.request.GET.get("full", "false").lower() == "true")
        context["images"] = (self.request.GET.get("images", "false").lower() == "true")
        context["build_date"] = now()
        context["title"] = self.feed_title
        context["feed_url"] = self.request.build_absolute_uri()
        context["search_url"] = self.request.build_absolute_uri(
            u"/search?%s" % self.request.META["QUERY_STRING"])

        # OK, so this is kinda brutal. Stay with me here.
        for content in context["page_obj"].object_list:
            feed_path = content.get_absolute_url() + "?" + self.utm_params
            content.feed_url = self.request.build_absolute_uri(feed_path)

        return RequestContext(self.request, context)

class SpecialCoverageRSSView(RSSView):
    """Really simply, this syndicates Content."""
    feed_title = "Special Coverage RSS Feed"

    def get_queryset(self):
        sc_id = self.request.GET.get("special_coverage_id")
        sc_slug = self.request.GET.get("special_coverage_slug")

        if sc_id:
            sc = SpecialCoverage.objects.get(id=sc_id)
        elif sc_slug:
            sc = SpecialCoverage.objects.get(slug=sc_slug)
        else:
            return self.model.objects.none()

        return sc.get_content()[:self.paginate_by]

class GlanceFeedViewSet(viewsets.ReadOnlyModelViewSet):

    model = Content
    serializer_class = GlanceContentSerializer

    queryset = Content.search_objects.search().sort('-last_modified').filter(Published())

    permission_classes = (AllowAny,)

    class GlancePageNumberPagination(PageNumberPagination):
        page_size = 100  # mparent(2016-05-04): Per Michael Patek @ Fusion
        page_size_query_param = 'page_size'
        max_page_size = 500

    pagination_class = GlancePageNumberPagination


text:
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.engine.core.subsystem.openvr;

import jopenvr.VRControllerState_t;
import org.joml.Matrix4f;
import org.terasology.engine.rendering.openvrprovider.ControllerListener;
import org.terasology.engine.rendering.openvrprovider.OpenVRUtil;
import org.terasology.input.ButtonState;
import org.terasology.input.ControllerDevice;
import org.terasology.input.ControllerId;
import org.terasology.input.InputType;
import org.terasology.input.device.ControllerAction;

import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.List;
import java.util.Queue;

/**
 * This class acts as an interface between OpenVR controllers and Terasology controllers. By implementing
 * ControllerListener.buttonStateChanged(), OpenVR controller events make it into this class and are stored. Then,
 * by implementing getInputQueue(), an overridden method from ControllerDevice, the Terasology controller system
 * frequently retrieves and handles these events.
 */
class OpenVRControllers implements ControllerDevice, ControllerListener {

    private Queue<ControllerAction> queuedActions = new ArrayDeque<>();
    private VRControllerState_t cachedStateBefore;
    private VRControllerState_t cachedStateAfter;

    /**
     * Get the controller names provided by this ControllerDevice.
     * @return the list of controllers names.
     */
    @Override
    public List<String> getControllers() {
        List<String> ids = new ArrayList<>();
        ids.add("OpenVR");
        return ids;
    }

    /**
     * Get all queued actions registered since this method was last called.
     * @return a queue of actions.
     */
    @Override
    public Queue<ControllerAction> getInputQueue() {
        Queue<ControllerAction> result = new ArrayDeque<>(queuedActions);
        queuedActions.clear();
        return result;
    }

    private boolean buttonUp(long buttonIndex) {
        return OpenVRUtil.switchedUp(buttonIndex, cachedStateBefore.ulButtonPressed, cachedStateAfter.ulButtonPressed);
    }

    private boolean buttonDown(long buttonIndex) {
        return OpenVRUtil.switchedDown(buttonIndex, cachedStateBefore.ulButtonPressed, cachedStateAfter.ulButtonPressed);
    }

    private void addAxisAction(int controllerButton, ButtonState buttonState, float axisValue) {
        queuedActions.add(new ControllerAction(InputType.CONTROLLER_AXIS.getInput(controllerButton),
                    "OpenVR", buttonState, axisValue));
    }

    private void addButtonAction(int controllerButton, ButtonState buttonState) {
        queuedActions.add(new ControllerAction(InputType.CONTROLLER_BUTTON.getInput(controllerButton),
                "OpenVR", buttonState, 1.0f));
    }

    private void handleController0() {
        if (buttonUp(ControllerListener.TRIGGER_BUTTON)) {
            addButtonAction(ControllerId.ZERO, ButtonState.UP);
        } else if (buttonDown(ControllerListener.TRIGGER_BUTTON)) {
            addButtonAction(ControllerId.ZERO, ButtonState.DOWN);
        } else if (buttonUp(ControllerListener.GRIP_BUTTON)) {
            addButtonAction(ControllerId.ONE, ButtonState.UP);
        } else if (buttonDown(ControllerListener.GRIP_BUTTON)) {
            addButtonAction(ControllerId.ONE, ButtonState.DOWN);
        } else if (buttonUp(ControllerListener.APP_MENU_BUTTON)) {
            addButtonAction(ControllerId.TWO, ButtonState.UP);
        } else if (buttonDown(ControllerListener.APP_MENU_BUTTON)) {
            addButtonAction(ControllerId.TWO, ButtonState.DOWN);
        } else if (buttonDown(ControllerListener.TOUCHPAD_BUTTON)) {
            addAxisAction(ControllerId.X_AXIS, ButtonState.DOWN, -cachedStateAfter.rAxis[0].x);
            addAxisAction(ControllerId.Y_AXIS, ButtonState.DOWN, cachedStateAfter.rAxis[0].y);
        } else if (buttonUp(ControllerListener.TOUCHPAD_BUTTON)) {
            addAxisAction(ControllerId.X_AXIS, ButtonState.UP, 0.0f);
            addAxisAction(ControllerId.Y_AXIS, ButtonState.UP, 0.0f);
        }
    }

    private void handleController1() {
        if (buttonUp(ControllerListener.TRIGGER_BUTTON)) {
            addButtonAction(ControllerId.THREE, ButtonState.UP);
        } else if (buttonDown(ControllerListener.TRIGGER_BUTTON)) {
            addButtonAction(ControllerId.THREE, ButtonState.DOWN);
        } else if (buttonUp(ControllerListener.GRIP_BUTTON)) {
            addButtonAction(ControllerId.FOUR, ButtonState.UP);
        } else if (buttonDown(ControllerListener.GRIP_BUTTON)) {
            addButtonAction(ControllerId.FOUR, ButtonState.DOWN);
        } else if (buttonUp(ControllerListener.APP_MENU_BUTTON)) {
            addButtonAction(ControllerId.FIVE, ButtonState.UP);
        } else if (buttonDown(ControllerListener.APP_MENU_BUTTON)) {
            addButtonAction(ControllerId.FIVE, ButtonState.DOWN);
        } else if (buttonDown(ControllerListener.TOUCHPAD_BUTTON)) {
            if (cachedStateAfter.rAxis[0].x < 0 && cachedStateAfter.rAxis[0].y < 0) {
                addButtonAction(ControllerId.SIX, ButtonState.DOWN);
            } else if (cachedStateAfter.rAxis[0].x > 0 && cachedStateAfter.rAxis[0].y < 0) {
                addButtonAction(ControllerId.SEVEN, ButtonState.DOWN);
            } else if (cachedStateAfter.rAxis[0].x < 0 && cachedStateAfter.rAxis[0].y < 0) {
                addButtonAction(ControllerId.EIGHT, ButtonState.DOWN);
            } else if (cachedStateAfter.rAxis[0].x > 0 && cachedStateAfter.rAxis[0].y > 0) {
                addButtonAction(ControllerId.NINE, ButtonState.DOWN);
            }
        } else if (buttonUp(ControllerListener.TOUCHPAD_BUTTON)) {
            if (cachedStateAfter.rAxis[0].x < 0 && cachedStateAfter.rAxis[0].y < 0) {
                addButtonAction(ControllerId.SIX, ButtonState.UP);
            } else if (cachedStateAfter.rAxis[0].x > 0 && cachedStateAfter.rAxis[0].y < 0) {
                addButtonAction(ControllerId.SEVEN, ButtonState.UP);
            } else if (cachedStateAfter.rAxis[0].x < 0 && cachedStateAfter.rAxis[0].y < 0) {
                addButtonAction(ControllerId.EIGHT, ButtonState.UP);
            } else if (cachedStateAfter.rAxis[0].x > 0 && cachedStateAfter.rAxis[0].y > 0) {
                addButtonAction(ControllerId.NINE, ButtonState.UP);
            }
        }
    }

    /**
     * Called whenever the OpenVR controller button state changes for a given controller (left or right).
     * @param stateBefore - the state before the last change.
     * @param stateAfter - the state after the last change.
     * @param handIndex - the hand index, an integer - 0 for left, 1 for right.
     */
    @Override
    public void buttonStateChanged(VRControllerState_t stateBefore, VRControllerState_t stateAfter, int handIndex) {
        cachedStateBefore = stateBefore;
        cachedStateAfter = stateAfter;
        if (handIndex == 0) {
            handleController0();
        } else {
            handleController1();
        }
    }

    /**
     * Called whenever the OpenVR controller pose changes for a given controller (left or right). This particular
     * listener just ignores pose updates.
     * @param pose - the pose of the controller (a 4x4 matrix).
     * @param handIndex - the hand index, an integer - 0 for left, 1 for right.
     */
    @Override
    public void poseChanged(Matrix4f pose, int handIndex) {
        // currently no actions are sensitive to controller movement
    }

}


text:
require "vodem_sms/version"
require "vodem_sms/headers"
require "vodem_sms/status_checker"
require "vodem_sms/commands"
require "vodem_sms/messages"
require "vodem_sms/errors"
require "typhoeus"
require "forwardable"
require "json"

module VodemSms
  class Vodem
    extend Forwardable
    def_delegators :status, :connected?, :disconnected?, :connecting?
    def_delegators :commands, :disconnect!

    def connect!
      commands.connect! and return false if disconnected?
      status
    end

    def latest_message
      VodemSms::Messages.new.get_message
    end

    private

    def status
      StatusChecker.new.get_status
    end

    def commands
      Commands.new
    end

    def messanger
      Messages.new
    end
  end
end


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">

<title>ConnectionInfo.EnableStreamSense Property</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="generator" content="Doc-O-Matic" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <link rel="STYLESHEET" href="default.css" type="text/css" />

Collapse All

Lightstreamer .Net Client 2.0

ConnectionInfo.EnableStreamSense Property

ConnectionInfo Class  ConnectionInfo Members  Lightstreamer.DotNet.Client Namespace  ConnectionInfo Properties

If true, enables the Stream-sense feature; in case a streaming session is being opened (i.e. isPolling is false) and no answer has been received on the newly opened connection after a few seconds (set through StreamingTimeoutMillis), the connection attempt is discarded and a new session opening attempt is performed in smart polling mode.

The default setting is true.

C++

public: __property bool EnableStreamSense;

C#

public bool EnableStreamSense;

Visual Basic

Public Property EnableStreamSense() As bool

Group

ConnectionInfo Properties

Links

ConnectionInfo Class, ConnectionInfo Members, Lightstreamer.DotNet.Client Namespace, ConnectionInfo Properties

Copyright (C) 2004-2011 Weswit s.r.l.

Contents | Index | Home


text:
import pickle
import sys
import re
from zipfile import ZipFile, ZIP_BZIP2, ZIP_DEFLATED, ZIP_LZMA

import cv2
import numpy as np

from visnav.algo.base import AlgorithmBase
from visnav.batch1 import get_system_model
from visnav.iotools import objloader
from visnav.render.render import RenderEngine
from visnav.settings import *

if __name__ == '__main__':
    if len(sys.argv) < 3 or sys.argv[2] not in ('hi', 'med', 'lo'):
        print('USAGE: python %s <mission> <sm-quality: hi|med|lo>' % (sys.argv[0],))
        quit()

    mission = sys.argv[1]
    sm_quality = sys.argv[2]
    noise = {'hi':'', 'med':'lo', 'lo':'hi'}[sm_quality]

    sm = get_system_model(mission)
    with open(sm.asteroid.constant_noise_shape_model[noise], 'rb') as fh:
        noisy_model, sm_noise = pickle.load(fh)

    renderer = RenderEngine(sm.view_width, sm.view_height, antialias_samples=0)
    obj_idx = renderer.load_object(objloader.ShapeModel(data=noisy_model), smooth=sm.asteroid.render_smooth_faces)
    algo = AlgorithmBase(sm, renderer, obj_idx)
    cache_path = os.path.join(CACHE_DIR, mission)

    # i = 0
    for fn in os.listdir(cache_path):
        m = re.match('^(' + mission + r'_(\d+))\.lbl$', fn)
        if m and float(m[2]) < 2000:
            base_path = os.path.join(cache_path, m[1])
            sm.load_state(base_path + '.lbl')

            # save state in a more user friendly way
            sm.export_state(base_path + '_meta.csv')

            # render
            sm.z_off.value = -sm.min_med_distance
            image, depth = algo.render(center=True, depth=True, shadows=True)

            # write rendered image
            cv2.imwrite(base_path + '_'+sm_quality+'.png', image, [cv2.IMWRITE_PNG_COMPRESSION, 9])

            if False:
                # write depth as zipped csv file
                depth_fn = base_path + '_' + sm_quality + '.csv'
                np.savetxt(depth_fn, depth, '%f', delimiter='\t', encoding='utf8')
                with ZipFile(depth_fn[:-4] + '.zip', 'w', ZIP_LZMA) as myzip:
                    myzip.write(depth_fn, m[1] + '_' + sm_quality + '.csv')
                os.unlink(depth_fn)
            else:
                # write as zipped binary file
                #  - extract all .zip files first
                #  - .bin file can be read in e.g. matlab using:  fid = fopen(fname); D = fread(fid, [512 512], 'float');
                depth_fn = base_path + '_' + sm_quality + '.bin'
                with open(depth_fn, 'wb') as file:
                    file.write(depth.astype('f4').tobytes())
                with ZipFile(depth_fn[:-4] + '.zip', 'w', ZIP_LZMA) as myzip:
                    myzip.write(depth_fn, m[1] + '_' + sm_quality + '.bin')
                os.unlink(depth_fn)

            # if i>9:
            #     quit()
            # i += 1


text:
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.model import no_value_fields
from frappe.translate import get_lang_dict, set_default_language
from frappe.utils import cint
from frappe.utils.momentjs import get_all_timezones

class SystemSettings(Document):
	def validate(self):
		for key in ("session_expiry", "session_expiry_mobile"):
			if self.get(key):
				parts = self.get(key).split(":")
				if len(parts)!=2 or not (cint(parts[0]) or cint(parts[1])):
					frappe.throw(_("Session Expiry must be in format {0}").format("hh:mm"))

	def on_update(self):
		for df in self.meta.get("fields"):
			if df.fieldtype not in no_value_fields:
				frappe.db.set_default(df.fieldname, self.get(df.fieldname))

		if self.language:
			set_default_language(self.language)

@frappe.whitelist()
def load():
	if not "System Manager" in frappe.get_roles():
		frappe.throw(_("Not permitted"), frappe.PermissionError)

	all_defaults = frappe.db.get_defaults()
	defaults = {}

	for df in frappe.get_meta("System Settings").get("fields"):
		if df.fieldtype in ("Select", "Data"):
			defaults[df.fieldname] = all_defaults.get(df.fieldname)

	languages = get_lang_dict().keys()
	languages.sort()

	return {
		"timezones": get_all_timezones(),
		"languages": [""] + languages,
		"defaults": defaults
	}


text:
import { IconDefinition, IconLookup, IconName, IconPrefix, IconPack } from '@fortawesome/fontawesome-common-types';
export { IconDefinition, IconLookup, IconName, IconPrefix, IconPack } from '@fortawesome/fontawesome-common-types';
declare const pack: IconPack;
export default pack;
export const faAddressBook: IconDefinition;
export const faAddressCard: IconDefinition;
export const faArrowAltCircleDown: IconDefinition;
export const faArrowAltCircleLeft: IconDefinition;
export const faArrowAltCircleRight: IconDefinition;
export const faArrowAltCircleUp: IconDefinition;
export const faBell: IconDefinition;
export const faBellSlash: IconDefinition;
export const faBookmark: IconDefinition;
export const faBuilding: IconDefinition;
export const faCalendar: IconDefinition;
export const faCalendarAlt: IconDefinition;
export const faCalendarCheck: IconDefinition;
export const faCalendarMinus: IconDefinition;
export const faCalendarPlus: IconDefinition;
export const faCalendarTimes: IconDefinition;
export const faCaretSquareDown: IconDefinition;
export const faCaretSquareLeft: IconDefinition;
export const faCaretSquareRight: IconDefinition;
export const faCaretSquareUp: IconDefinition;
export const faChartBar: IconDefinition;
export const faCheckCircle: IconDefinition;
export const faCheckSquare: IconDefinition;
export const faCircle: IconDefinition;
export const faClipboard: IconDefinition;
export const faClock: IconDefinition;
export const faClone: IconDefinition;
export const faClosedCaptioning: IconDefinition;
export const faComment: IconDefinition;
export const faCommentAlt: IconDefinition;
export const faComments: IconDefinition;
export const faCompass: IconDefinition;
export const faCopy: IconDefinition;
export const faCopyright: IconDefinition;
export const faCreditCard: IconDefinition;
export const faDotCircle: IconDefinition;
export const faEdit: IconDefinition;
export const faEnvelope: IconDefinition;
export const faEnvelopeOpen: IconDefinition;
export const faEyeSlash: IconDefinition;
export const faFile: IconDefinition;
export const faFileAlt: IconDefinition;
export const faFileArchive: IconDefinition;
export const faFileAudio: IconDefinition;
export const faFileCode: IconDefinition;
export const faFileExcel: IconDefinition;
export const faFileImage: IconDefinition;
export const faFilePdf: IconDefinition;
export const faFilePowerpoint: IconDefinition;
export const faFileVideo: IconDefinition;
export const faFileWord: IconDefinition;
export const faFlag: IconDefinition;
export const faFolder: IconDefinition;
export const faFolderOpen: IconDefinition;
export const faFrown: IconDefinition;
export const faFutbol: IconDefinition;
export const faGem: IconDefinition;
export const faHandLizard: IconDefinition;
export const faHandPaper: IconDefinition;
export const faHandPeace: IconDefinition;
export const faHandPointDown: IconDefinition;
export const faHandPointLeft: IconDefinition;
export const faHandPointRight: IconDefinition;
export const faHandPointUp: IconDefinition;
export const faHandPointer: IconDefinition;
export const faHandRock: IconDefinition;
export const faHandScissors: IconDefinition;
export const faHandSpock: IconDefinition;
export const faHandshake: IconDefinition;
export const faHdd: IconDefinition;
export const faHeart: IconDefinition;
export const faHospital: IconDefinition;
export const faHourglass: IconDefinition;
export const faIdBadge: IconDefinition;
export const faIdCard: IconDefinition;
export const faImage: IconDefinition;
export const faImages: IconDefinition;
export const faKeyboard: IconDefinition;
export const faLemon: IconDefinition;
export const faLifeRing: IconDefinition;
export const faLightbulb: IconDefinition;
export const faListAlt: IconDefinition;
export const faMap: IconDefinition;
export const faMeh: IconDefinition;
export const faMinusSquare: IconDefinition;
export const faMoneyBillAlt: IconDefinition;
export const faMoon: IconDefinition;
export const faNewspaper: IconDefinition;
export const faObjectGroup: IconDefinition;
export const faObjectUngroup: IconDefinition;
export const faPaperPlane: IconDefinition;
export const faPauseCircle: IconDefinition;
export const faPlayCircle: IconDefinition;
export const faPlusSquare: IconDefinition;
export const faQuestionCircle: IconDefinition;
export const faRegistered: IconDefinition;
export const faSave: IconDefinition;
export const faShareSquare: IconDefinition;
export const faSmile: IconDefinition;
export const faSnowflake: IconDefinition;
export const faSquare: IconDefinition;
export const faStar: IconDefinition;
export const faStarHalf: IconDefinition;
export const faStickyNote: IconDefinition;
export const faStopCircle: IconDefinition;
export const faSun: IconDefinition;
export const faThumbsDown: IconDefinition;
export const faThumbsUp: IconDefinition;
export const faTimesCircle: IconDefinition;
export const faTrashAlt: IconDefinition;
export const faUser: IconDefinition;
export const faUserCircle: IconDefinition;
export const faWindowClose: IconDefinition;
export const faWindowMaximize: IconDefinition;
export const faWindowMinimize: IconDefinition;
export const faWindowRestore: IconDefinition;


text:
{-# LANGUAGE RankNTypes, ScopedTypeVariables #-}

-- !!! Caused ghc-4.04proto to report a bogus type error
-- !!! (as reported by Keith)

-- The type error arose from a mistake in tcMatches.tc_match

-- Involves pattern type signatures

module ShouldCompile where

p :: forall a. a -> a
p = let y = p in \ (x::a) -> x


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Isariopsis grayana Ellis

### Remarks
null


text:
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <groupId>org.jlr</groupId>
  <artifactId>percolation</artifactId>
  <versioning>
    <release>1.0</release>
    <versions>
      <version>1.0</version>
    </versions>
    <lastUpdated>20140924232840</lastUpdated>
  </versioning>
</metadata>


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

<title>C-Index</title>
<meta name="date" content="2012-09-01">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G H I K L M O P Q R S T U V W

C

calculateDistances(ArrayList<GeoAddress>) - Method in class CloudMadeDistanceCalculator

calculateDistances(ArrayList<GeoAddress>) - Method in interface DistanceCalculator

Berechnung von Distanzen von jeder geokodierten Adresse zu jeder anderen.

calculateDistances(ArrayList<GeoAddress>) - Method in class EuklidDistanceCalculator

calculateDistances(ArrayList<GeoAddress>) - Method in class Osm2poDistanceCalculator

calculateDistances() - Method in class PlannerModel

Aufrufen der Distanzbestimmung.

calculateTime(ArrayList<GeoAddress>) - Static method in class DistancePlanner

changeMainCoursesForRecursion - Variable in class TeamRoutConstructor

Gibt an, wie oft die Anordnung der Hauptspeiseteams geändert werden soll (jeweils zufällige Permutation).

chckbxLocationsOnly - Variable in class PlannerView

CheckBox Abfrage, ob ausschließlich Orte angezeigt werden sollen.

CloudMadeDistanceCalculator - Class in <Unnamed>

Berechnet die Distanz von jedem geokodierten Ort zu jedem anderen mit Hilfe des CloudMade Dienstes.

CloudMadeDistanceCalculator(CMClient.RouteType, String) - Constructor for class CloudMadeDistanceCalculator

Berechnet die Distanz von jedem geokodierten Ort zu jedem anderen mit Hilfe des CloudMade-Dienstes.

CloudMadeGeocoder - Class in <Unnamed>

Geokodierer, nimmt die eingelesenen Adressen entgegen und nutzt die CloudMade Geocoding API,
 um die jeweiligen Geokoordinaten zu bestimmen.

CloudMadeGeocoder(ArrayList<GeoAddress>, String) - Constructor for class CloudMadeGeocoder

Entgegen nehmen der GeoAddresses und des API-Keys, durchführen der Geokodierung.

computeNearestNeighborMain(boolean[][], boolean) - Method in class TeamRoutConstructor

Bestimmen der Routen für die Hauptspeiseteams.

confirmAPIKey(String) - Method in class PropertiesController

Überprüfen der Korrektheit des API-Keys, indem versucht wird ein Adresse zu geokodieren.

Console - Class in <Unnamed>

Console() - Constructor for class Console

constructRoutes() - Method in class PlannerModel

Ausführen des Routenberechnung.

constructRoutes() - Method in class TeamRoutConstructor

Aufruf der einzelnen Teile (Methoden) des Routenplanungsalgorihtmus,
 Setzen wie oft Hauptspeiseteam-Anordnung geändert wird.

controller - Variable in class PlannerView

Der zu diesem View gehoerige Controller ist ebenfalls im View enthalten.

controller - Variable in class PropertiesView

Der zu diesem View gehoerige Controller ist ebenfalls im View enthalten.

copy2DIntArray(int[][]) - Static method in class PlannerModel

Kopiere zweidimensionales Integer Array (Distanzen).

copyGeoAddressList(ArrayList<GeoAddress>) - Static method in class PlannerModel

Kopieren der GeoAddress ArrayList

copyIntegerTeamList(List<Integer>, List<Integer>) - Method in class TeamRoutConstructor

erzeugt eine neue Liste copList, die diegleichen Werte wie die origList enhält.

copyTeamList(ArrayList<Team>) - Static method in class PlannerModel

Kopieren der Team ArrayList

copyTeamList(ArrayList<Team>, ArrayList<Team>) - Method in class TeamRoutConstructor

erzeugt eine neue Liste copList, die diegleichen Werte wie die origList enhält.

Course - Enum in <Unnamed>

Aufzählung der möglichen Gänge der Teams
 STARTER: Vorspeiseteam
 MAIN_COURSE: Hauptspeiseteam
 DESSERT: Nachspeiseteam

Course() - Constructor for enum Course

course - Variable in class Team

Gibt des Gang an, den dieses Team anrichtet.

cp - Variable in class MapViewer

Zusammenfügen mehrerer Painter in einem CompoundPainter.

createUrlAddressStringByGeoCodes(ArrayList<GeoAddress>) - Static method in class PlannerModel

Erstellen einer Google geocoding URL aus den Geokodierten Adressen.

CSV_HEADER - Static variable in class CSVHandler

Header der CSV-Input-Datei.

CSV_HEADER_GEOCODES - Static variable in class CSVHandler

Header der CSV-Input-Datei mit Geokoordinaten.

CSV_HEADER_OUTPUT - Static variable in class CSVHandler

Header der CSV-Output-Datei.

CSVHandler - Class in <Unnamed>

Klasse zum Schreiben und Lesen von CSV-Dateien mit Teamdaten.

CSVHandler() - Constructor for class CSVHandler

A B C D E F G H I K L M O P Q R S T U V W

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
var marinelliApp = angular.module('marinelliApp', ['ngAnimate']);

marinelliApp.controller('projectCtrl', function($rootScope, $scope, $http, projectService) {
	// For "flashing" messages we create the instance of the variable
	$rootScope.flashMessages = [];

	// Set Variables
	$scope.projects = {};
	$scope.project = {};

	// Start by getting all projects
	projectService.getProjects(function(data) {
		$scope.projects = data;
		$scope.setMainProject(0);
	}, function(data) {
		$rootScope.flashMessages.push({type: 'danger', title: 'Error', message: data});
	});

	// Set up project main
	$scope.setMainProject = function(index) {
		$scope.project = $scope.projects[index];
	};

	// Set forms data to blank
	$scope.addProjectForm = {};
	$scope.addNoteForm = {};
	// when submitting the add form, send the text to the node API
	$scope.createProject = function() {
		projectService.createProject($scope.addProjectForm, function(data) {
			$scope.addProjectForm = {};
			$scope.projects = data;
			$scope.setMainProject($scope.projects.length - 1);
			$rootScope.flashMessages.push({type: 'success', title: 'Success', message: 'Project created!'});
			$scope.addProjectModal = !$scope.addProjectModal;
		}, function(data) {
			$rootScope.flashMessages.push({type: 'warning', title: 'Error', message: data});
		});
	};

	// Save project Changes
	$scope.saveProjectEdits = function() {
		this.editing = false;
		projectService.updateProject($scope.project._id, $scope.project, function() {
			$scope.projects = data;
			$rootScope.flashMessages.push({type: 'success', title: 'Success', message: 'User has been updated!'});
		}, function() {
			$rootScope.flashMessages.push({type: 'warning', title: 'Error', message: data});
		});
	};

	// Delete a project
	$scope.deleteProject = function(id) {
		projectService.deleteProject(id, function(data) {
			$scope.projects = data;
			if ($scope.project._id == id) {
				$scope.setMainProject(0);
			}
			$rootScope.flashMessages.push({type: 'success', title: 'Success', message: 'Project has been deleted!'});
		}, function(data) {
			$rootScope.flashMessages.push({type: 'warning', title: 'Error', message: data});
		});
	};

	// Convert ISO Date string to working format
	$scope.formatToLocalDateTime = function(dateString, option = 0) {
		let date = new Date(dateString);
		let options = { year: 'numeric', month: 'long', day: 'numeric' };
		switch(option) {
			// Returns the date in a short format
			case 1:
				date = date.toLocaleDateString().replace(/\//g,'-');
				break;
			// Returns the date in a long format
			case 2:
				date = date.toLocaleDateString('en-US', options);
				break;
			// Use this case to return the local time of the date/time stamp
			case 3:
				date = date.toLocaleTimeString();
				break;
			default:
				date = date.toLocaleDateString();
		}

		return date
	};

	// Check whether we have a start time and update project times accordingly
	$scope.startStopTime = function(id) {
		let timesLength = $scope.project.times.length;
		let lastIndex = timesLength - 1;
		let timeData = $scope.project.times;
		if (timesLength == 0 || timeData[lastIndex].stop) {
			timeData.push({ start: Date.now() });
		} else {
			timeData[lastIndex].stop = Date.now();
			timeData[lastIndex].diff = $scope.getTotalTimeSpent(timeData[lastIndex].start, timeData[lastIndex].stop);
		};

		projectService.setTimes(id, { times: timeData }, function(data) {
			$scope.projects = data;
		}, function(data) {
			$rootScope.flashMessages.push({type: 'warning', title: 'Error', message: data});
		});
	};

	// total time spent
	$scope.getTotalTimeSpent = function(start, stop) {
		let dateOne = new Date(start);
		let dateTwo = new Date(stop);
		let diff = dateTwo - dateOne;
		return diff
	};

	// Return total hours
	$scope.getTotalHoursSpent = function(time) {
		time = time/1000/60/60;
		time = time.toFixed(2);
		return time
	};

	// checkForClass()
	$scope.checkForClass = function() {
		if ($scope.project.times.length == 0 || $scope.project.times[$scope.project.times.length - 1].stop) {
			return true;
		} else {
			return false;
		};
	};
	// Change name with start and stop
	$scope.startingOrStoppingName = function() {
		if ($scope.project.times.length == 0 || $scope.project.times[$scope.project.times.length - 1].stop) {
			return 'Start';
		} else {
			return 'Stop';
		};
	};

	// returnTotalTime
	$scope.returnTotalTime = function(timesData) {
		let totalTime = 0;
		for (var i = 0; timesData.length > i; i++) {
			if (timesData[i].diff) {
				totalTime += timesData[i].diff;
			};
		};

		if (totalTime > 0) {
			return $scope.getTotalHoursSpent(totalTime);
		}
		return totalTime;
	};
});

marinelliApp.service('projectService', function($http) {
	// Get all projects
	this.getProjects = function(successCallback, errorCallback) {
		$http.get('/api/projects')
		.success(successCallback)
		.error(errorCallback);
	};

	// Create a project
	this.createProject = function(projectData, successCallback, errorCallback) {
		$http.post('/api/projects', projectData)
		.success(successCallback)
		.error(errorCallback);
	};

	// Start timer
	this.setTimes = function(projectId, timeData, successCallback, errorCallback) {
		$http.put('/api/projects/' + projectId + '/settimes', timeData)
		.success(successCallback)
		.error(errorCallback);
	};

	// Update user
	this.updateProject = function(projectId, project, successCallback, errorCallback) {
		$http.put('/api/projects/' + projectId, project)
		.success(successCallback)
		.error(errorCallback);
	};

	// Delete a project
	this.deleteProject = function(projectId, successCallback, errorCallback) {
		$http.delete('/api/projects/' + projectId)
		.success(successCallback)
		.error(errorCallback);
	}
});

marinelliApp.directive('flashMsgs', function() {
	return {
		template: '
' +
		'
{{ flashMessage.title }}: {{ flashMessage.message }}' +
		'

',
		restrict: 'E',
		link: function($rootScope, scope, element, attributes) {
			$rootScope.$watch('flashMessages', function(val) {
				if (val.length) {
					flashAMessage();
				}
			}, true);

			const flashAMessage = function() {
				$('.alert').addClass('show').delay(3000).queue(function(next) {
					$(this).removeClass('show').remove();
					$rootScope.flashMessages.splice(0);
					next();
				})
			}
		}
	};
});

marinelliApp.directive('markdown', function() {
	return {
		restrict: 'E',
		link: function(scope, element, attrs) {
			scope.$watch(attrs.ngModel, function(value, oldValue) {
				var markdown = value;
				var html = md.toHtml(markdown);
				element.html(html);
				setCodeHeader();
			});
		}
	};
});


text:
""" This file contains functions to generate and verify tokens for Flask-User.
    Tokens contain an encoded user ID and a signature. The signature is managed by the itsdangerous module.

    :copyright: (c) 2013 by Ling Thio
    :author: Ling Thio (ling.thio@gmail.com)
    :license: Simplified BSD License, see LICENSE.txt for more details."""

import base64

from Crypto.Cipher import AES
from itsdangerous import BadSignature, SignatureExpired, TimestampSigner

class TokenManager(object):
    def __init__(self):
        """ Create a cypher to encrypt IDs and a signer to sign tokens."""
        # Create cypher to encrypt IDs
        # and ensure >=16 characters
        # secret = app.config.get('SECRET_KEY')
        secret = 'SECRET_KEY'
        precursor = b'0123456789abcdef'
        if isinstance(secret, bytes):
            key = secret + precursor
        else:
            key = secret.encode("utf-8") + precursor
        self.cipher = AES.new(key[0:16], AES.MODE_CBC)

        # Create signer to sign tokens
        self.signer = TimestampSigner(secret)

    def encrypt_id(self, id):
        """ Encrypts integer ID to url-safe base64 string."""
        # 16 byte integer
        str1 = '%016d' % id
        # encrypted data
        str2 = self.cipher.encrypt(str1.encode())
        # URL safe base64 string with '=='
        str3 = base64.urlsafe_b64encode(str2)
        # return base64 string without '=='
        return str3[0:-2]

    def decrypt_id(self, encrypted_id):
        """ Decrypts url-safe base64 string to integer ID"""
        # Convert strings and unicode strings to bytes if needed
        if hasattr(encrypted_id, 'encode'):
            encrypted_id = encrypted_id.encode('ascii', 'ignore')

        try:
            str3 = encrypted_id + b'=='  # --> base64 string with '=='
            # print('str3=', str3)
            str2 = base64.urlsafe_b64decode(str3)  # --> encrypted data
            # print('str2=', str2)
            str1 = self.cipher.decrypt(str2)  # --> 16 byte integer string
            # print('str1=', str1)
            return int(str1)  # --> integer id
        except Exception as e:  # pragma: no cover
            print('!!!Exception in decrypt_id!!!:', e)
            return 0

    def generate_token(self, id):
        """ Return token with id, timestamp and signature"""
        # In Python3 we must make sure that bytes are converted to strings.
        # Hence the addition of '.decode()'
        return self.signer.sign(self.encrypt_id(id)).decode()

    def verify_token(self, token, expiration_in_seconds):
        """ Verify token and return (is_valid, has_expired, id).
            Returns (True, False, id) on success.
            Returns (False, True, None) on expired tokens.
            Returns (False, False, None) on invalid tokens."""
        try:
            data = self.signer.unsign(token, max_age=expiration_in_seconds)
            is_valid = True
            has_expired = False
            id = self.decrypt_id(data)
        except SignatureExpired:
            is_valid = False
            has_expired = True
            id = None
        except BadSignature:
            is_valid = False
            has_expired = False
            id = None
        return (is_valid, has_expired, id)


text:
#ifndef _BLUEDBM_DM_PARAMS_H
#define _BLUEDBM_DM_PARAMS_H

extern int _param_nr_channels;
extern int _param_nr_chips_per_channel;
extern int _param_nr_blocks_per_chip;
extern int _param_nr_pages_per_block;
extern int _param_page_main_size;
extern int _param_page_oob_size;
extern int _param_device_type;
extern int _param_host_bus_trans_time_us;
extern int _param_chip_bus_trans_time_us;
extern int _param_page_prog_time_us;
extern int _param_page_read_time_us;
extern int _param_block_erase_time_us;
extern int _param_ramdrv_timing_mode;

bdbm_device_params_t get_default_device_params (void);
void display_device_params (bdbm_device_params_t* p);

#endif


text:
package com.kovuthehusky.nbt.tags;

import java.nio.ByteBuffer;

/**
 * A signed floating point type that is 8 bytes in length.
 */
public final class NBTDouble extends NBT<Double> {
    public NBTDouble(String name, Double payload) {
        super(name, payload);
    }

    @Override
    public int getLength() {
        int length = 8;
        if (this.getName() != null)
            length += 3 + (short) this.getName().getBytes(NBT.CHARSET).length;
        return length;
    }

    @Override
    public byte getType() {
        return NBT.DOUBLE;
    }

    @Override
    protected void writePayload(ByteBuffer bytes) {
        bytes.putDouble(this.getPayload());
    }
}


text:
comment = '''
  Several to-do things here.

  We need to stir in country codes. That should be the top-level
  key for each entry in the obj. -- HA! We can access the ISO 3166
  code via the country links. Super. [GOOD-ENOUGH DONE]

  We should maybe fetch the official languages of each jurisdiction.
  That will provide a hint as to whether English-language court names
  are sufficient. [GOOD-ENOUGH DONE]

  We need to follow out and get the top-level courts for countries
  that have no local court listed. These are mostly stated in free
  text in the country pages.

  We need to grab the foreign-language version of the name from
  the court page, where possible. This is tagged, so should be
  pretty reliable, for a first shot. [GOOD-ENOUGH DONE]

  We need a script to inject this data into the repo.

  We need a simple JS-driven filtering interface for the top page
  so that the data remains manageable. Hide all jurisdictions
  by default, and reveal Google-like, with "all" noted as a
  complete reveal.

  We need to provide for renaming court files based on changes to the
  court-id attribute during processing, to simplify maintenance.

  We need to finish the submission instructions.

  We need to contact Wikipedia and see about spreading the
  word.

  We need to liaise with Shima-san about contributing to the
  data set.
'''

import os,sys,re
from urllib import URLopener
from lxml import etree
import json

obj = {}

urlh = URLopener()

html = urlh.open("http://en.wikipedia.org/wiki/List_of_supreme_courts_by_country").read()

doc = etree.fromstring(html)

entries = doc.xpath("//table[@class='wikitable']//tr")

stops = ["the","of","a"]

def makeID(court):
    courtID = court.lower()
    courtID = re.split("\s+",courtID)
    for i in range(len(courtID)-1,-1,-1):
        word = courtID[i]
        if word in stops:
            courtID = courtID[0:i] + courtID[i+1:]
    return ".".join(courtID)

for entryNode in entries:
    countryNodes = entryNode.xpath("td[1]//a")
    if len(countryNodes):
         country = countryNodes[0].text

         print "Processing: %s" % country

         #if country != "Guinea": continue

         countryLink = countryNodes[0].attrib["href"][1:]

         countryHtml = urlh.open(os.path.join("http://en.wikipedia.org",countryLink)).read()
         countryDoc = etree.fromstring(countryHtml)

         # XXX Pretty-much good. Will need some error handling for some jurisdictions to get
         # XXX a full set of codes.
         countryObj = {
             "official-languages": [],
             "country-name": country,
             "courts": {}
             }
         countryCodes = countryDoc.xpath("//table//th[a[@href='/wiki/ISO_3166']]/following-sibling::td/a/text()")
         if len(countryCodes):
             countryCodeData = countryCodes[0]
             #print "  " + countryCodes[0]
             obj[countryCodeData] = countryObj
         else:
             print "WARNING: %s has no country code" % country
             obj[country] = countryObj

         # XXX Pretty-much good. Will need some touch-up for some of the European jurisdictions.
         countryLangs = countryDoc.xpath("//table//th[contains(text(),'Official language') or a[contains(text(),'Official language')] or b[contains(text(),'Official language')] or contains(text(),'National language') or a[contains(text(),'National language')] or b[contains(text(),'National language')]]/following-sibling::td")
         if len(countryLangs):
             for langNode in countryLangs:
                 nodes = langNode.xpath("*//a[not(ancestor::sup)]")
                 if len(nodes):
                     for node in nodes:
                         countryObj["official-languages"].append(etree.tostring(node, method="text", with_tail=False, encoding="unicode"))
                 else:
                     nodes = langNode.xpath("text()")
                     for node in nodes:
                         countryObj["official-languages"].append(node)
         else:
             print "WARNING: %s has no country langs" % country

         courtNodes = entryNode.xpath("td[2]//a")
         if len(courtNodes) == 1 and courtNodes[0].text == "International supreme courts":
             courtNodes.pop()
         if len(courtNodes):
             for courtNode in courtNodes:
                 if not courtNode.text: continue
                 countryID = makeID(country)
                 courtID = makeID(courtNode.text)
                 if courtID.endswith(countryID):
                     courtID = courtID[0:-1 * len(countryID) - 1]
                 courtLink = "http://en.wikipedia.org%s" % (courtNode.attrib["href"])
                 courtObj = {
                     "en": courtNode.text
                     }
                 countryObj["courts"][courtID] = courtObj
                 if not courtLink.find("redlink") > -1:
                     courtObj["url"] = courtLink
                     courtHtml = urlh.open(courtLink).read()
                     courtDoc = etree.fromstring(courtHtml)
                     langs = courtDoc.xpath("//a[contains(@href,'language')]/following-sibling::span[@lang][1]")
                     if len(langs):
                         courtObj["local"] = etree.tostring(langs[0], method="text", with_tail=False, encoding="unicode")
                         #print "  %s (1): %s" % (country,etree.tostring(langs[0], method="text", with_tail=False, encoding="unicode"))
                         #break
                     else:
                         nodes = courtDoc.xpath("//h2[span[@id='Judicial_branch']]/following-sibling::p")
                         if len(nodes) == 0:
                             nodes = courtDoc.xpath("//div[@id='mw-content-text']//p[not(ancestor::table)]")
                         if len(nodes):
                             node = nodes[0]
                             realname = node.xpath("i|b|a")
                             if len(realname) and realname[0].text:
                                 courtObj["local"] = etree.tostring(realname[0], method="text", with_tail=False, encoding="unicode")
                                 #print "  %s (2) %s" % (country,etree.tostring(realname[0], method="text", with_tail=False, encoding="unicode"))
                             else:
                                 paratext = etree.tostring(node, method="text", with_tail=False, encoding="unicode")
                                 m = re.match("(?sm).*?\s+(?:\"([^\"]+)\"|or\s+([^,\.]+)).*",paratext)
                                 if m:
                                     if m.group(1):
                                         courtObj["local"] = m.group(1)
                                         #print "  %s (3) %s" % (country,m.group(1))
                                     else:
                                         courtObj["local"] = m.group(2)
                                         #print "  %s (4) %s" % (country,m.group(2))

         else:
             print "No court listed for: %s" % country

open("ALL-COURTS.json","w+").write(json.dumps(obj,indent=2))


text:
package com.xiaoxuan.demo.tv.adapter;

import android.content.Context;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;

public class FocusGridLayoutManager extends GridLayoutManager
{

    /**
     * Constructor used when layout manager is set in XML by RecyclerView attribute "layoutManager". If spanCount is not
     * specified in the XML, it defaults to a single column.
     *
     * @param context
     * @param attrs
     * @param defStyleAttr
     * @param defStyleRes
     * @attr ref android.support.v7.recyclerview.R.styleable#RecyclerView_spanCount
     */
    public FocusGridLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
    {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    /**
     * Creates a vertical GridLayoutManager
     *
     * @param context Current context, will be used to access resources.
     * @param spanCount The number of columns in the grid
     */
    public FocusGridLayoutManager(Context context, int spanCount)
    {
        super(context, spanCount);
    }

    /**
     * @param context Current context, will be used to access resources.
     * @param spanCount The number of columns or rows in the grid
     * @param orientation Layout orientation. Should be {@link #HORIZONTAL} or {@link #VERTICAL}.
     * @param reverseLayout When set to true, layouts from end to start.
     */
    public FocusGridLayoutManager(Context context, int spanCount, int orientation, boolean reverseLayout)
    {
        super(context, spanCount, orientation, reverseLayout);
    }

    /**
     * Return the current number of child views attached to the parent RecyclerView. This does not include child views
     * that were temporarily detached and/or scrapped.
     *
     * @return Number of attached children
     */
    @Override
    public int getChildCount()
    {
        return super.getChildCount();
    }

    /**
     * Return the child view at the given index
     *
     * @param index Index of child to return
     * @return Child view at index
     */
    @Override
    public View getChildAt(int index)
    {
        return super.getChildAt(index);
    }

    /**
     * Returns the number of items in the adapter bound to the parent RecyclerView.
     *
     * @return The number of items in the bound adapter
     */
    @Override
    public int getItemCount()
    {
        return super.getItemCount();
    }

    /**
     * Returns the item View which has or contains focus.
     *
     * @return A direct child of RecyclerView which has focus or contains the focused child.
     */
    @Override
    public View getFocusedChild()
    {
        return super.getFocusedChild();
    }

    /**
     * Returns the adapter position of the item represented by the given View. This does not contain any adapter changes
     * that might have happened after the last layout.
     *
     * @param view The view to query
     * @return The adapter position of the item which is rendered by this View.
     */
    @Override
    public int getPosition(View view)
    {
        return super.getPosition(view);
    }

    /**
     * 获取列数
     *
     * @return
     */
    @Override
    public int getSpanCount()
    {
        return super.getSpanCount();
    }

    /**
     * Called when searching for a focusable view in the given direction has failed for the current content of the
     * RecyclerView. This is the LayoutManager's opportunity to populate views in the given direction to fulfill the
     * request if it can. The LayoutManager should attach and return the view to be focused. The default implementation
     * returns null. 防止当recyclerview上下滚动的时候焦点乱跳
     *
     * @param focused
     * @param focusDirection
     * @param recycler
     * @param state
     * @return
     */
    @Override
    public View onFocusSearchFailed(View focused, int focusDirection, RecyclerView.Recycler recycler,
        RecyclerView.State state)
    {

        // Need to be called in order to layout new row/column
        View nextFocus = super.onFocusSearchFailed(focused, focusDirection, recycler, state);

        if (nextFocus == null)
        {
            return null;
        }
        /**
         * 获取当前焦点的位置
         */
        int fromPos = getPosition(focused);
        /**
         * 获取我们希望的下一个焦点的位置
         */
        int nextPos = getNextViewPos(fromPos, focusDirection);

        return findViewByPosition(nextPos);

    }

    /**
     * Manually detect next view to focus.
     *
     * @param fromPos from what position start to seek.
     * @param direction in what direction start to seek. Your regular {@code View.FOCUS_*}.
     * @return adapter position of next view to focus. May be equal to {@code fromPos}.
     */
    protected int getNextViewPos(int fromPos, int direction)
    {
        int offset = calcOffsetToNextView(direction);

        if (hitBorder(fromPos, offset))
        {
            return fromPos;
        }

        return fromPos + offset;
    }

    /**
     * Calculates position offset.
     *
     * @param direction regular {@code View.FOCUS_*}.
     * @return position offset according to {@code direction}.
     */
    protected int calcOffsetToNextView(int direction)
    {
        int spanCount = getSpanCount();
        int orientation = getOrientation();

        if (orientation == VERTICAL)
        {
            switch (direction)
            {
                case View.FOCUS_DOWN:
                    return spanCount;
                case View.FOCUS_UP:
                    return -spanCount;
                case View.FOCUS_RIGHT:
                    return 1;
                case View.FOCUS_LEFT:
                    return -1;
            }
        }
        else if (orientation == HORIZONTAL)
        {
            switch (direction)
            {
                case View.FOCUS_DOWN:
                    return 1;
                case View.FOCUS_UP:
                    return -1;
                case View.FOCUS_RIGHT:
                    return spanCount;
                case View.FOCUS_LEFT:
                    return -spanCount;
            }
        }

        return 0;
    }

    /**
     * Checks if we hit borders.
     *
     * @param from from what position.
     * @param offset offset to new position.
     * @return {@code true} if we hit border.
     */
    private boolean hitBorder(int from, int offset)
    {
        int spanCount = getSpanCount();

        if (Math.abs(offset) == 1)
        {
            int spanIndex = from % spanCount;
            int newSpanIndex = spanIndex + offset;
            return newSpanIndex < 0 || newSpanIndex >= spanCount;
        }
        else
        {
            int newPos = from + offset;
            return newPos < 0 && newPos >= spanCount;
        }
    }
}