text:
module BoardHelper
  def board_portal_link
    'https://sites.google.com/doodles-academy.org/boardportal/home?authuser=1'
  end
end


text:
#ifndef vnsw_agent_cmn_hpp
#define vnsw_agent_cmn_hpp

#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/address.h>
#include <unistd.h>

#include <boost/intrusive_ptr.hpp>
#include <boost/bind.hpp>
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <boost/uuid/nil_generator.hpp>

#include <tbb/atomic.h>
#include <tbb/mutex.h>

#include <io/event_manager.h>
#include <db/db.h>
#include <db/db_entry.h>
#include <db/db_table.h>
#include <db/db_table_partition.h>
#include <db/db_table_walker.h>

#include <base/logging.h>
#include <base/task.h>
#include <base/task_trigger.h>
#include <base/task_annotations.h>
#include <base/dependency.h>
#include <base/lifetime.h>

#include <ifmap/ifmap_agent_parser.h>
#include <ifmap/ifmap_agent_table.h>

#include <sandesh/sandesh_trace.h>
#include <sandesh/common/vns_constants.h>

#include <cmn/agent.h>
#include <cmn/agent_db.h>
#include <cmn/event_notifier.h>

static inline bool UnregisterDBTable(DBTable *table,
                                     DBTableBase::ListenerId id) {
    table->Unregister(id);
    return true;
}

static inline TaskTrigger *SafeDBUnregister(DBTable *table,
                                            DBTableBase::ListenerId id) {
    TaskTrigger *trigger =
           new TaskTrigger(boost::bind(&UnregisterDBTable, table, id),
               TaskScheduler::GetInstance()->GetTaskId("db::DBTable"), 0);
    trigger->Set();
    return trigger;
}

static inline void CfgUuidSet(uint64_t ms_long, uint64_t ls_long,
                              boost::uuids::uuid &u) {
    for (int i = 0; i < 8; i++) {
        u.data[7 - i] = ms_long & 0xFF;
        ms_long = ms_long >> 8;
    }

    for (int i = 0; i < 8; i++) {
        u.data[15 - i] = ls_long & 0xFF;
        ls_long = ls_long >> 8;
    }
}

static inline void CloseTaskFds(void) {
    int max_open_fds = sysconf(_SC_OPEN_MAX);
    int fd;
    for(fd = 3; fd < max_open_fds; fd++)
        close(fd);
}

extern SandeshTraceBufferPtr OperConfigTraceBuf;
extern bool GetBuildInfo(std::string &build_info_str);

#define OPER_IFMAP_TRACE(obj, ...)\
do {\
   Oper##obj::TraceMsg(OperConfigTraceBuf, __FILE__, __LINE__, __VA_ARGS__);\
} while (false);\

#define IFMAP_ERROR(obj, ...)\
do {\
    if (LoggingDisabled()) break;\
    obj::Send(g_vns_constants.CategoryNames.find(Category::IFMAP_AGENT)->second,\
              SandeshLevel::SYS_ERR, __FILE__, __LINE__, ##__VA_ARGS__);\
} while (false);\

#endif // vnsw_agent_cmn_hpp

redpajama_set_name: RedPajamaGithub


text:
#include "tensorflow/lite/delegates/gpu/cl/egl_sync.h"

#include "tensorflow/lite/delegates/gpu/gl/gl_call.h"

namespace tflite {
namespace gpu {
namespace cl {

absl::Status EglSync::NewFence(EGLDisplay display, EglSync* sync) {
  EGLSyncKHR egl_sync;
  RETURN_IF_ERROR(TFLITE_GPU_CALL_EGL(eglCreateSyncKHR, &egl_sync, display,
                                      EGL_SYNC_FENCE_KHR, nullptr));
  if (egl_sync == EGL_NO_SYNC_KHR) {
    return absl::InternalError("Returned empty KHR EGL sync");
  }
  *sync = EglSync(display, egl_sync);
  return absl::OkStatus();
}

EglSync& EglSync::operator=(EglSync&& sync) {
  if (this != &sync) {
    Invalidate();
    std::swap(sync_, sync.sync_);
    display_ = sync.display_;
  }
  return *this;
}

void EglSync::Invalidate() {
  if (sync_ != EGL_NO_SYNC_KHR) {
    eglDestroySyncKHR(display_, sync_);
    sync_ = EGL_NO_SYNC_KHR;
  }
}

absl::Status EglSync::ServerWait() {
  EGLint result;
  RETURN_IF_ERROR(
      TFLITE_GPU_CALL_EGL(eglWaitSyncKHR, &result, display_, sync_, 0));
  return result == EGL_TRUE ? absl::OkStatus()
                            : absl::InternalError("eglWaitSync failed");
}

absl::Status EglSync::ClientWait() {
  EGLint result;
  // TODO(akulik): make it active wait for better performance
  RETURN_IF_ERROR(TFLITE_GPU_CALL_EGL(eglClientWaitSyncKHR, &result, display_,
                                      sync_, EGL_SYNC_FLUSH_COMMANDS_BIT_KHR,
                                      EGL_FOREVER_KHR));
  return result == EGL_CONDITION_SATISFIED_KHR
             ? absl::OkStatus()
             : absl::InternalError("eglClientWaitSync failed");
}

}  // namespace cl
}  // namespace gpu
}  // namespace tflite


text:
<?php
/**
 * Created by PhpStorm.
 * User: sl
 * Date: 23.05.2017
 * Time: 07:46
 */

namespace YamsuitePlugin\YamsuiteBoard\Entities;

use Illuminate\Database\Eloquent\Model;

class Theme extends Model
{
    protected $fillable = [];
}


text:
"""View tests."""

from __future__ import unicode_literals

from django.core.exceptions import ImproperlyConfigured
from django.http import Http404
from django.test import TestCase
from django.test.client import RequestFactory

from endless_pagination import views
from endless_pagination.tests import (
    make_model_instances,
    TestModel,
)

class CustomizedListView(views.AjaxListView):
    """An AjaxListView subclass overriding the *get* method."""

    def get(self, request, *args, **kwargs):
        self.object_list = self.queryset
        context = self.get_context_data(object_list=self.object_list)
        return self.render_to_response(context)

class AjaxListViewTest(TestCase):

    model_page_template = 'endless_pagination/testmodel_list_page.html'
    model_template_name = 'endless_pagination/testmodel_list.html'
    page_template = 'page_template.html'
    template_name = 'template.html'
    url = '/?page=2'

    def setUp(self):
        factory = RequestFactory()
        self.request = factory.get(self.url)
        self.ajax_request = factory.get(
            self.url, HTTP_X_REQUESTED_WITH='XMLHttpRequest')

    def check_response(self, response, template_name, object_list):
        """Execute several assertions on the response.

        Check that the response has a successful status code,
        uses ``template_name`` and contains ``object_list``.
        """
        self.assertEqual(200, response.status_code)
        self.assertSequenceEqual([template_name], response.template_name)
        self.assertSequenceEqual(
            list(object_list), response.context_data['object_list'])

    def make_view(self, *args, **kwargs):
        """Return an instance of AjaxListView."""
        return views.AjaxListView.as_view(*args, **kwargs)

    def test_list(self):
        # Ensure the view correctly adds the list to context.
        view = self.make_view(
            queryset=range(30),
            template_name=self.template_name,
            page_template=self.page_template,
        )
        response = view(self.request)
        self.check_response(response, self.template_name, range(30))

    def test_list_ajax(self):
        # Ensure the list view switches templates when the request is Ajax.
        view = self.make_view(
            queryset=range(30),
            template_name=self.template_name,
            page_template=self.page_template,
        )
        response = view(self.ajax_request)
        self.check_response(response, self.page_template, range(30))

    def test_queryset(self):
        # Ensure the view correctly adds the queryset to context.
        queryset = make_model_instances(30)
        view = self.make_view(queryset=queryset)
        response = view(self.request)
        self.check_response(response, self.model_template_name, queryset)

    def test_queryset_ajax(self):
        # Ensure the queryset view switches templates when the request is Ajax.
        queryset = make_model_instances(30)
        view = self.make_view(queryset=queryset)
        response = view(self.ajax_request)
        self.check_response(response, self.model_page_template, queryset)

    def test_model(self):
        # Ensure the view correctly uses the model to generate the template.
        queryset = make_model_instances(30)
        view = self.make_view(model=TestModel)
        response = view(self.request)
        self.check_response(response, self.model_template_name, queryset)

    def test_model_ajax(self):
        # Ensure the model view switches templates when the request is Ajax.
        queryset = make_model_instances(30)
        view = self.make_view(model=TestModel)
        response = view(self.ajax_request)
        self.check_response(response, self.model_page_template, queryset)

    def test_missing_queryset_or_model(self):
        # An error is raised if both queryset and model are not provided.
        view = self.make_view()
        with self.assertRaises(ImproperlyConfigured) as cm:
            view(self.request)
        self.assertIn('queryset', str(cm.exception))
        self.assertIn('model', str(cm.exception))

    def test_missing_page_template(self):
        # An error is raised if the ``page_template`` name is not provided.
        view = self.make_view(queryset=range(30))
        with self.assertRaises(ImproperlyConfigured) as cm:
            view(self.request)
        self.assertIn('page_template', str(cm.exception))

    def test_do_not_allow_empty(self):
        # An error is raised if the list is empty and ``allow_empty`` is
        # set to False.
        view = self.make_view(model=TestModel, allow_empty=False)
        with self.assertRaises(Http404) as cm:
            view(self.request)
        self.assertIn('allow_empty', str(cm.exception))

    def test_view_in_context(self):
        # Ensure the view is included in the template context.
        view = self.make_view(
            queryset=range(30),
            page_template=self.page_template,
        )
        response = view(self.request)
        view_instance = response.context_data['view']
        self.assertIsInstance(view_instance, views.AjaxListView)

    def test_customized_view(self):
        # Ensure the customized view correctly adds the queryset to context.
        queryset = make_model_instances(30)
        view = CustomizedListView.as_view(queryset=queryset)
        response = view(self.request)
        self.check_response(response, self.model_template_name, queryset)


text:
/*
 * This source code is provided to illustrate the usage of a given feature
 * or technique and has been deliberately simplified. Additional steps
 * required for a production-quality application, such as security checks,
 * input validation and proper error handling, might not be present in
 * this sample code.
 */

package com.sun.tools.example.debug.gui;

import java.io.*;
import java.util.*;

import com.sun.jdi.*;
import com.sun.tools.example.debug.event.*;
import com.sun.tools.example.debug.bdi.*;

public class ContextManager {

    private ClassManager classManager;
    private ExecutionManager runtime;

    private String mainClassName;
    private String vmArguments;
    private String commandArguments;
    private String remotePort;

    private ThreadReference currentThread;

    private boolean verbose;

    private ArrayList<ContextListener> contextListeners = new ArrayList<ContextListener>();

    public ContextManager(Environment env) {
        classManager = env.getClassManager();
        runtime = env.getExecutionManager();
        mainClassName = "";
        vmArguments = "";
        commandArguments = "";
        currentThread = null;

        ContextManagerListener listener = new ContextManagerListener();
        runtime.addJDIListener(listener);
        runtime.addSessionListener(listener);
    }

    // Program execution defaults.

    //### Should there be change listeners for these?
    //### They would be needed if we expected a dialog to be
    //### synchronized with command input while it was open.

    public String getMainClassName() {
        return mainClassName;
    }

    public void setMainClassName(String mainClassName) {
        this.mainClassName = mainClassName;
    }

    public String getVmArguments() {
        return processClasspathDefaults(vmArguments);
    }

    public void setVmArguments(String vmArguments) {
        this.vmArguments = vmArguments;
    }

    public String getProgramArguments() {
        return commandArguments;
    }

    public void setProgramArguments(String commandArguments) {
        this.commandArguments = commandArguments;
    }

    public String getRemotePort() {
        return remotePort;
    }

    public void setRemotePort(String remotePort) {
        this.remotePort = remotePort;

    }

    // Miscellaneous debugger session preferences.

    public boolean getVerboseFlag() {
        return verbose;
    }

    public void setVerboseFlag(boolean verbose) {
        this.verbose = verbose;
    }

    // Thread focus.

    public ThreadReference getCurrentThread() {
        return currentThread;
    }

    public void setCurrentThread(ThreadReference t) {
        if (t != currentThread) {
            currentThread = t;
            notifyCurrentThreadChanged(t);
        }
    }

    public void setCurrentThreadInvalidate(ThreadReference t) {
        currentThread = t;
        notifyCurrentFrameChanged(runtime.threadInfo(t),
                                  0, true);
    }

    public void invalidateCurrentThread() {
        notifyCurrentFrameChanged(null, 0, true);
    }

    // If a view is displaying the current thread, it may
    // choose to indicate which frame is current in the
    // sense of the command-line UI.  It may also "warp" the
    // selection to that frame when changed by an 'up' or 'down'
    // command. Hence, a notifier is provided.

    /******
    public int getCurrentFrameIndex() {
        return getCurrentFrameIndex(currentThreadInfo);
    }
    ******/

    public int getCurrentFrameIndex(ThreadReference t) {
        return getCurrentFrameIndex(runtime.threadInfo(t));
    }

    //### Used in StackTraceTool.
    public int getCurrentFrameIndex(ThreadInfo tinfo) {
        if (tinfo == null) {
            return 0;
        }
        Integer currentFrame = (Integer)tinfo.getUserObject();
        if (currentFrame == null) {
            return 0;
        } else {
            return currentFrame.intValue();
        }
    }

    public int moveCurrentFrameIndex(ThreadReference t, int count) throws VMNotInterruptedException {
        return setCurrentFrameIndex(t,count, true);
    }

    public int setCurrentFrameIndex(ThreadReference t, int newIndex) throws VMNotInterruptedException {
        return setCurrentFrameIndex(t, newIndex, false);
    }

    public int setCurrentFrameIndex(int newIndex) throws VMNotInterruptedException {
        if (currentThread == null) {
            return 0;
        } else {
            return setCurrentFrameIndex(currentThread, newIndex, false);
        }
    }

    private int setCurrentFrameIndex(ThreadReference t, int x, boolean relative) throws VMNotInterruptedException {
        boolean sameThread = t.equals(currentThread);
        ThreadInfo tinfo = runtime.threadInfo(t);
        if (tinfo == null) {
            return 0;
        }
        int maxIndex = tinfo.getFrameCount()-1;
        int oldIndex = getCurrentFrameIndex(tinfo);
        int newIndex = relative? oldIndex + x : x;
        if (newIndex > maxIndex) {
            newIndex = maxIndex;
        } else  if (newIndex < 0) {
            newIndex = 0;
        }
        if (!sameThread || newIndex != oldIndex) {  // don't recurse
            setCurrentFrameIndex(tinfo, newIndex);
        }
        return newIndex - oldIndex;
    }

    private void setCurrentFrameIndex(ThreadInfo tinfo, int index) {
        tinfo.setUserObject(new Integer(index));
        //### In fact, the value may not have changed at this point.
        //### We need to signal that the user attempted to change it,
        //### however, so that the selection can be "warped" to the
        //### current location.
        notifyCurrentFrameChanged(tinfo.thread(), index);
    }

    public StackFrame getCurrentFrame() throws VMNotInterruptedException {
        return getCurrentFrame(runtime.threadInfo(currentThread));
    }

    public StackFrame getCurrentFrame(ThreadReference t) throws VMNotInterruptedException {
        return getCurrentFrame(runtime.threadInfo(t));
    }

    public StackFrame getCurrentFrame(ThreadInfo tinfo) throws VMNotInterruptedException {
        int index = getCurrentFrameIndex(tinfo);
        try {
            // It is possible, though unlikely, that the VM was interrupted
            // before the thread created its Java stack.
            return tinfo.getFrame(index);
        } catch (FrameIndexOutOfBoundsException e) {
            return null;
        }
    }

    public void addContextListener(ContextListener cl) {
        contextListeners.add(cl);
    }

    public void removeContextListener(ContextListener cl) {
        contextListeners.remove(cl);
    }

    //### These notifiers are fired only in response to USER-INITIATED changes
    //### to the current thread and current frame.  When the current thread is set automatically
    //### after a breakpoint hit or step completion, no event is generated.  Instead,
    //### interested parties are expected to listen for the BreakpointHit and StepCompleted
    //### events.  This convention is unclean, and I believe that it reflects a defect in
    //### in the current architecture.  Unfortunately, however, we cannot guarantee the
    //### order in which various listeners receive a given event, and the handlers for
    //### the very same events that cause automatic changes to the current thread may also
    //### need to know the current thread.

    private void notifyCurrentThreadChanged(ThreadReference t) {
        ThreadInfo tinfo = null;
        int index = 0;
        if (t != null) {
            tinfo = runtime.threadInfo(t);
            index = getCurrentFrameIndex(tinfo);
        }
        notifyCurrentFrameChanged(tinfo, index, false);
    }

    private void notifyCurrentFrameChanged(ThreadReference t, int index) {
        notifyCurrentFrameChanged(runtime.threadInfo(t),
                                  index, false);
    }

    private void notifyCurrentFrameChanged(ThreadInfo tinfo, int index,
                                           boolean invalidate) {
        ArrayList<ContextListener> l =  new ArrayList<ContextListener>(contextListeners);
        CurrentFrameChangedEvent evt =
            new CurrentFrameChangedEvent(this, tinfo, index, invalidate);
        for (int i = 0; i < l.size(); i++) {
            l.get(i).currentFrameChanged(evt);
        }
    }

    private class ContextManagerListener extends JDIAdapter
                       implements SessionListener, JDIListener {

        // SessionListener

        @Override
        public void sessionStart(EventObject e) {
            invalidateCurrentThread();
        }

        @Override
        public void sessionInterrupt(EventObject e) {
            setCurrentThreadInvalidate(currentThread);
        }

        @Override
        public void sessionContinue(EventObject e) {
            invalidateCurrentThread();
        }

        // JDIListener

        @Override
        public void locationTrigger(LocationTriggerEventSet e) {
            setCurrentThreadInvalidate(e.getThread());
        }

        @Override
        public void exception(ExceptionEventSet e) {
            setCurrentThreadInvalidate(e.getThread());
        }

        @Override
        public void vmDisconnect(VMDisconnectEventSet e) {
            invalidateCurrentThread();
        }

    }

    /**
     * Add a -classpath argument to the arguments passed to the exec'ed
     * VM with the contents of CLASSPATH environment variable,
     * if -classpath was not already specified.
     *
     * @param javaArgs the arguments to the VM being exec'd that
     *                 potentially has a user specified -classpath argument.
     * @return a javaArgs whose -classpath option has been added
     */

    private String processClasspathDefaults(String javaArgs) {
        if (javaArgs.indexOf("-classpath ") == -1) {
            StringBuffer munged = new StringBuffer(javaArgs);
            SearchPath classpath = classManager.getClassPath();
            if (classpath.isEmpty()) {
                String envcp = System.getProperty("env.class.path");
                if ((envcp != null) && (envcp.length() > 0)) {
                    munged.append(" -classpath " + envcp);
                }
            } else {
                munged.append(" -classpath " + classpath.asString());
            }
            return munged.toString();
        } else {
            return javaArgs;
        }
    }

    private String appendPath(String path1, String path2) {
        if (path1 == null || path1.length() == 0) {
            return path2 == null ? "." : path2;
        } else if (path2 == null || path2.length() == 0) {
            return path1;
        } else {
            return path1  + File.pathSeparator + path2;
        }
    }

}


text:
const EventEmitter = require('events');

class MyEmitter extends EventEmitter {}

const myEmitter = new MyEmitter();

// Only do this once so we don't loop forever
myEmitter.once('newListener', (event, listener) => {
    if (event === 'event') {
        // Insert a new listener in the front
        myEmitter.on('event', () => {
            console.log('B');
        });
    }
});

myEmitter.on('event', () => {
    console.log('A');
});

myEmitter.emit('event');  // Prints: B \n A


text:
var Component = videojs.getComponent('Component');

// The videojs.extend function is used to assist with inheritance. In
// an ES6 environment, `class TitleBar extends Component` would work
// identically.
// videojs.extend方法用来实现继承,等同于ES6环境中的class titleBar extends Component用法
var TitleBar = videojs.extend(Component, {

  // The constructor of a component receives two arguments: the
  // player it will be associated with and an object of options.
  // 这个构造函数接收两个参数:
  // player将被用来关联options中的参数
  constructor: function(player, options) {

    // It is important to invoke the superclass before anything else,
    // to get all the features of components out of the box!
    // 在做其它事之前先调用父类的构造函数是很重要的,
    // 这样可以使父组件的所有特性在子组件中开箱即用。
    Component.apply(this, arguments);

    // If a `text` option was passed in, update the text content of
    // the component.
    // 如果在options中传了text属性,那么更新这个组件的文字显示
    if (options.text) {
      this.updateTextContent(options.text);
    }
  },

  // The `createEl` function of a component creates its DOM element.
  // 创建一个DOM元素
  createEl: function() {
    return videojs.dom.createEl('div', {

      // Prefixing classes of elements within a player with "vjs-"
      // is a convention used in Video.js.
      //给元素加vjs-开头的样式名,是videojs内置样式约定俗成的做法
      className: 'vjs-title-bar'
    });
  },

  // This function could be called at any time to update the text
  // contents of the component.
  // 这个方法可以在任何需要更新这个组件内容的时候调用
  updateTextContent: function(text) {

    // If no text was provided, default to "Text Unknown"
    // 如果options中没有提供text属性,默认显示Text Unknow
    if (typeof text !== 'string') {
      text = 'Text Unknown';
    }

    // Use Video.js utility DOM methods to manipulate the content
    // of the component's element.
    // 使用Video.js提供的DOM方法来操作组件元素
    videojs.dom.emptyEl(this.el());
    videojs.dom.appendContent(this.el(), text);
  }
});

// Register the component with Video.js, so it can be used in players.
// 在videojs中注册这个组件,才可以使用哦.
videojs.registerComponent('TitleBar', TitleBar);


text:
..
..
.. Licensed under the Apache License, Version 2.0 (the "License");
.. you may not use this file except in compliance with the License.
.. You may obtain a copy of the License at
..
..     http://www.apache.org/licenses/LICENSE-2.0
..
.. Unless required by applicable law or agreed to in writing, software
.. distributed under the License is distributed on an "AS IS" BASIS,
.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
.. See the License for the specific language governing permissions and
.. limitations under the License.
..

.. _to-api-v1-deliveryservices-required-capabilities:

******************************************
``deliveryservices_required_capabilities``
******************************************

.. versionadded:: 1.4

``GET``
=======
Gets all associations of :term:`Server Capability` to :term:`Delivery Services`.

:Auth. Required: Yes
:Roles Required: None
:Response Type:  Array

Request Structure
-----------------
.. table:: Request Query Parameters

	+--------------------+----------+---------------------------------------------------------------------------------------------------------------+
	| Name               | Required | Description                                                                                |
	+====================+==========+===============================================================================================================+
	| deliveryServiceID  | no       | Filter :term:`Server Capability` associations by :term:`Delivery Service` integral, unique identifier         |
	+--------------------+----------+---------------------------------------------------------------------------------------------------------------+
	| xmlID              | no       | Filter :term:`Server Capability` associations by :term:`Delivery Service` :ref:`ds-xmlid`                     |
	+--------------------+----------+---------------------------------------------------------------------------------------------------------------+
	| requiredCapability | no       | Filter :term:`Server Capability` associations by :term:`Server Capability` name                               |
	+--------------------+----------+---------------------------------------------------------------------------------------------------------------+
	| orderby            | no       | Choose the ordering of the results - must be the name of one of the fields of the objects in the ``response`` |
	|                    |          | array                                                                                |
	+--------------------+----------+---------------------------------------------------------------------------------------------------------------+
	| sortOrder          | no       | Changes the order of sorting. Either ascending (default or "asc") or descending ("desc")                      |
	+--------------------+----------+---------------------------------------------------------------------------------------------------------------+
	| limit              | no       | Choose the maximum number of results to return                                                                |
	+--------------------+----------+---------------------------------------------------------------------------------------------------------------+
	| offset             | no       | The number of results to skip before beginning to return results. Must use in conjunction with limit.         |
	+--------------------+----------+---------------------------------------------------------------------------------------------------------------+
	| page               | no       | Return the n\ :sup:`th` page of results, where "n" is the value of this parameter, pages are ``limit`` long   |
	|                    |          | and the first page is 1. If ``offset`` was defined, this query parameter has no effect. ``limit`` must be     |
	|                    |          | defined to make use of ``page``.                                                                              |
	+--------------------+----------+---------------------------------------------------------------------------------------------------------------+

.. code-block:: http
	:caption: Request Example

	GET /api/1.4/deliveryservices_required_capabilities HTTP/1.1
	Host: trafficops.infra.ciab.test
	User-Agent: curl/7.47.0
	Accept: */*
	Cookie: mojolicious=...

Response Structure
------------------
:deliveryServiceID:   The associated :term:`Delivery Service`'s integral, unique identifier
:xmlID:               The associated :term:`Delivery Service`'s :ref:`ds-xmlid`
:lastUpdated:         The date and time at which this association between the :term:`Delivery Service` and the :term:`Server Capability` was last updated, in an ISO-like format
:requiredCapability:  The :term:`Server Capability`'s name

.. code-block:: http
	:caption: Response Example

	HTTP/1.1 200 OK
	Access-Control-Allow-Credentials: true
	Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-Cookie, Cookie
	Access-Control-Allow-Methods: POST,GET,OPTIONS,DELETE
	Access-Control-Allow-Origin: *
	Content-Type: application/json
	Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
	Whole-Content-Sha512: UFO3/jcBFmFZM7CsrsIwTfPc5v8gUiXqJm6BNp1boPb4EQBnWNXZh/DbBwhMAOJoeqDImoDlrLnrVjQGO4AooA==
	X-Server-Name: traffic_ops_golang/
	Date: Mon, 07 Oct 2019 22:15:11 GMT
	Content-Length: 396

	{
		"response": [
			{
				"deliveryServiceID": 1,
				"lastUpdated": "2019-10-07 22:05:31+00",
				"requiredCapability": "ram",
				"xmlId": "example_ds-1"
			},
			{
				"deliveryServiceID": 2,
				"lastUpdated": "2019-10-07 22:05:31+00",
				"requiredCapability": "disk",
				"xmlId": "example_ds-2"
			}
		]
	}

``POST``
========
Associates a :term:`Server Capability` with a :term:`Delivery Service`.

:Auth. Required: Yes
:Roles Required: "admin" or "operations"
:Response Type:  Object

.. note:: A :term:`Server Capability` can only be made required on a :term:`Delivery Service` if its associated Servers already have that :term:`Server Capability` assigned.

Request Structure
-----------------
:deliveryServiceID:   The integral, unique identifier of the :term:`Delivery Service` to be associated
:requiredCapability:  The name of the :term:`Server Capability` to be associated

.. code-block:: http
	:caption: Request Example

	POST /api/1.4/deliveryservices_required_capabilities HTTP/1.1
	Host: trafficops.infra.ciab.test
	User-Agent: curl/7.47.0
	Accept: */*
	Cookie: mojolicious=...
	Content-Length: 56
	Content-Type: application/json

	{
		"deliveryServiceID": 1,
		"requiredCapability": "disk"
	}

Response Structure
------------------
:deliveryServiceID:   The newly associated :term:`Delivery Service`'s integral, unique identifier
:lastUpdated:         The date and time at which this association between the :term:`Delivery Service` and the :term:`Server Capability` was last updated, in an ISO-like format
:requiredCapability:  The newly associated :term:`Server Capability`'s name

.. code-block:: http
	:caption: Response Example

	HTTP/1.1 200 OK
	Access-Control-Allow-Credentials: true
	Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-Cookie, Cookie
	Access-Control-Allow-Methods: POST,GET,OPTIONS,DELETE
	Access-Control-Allow-Origin: *
	Content-Type: application/json
	Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
	Whole-Content-Sha512: eQrl48zWids0kDpfCYmmtYMpegjnFxfOVvlBYxxLSfp7P7p6oWX4uiC+/Cfh2X9i3G+MQ36eH95gukJqOBOGbQ==
	X-Server-Name: traffic_ops_golang/
	Date: Mon, 07 Oct 2019 22:15:11 GMT
	Content-Length: 287

	{
		"alerts": [
			{
				"level": "success",
				"text": "deliveryservice.RequiredCapability was created."
			}
		],
		"response": {
			"deliveryServiceID": 1,
			"lastUpdated": "2019-10-07 22:15:11+00",
			"requiredCapability": "disk"
		}
	}

``DELETE``
==========
Dissociate a :term:`Server Capability` from a :term:`Delivery Service`.

:Auth. Required: Yes
:Roles Required: "admin" or "operations"
:Response Type:  ``undefined``

Request Structure
-----------------
:deliveryServiceID:   The integral, unique identifier of the :term:`Delivery Service` from which a :term:`Server Capability` will be dissociated
:requiredCapability:  The name of the :term:`Server Capability` to dissociate

.. code-block:: http
	:caption: Request Example

	POST /api/1.4/deliveryservices_required_capabilities HTTP/1.1
	Host: trafficops.infra.ciab.test
	User-Agent: curl/7.47.0
	Accept: */*
	Cookie: mojolicious=...
	Content-Length: 56
	Content-Type: application/json

	{
		"deliveryServiceID": 1,
		"requiredCapability": "disk"
	}

Response Structure
------------------
.. code-block:: http
	:caption: Response Example

	HTTP/1.1 200 OK
	Access-Control-Allow-Credentials: true
	Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-Cookie, Cookie
	Access-Control-Allow-Methods: POST,GET,OPTIONS,DELETE
	Access-Control-Allow-Origin: *
	Content-Type: application/json
	Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
	Whole-Content-Sha512: eQrl48zWids0kDpfCYmmtYMpegjnFxfOVvlBYxxLSfp7P7p6oWX4uiC+/Cfh2X9i3G+MQ36eH95gukJqOBOGbQ==
	X-Server-Name: traffic_ops_golang/
	Date: Mon, 07 Oct 2019 22:15:11 GMT
	Content-Length: 127

	{
		"alerts": [
			{
				"level": "success",
				"text": "deliveryservice.RequiredCapability was deleted."
			}
		]
	}


text:
title: "Stroom Proxy Configuration"
linkTitle: "Stroom Proxy Configuration"
#weight:
date: 2021-06-23
tags:
  - proxy
description: >

---

{{% see-also %}}
[Stroom Application Configuration]({{< relref "./configuring-stroom.md" >}})
[Properties]({{< relref "../../user-guide/properties.md" >}})
{{% /see-also %}}

The configuration of Stroom-proxy is very much the same as for Stroom with the only difference being the structure of the `config.yml` file.
Stroom-proxy has a `proxyConfig` key in the YAML while Stroom has `appConfig`.
It is recommended to first read [Stroom Application Configuration]({{< relref "./configuring-stroom.md" >}}) to understand the general mechanics of the stroom configuration as this will largely apply to stroom-proxy.

## General configuration

The Stroom-proxy application is essentially just an executable {{< external-link "JAR" "https://en.wikipedia.org/wiki/JAR_%28file_format%29" >}} file that can be run when provided with a configuration file, `config.yml`.
This configuration file is common to all forms of deployment.

### config.yml

Stroom-proxy does not have a user interface so the `config.yml` file is the only way of configuring stroom-proxy.
As with stroom, the `config.yml` file is split into three sections using these keys:

* `server` - Configuration of the web server, e.g. ports, paths, request logging.
* `logging` - Configuration of application logging
* `proxyConfig` - Configuration of stroom-proxy

See also [Properties]({{< relref "../../user-guide/properties.md" >}}) for more details on structure of the config.yml file and supported data types.

Stroom-proxy operates on a configuration by exception basis so all configuration properties will have a sensible default value and a property only needs to be explicitly configured if the default value is not appropriate, e.g. for tuning a large scale production deployment or where values are environment specific.
As a result `config.yml` only contains a minimal set of properties.
The full tree of properties can be seen in `./config/config-defaults.yml` and a schema for the configuration tree (along with descriptions for each property) can be found in `./config/config-schema.yml`.
These two files can be used as a reference when configuring stroom.

#### Key Configuration Properties

Stroom-proxy has two main functions, storing and forwarding.
It can be configured to do either or both of these functions.
These functions are enabled/disabled using:

```yaml
proxyConfig:

  forwardStreamConfig:
    forwardingEnabled: true

  proxyRepositoryConfig:
    storingEnabled: true
```

Stroom-proxy should be configured to check the receipt status of feeds on receipt of data.
This is done by configuring the end point of a downstream stroom-proxy or stroom.

```yaml
  feedStatus:
    url: "http://stroom:8080/api/feedStatus/v1"
    apiKey: ""
```

The `url` should be the url for the feed status API on the downstream stroom(-proxy).
If this is on the same host then you can use the http endpoint, however if it is on a remote host then you should use https and the host of its nginx, e.g. `https://downstream-instance/api/feedStatus/v1`.

In order to use the API, the proxy must have a configured `apiKey`.
The API key must be created in the downstream stroom instance and then copied into this configuration.

If the proxy is configured to forward data then the forward destination(s) should be set.
This is the `datafeed` endpoint of the downstream stroom-proxy or stroom instance that data will be forwarded to.
This may also be te address of a load balancer or similar that is fronting a cluster of stroom-proxy or stroom instances.
See also [Feed status certificate configuration](#feed-status-certificate-configuration).

```yaml
  forwardStreamConfig:
    forwardDestinations:
      - forwardUrl: "https://nginx/stroom/datafeed"
```

`forwardUrl` specifies the URL of the _datafeed_ endpoint on the destination host.
Each forward location can use a different key/trust store pair.
See also [Forwarding certificate configuration](#forwarding-certificate-configuration).

If the proxy is configured to store then it is the location of the proxy repository may need to be configured if it needs to be in a different location to the proxy home directory, e.g. on another mount point.

## Deploying without Docker

Apart from the structure of the `config.yml` file, the configuration in a non-docker environment is the same as for [stroom]({{< relref "./configuring-stroom-proxy.md#deploying-without-docker" >}})

## As part of a docker stack

The way stroom-proxy is configured is essentially the same as for [stroom]({{< relref "./configuring-stroom-proxy.md#as-part-of-a-docker-stack" >}}) with the only real difference being the structure of the `config.yml` file as note [above](#configyml) .
As with stroom the docker stack comes with a `./volumes/stroom-proxy-*/config/config.yml` file that will be used in the absence of a provided one.
Also as with stroom, the `config.yml` file supports environment variable substitution so can make use of environment variables set in the stack env file and passed down via the docker-compose YAML files.

### Certificates

Stroom-proxy makes use of client certificates for two purposes:

* Communicating with a downstream stroom/stroom-proxy in order to establish the receipt status for the feeds it has received data for.
* When forwarding data to a downstream stroom/stroom-proxy

The stack comes with the following files that can be used for demo/test purposes.

```text
volumes/stroom-proxy-*/certs/ca.jks
volumes/stroom-proxy-*/certs/client.jks
```

For a production deployment these will need to be changed, see [Certificates]({{< relref "./#certificates" >}})

#### Feed status certificate configuration

The configuration of the client certificates for feed status checks is done using:

```yaml
proxyConfig:

  jerseyClient:
    timeout: "10s"
    connectionTimeout: "10s"
    timeToLive: "1h"
    cookiesEnabled: false
    maxConnections: 1024
    maxConnectionsPerRoute: "1024"
    keepAlive: "0ms"
    retries: 0
    tls:
      verifyHostname: true
      keyStorePath: "/stroom-proxy/certs/client.jks"
      keyStorePassword: "password"
      keyStoreType: "JKS"
      trustStorePath: "/stroom-proxy/certs/ca.jks"
      trustStorePassword: "password"
      trustStoreType: "JKS"
      trustSelfSignedCertificates: false
```

This configuration is also used for making any other REST API calls.

#### Forwarding certificate configuration

Stroom-proxy can forward to multiple locations.
The configuration of the certificate(s) for the forwarding locations is as follows:

```yaml
proxyConfig:

  forwardStreamConfig:
    forwardingEnabled: true
    forwardDestinations:
      # If you want multiple forward destinations then you will need to edit this file directly
      # instead of using env var substitution
      - forwardUrl: "https://nginx/stroom/datafeed"
        sslConfig:
          keyStorePath: "/stroom-proxy/certs/client.jks"
          keyStorePassword: "password"
          keyStoreType: "JKS"
          trustStorePath: "/stroom-proxy/certs/ca.jks"
          trustStorePassword: "password"
          trustStoreType: "JKS"
          hostnameVerificationEnabled: true
```

`forwardUrl` specifies the URL of the _datafeed_ endpoint on the destination host.
Each forward location can use a different key/trust store pair.


text:
package com.lpii.evma.view;

import java.util.ArrayList;

import android.app.Activity;
import android.app.ListActivity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Typeface;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;

import com.lowagie.text.Image;
import com.lpii.evma.EvmaApp;
import com.lpii.evma.R;
import com.lpii.evma.controller.BilletController;
import com.lpii.evma.controller.EventsController;
import com.lpii.evma.controller.ForfaitController;
import com.lpii.evma.model.BilletAdapter;
import com.lpii.evma.model.BilletPackAdapter;
import com.lpii.evma.model.Event;

public class MyTicketForfaitsList extends ListActivity{

	ImageView mimageview_barcode_image;
	Button mbtnDownloadTicket;

	String pack_id;
	ImageView BilletQrCode;
	Bitmap bitmap;
	Image imgQRCODEBilletCode = null;
	String root;
	String fnames[];
	TextView tvPackTitle;
	// Stirngs
	String Event_id;
	ArrayList<String> qrCodesURL;

	int serverResponseCode = 0;
	ProgressDialog dialog = null;
	BilletController mBilletController;
	Event ev;

	String upLoadServerUri = null;

	final String uploadFilePath = Environment.getExternalStorageDirectory()
			.getAbsolutePath() + "/Evmax/";

	int CurrentIndex =0 ;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_my_ticket_single_pack);
		tvPackTitle = (TextView) findViewById(R.id.tvEventPacktitle);
 		qrCodesURL = new ArrayList<String>();
 		Intent orderDatasIntent = getIntent();

		mBilletController = new BilletController();
		EvmaApp.CurrBilletController = mBilletController;
 		if (orderDatasIntent != null) {
			Event_id = orderDatasIntent.getStringExtra(EventsController.TAG_ID);
			tvPackTitle.setText( orderDatasIntent.getStringExtra(EventsController.TAG_NAME));
 //			textview_barcode_EvTitle.setText( orderDatasIntent.getStringExtra(EventsController.TAG_NAME));

		}
		//getQRName();
 		new  getBillets().execute();

	    getActionBar().setDisplayHomeAsUpEnabled(true);
		getActionBar().setDisplayShowTitleEnabled(false);

	}

		@Override
		public void onListItemClick(ListView list, View v, int position, long id) {

			String packTitle = ((TextView) v.findViewById(R.id.tvmyticketpackTitle))
					.getText().toString();

			System.out.println("===> "+ packTitle);
			Intent in = new Intent(MyTicketForfaitsList.this, MyTicketQRCodes.class);
 			//in.putExtra(EventsController.TAG_dateTime, dateTime);
			in.putExtra(ForfaitController.TAG_pack_Title,packTitle);
 			in.putExtra("Organisateur", EventsController.getUsernameOrga());

			startActivity(in);

		}

	private class getBillets extends AsyncTask<Void, Void, Void> {

		@Override
		protected void onPreExecute() {
			super.onPreExecute();
            dialog = ProgressDialog.show(MyTicketForfaitsList.this, "", "Tssena...", true);

		}

		@Override
		protected Void doInBackground(Void... arg0) {
			EvmaApp.isReqFromOrga = true;
			System.out.println("LastEventID  " + EvmaApp.LastEventID);
			mBilletController.getTicketsQRName(EvmaApp.LastEventID);
			return null;
		}

		@Override
		protected void onPostExecute(Void result) {
			super.onPostExecute(result);
			// Dismiss the progress dialog
			if (dialog.isShowing()) {
				dialog.dismiss();
			}
			Typeface tfBold = Typeface.createFromAsset(getAssets(), "fonts/Roboto-Medium.ttf");
			ListAdapter adapterx = new BilletPackAdapter(MyTicketForfaitsList.this, mBilletController.getXxusermyticketpacklist(), tfBold, mBilletController);
			setListAdapter(adapterx);
			EvmaApp.CurrBilletController=  mBilletController;

		}

	}
}


text:
package za.co.truck.finder.integration.config;

public interface IntegrationPropertyKey {

     public static final String SERVICE_LOCATIOIN = "service.location";

    public static final String SERVICE_URL = "service.url";

}


text:
namespace google_apis {
class FileResource;
class ResourceEntry;
}

namespace sync_file_system {
namespace drive_backend {

class FileDetails;
class FileMetadata;
class FileTracker;
class MetadataDatabase;
class ServiceMetadata;

namespace test_util {

void ExpectEquivalentServiceMetadata(const ServiceMetadata& left,
                                     const ServiceMetadata& right);
void ExpectEquivalentDetails(const FileDetails& left, const FileDetails& right);
void ExpectEquivalentMetadata(const FileMetadata& left,
                              const FileMetadata& right);
void ExpectEquivalentTrackers(const FileTracker& left,
                              const FileTracker& right);
void ExpectEquivalentResourceAndMetadata(
    const google_apis::FileResource& resource,
    const FileMetadata& metadata);
void ExpectEquivalentMetadataAndTracker(const FileMetadata& metadata,
                                        const FileTracker& tracker);

}  // namespace test_util
}  // namespace drive_backend
}  // namespace sync_file_system

#endif  // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_BACKEND_TEST_UTIL_H_


text:
package org.apache.naming.resources;

import javax.naming.directory.DirContext;

/**
 * Implements a cache entry.
 *
 * @author Remy Maucherat
 * @version $Revision: 1.1 $
 */
public class CacheEntry {

    // ------------------------------------------------- Instance Variables

    public long timestamp = -1;
    public String name = null;
    public ResourceAttributes attributes = null;
    public Resource resource = null;
    public DirContext context = null;
    public boolean exists = true;
    public long accessCount = 0;
    public int size = 1;

    // ----------------------------------------------------- Public Methods

    public void recycle() {
        timestamp = -1;
        name = null;
        attributes = null;
        resource = null;
        context = null;
        exists = true;
        accessCount = 0;
        size = 1;
    }

    public String toString() {
        return ("Cache entry: " + name + "\n"
                + "Exists: " + exists + "\n"
                + "Attributes: " + attributes + "\n"
                + "Resource: " + resource + "\n"
                + "Context: " + context);
    }

}


text:
<!DOCTYPE html>

    <title>ECharts: Network Diagram</title>

    <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.css">
    <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.theme.min.css">
    <link rel="stylesheet" href="../../dist/dex-jquery.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css"/>
    <link rel="stylesheet" href="../../dist/dex-bootstrap.css">
    <link rel="stylesheet" href="../../dist/dex.css">


text:
from django.conf.urls import patterns, include, url
from django.core.urlresolvers import reverse_lazy

from django.contrib import admin
from django.conf import settings

from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.conf.urls.static import static

from django.contrib.auth.views import password_reset, password_reset_done, password_change, password_change_done
from django.views.generic import TemplateView
from django.contrib.auth import views as auth_views

admin.autodiscover()

urlpatterns = patterns('',
    url(r'^$', include('apps.home.urls')),
    (r'^projects/', include('apps.projects.urls')),
    (r'^tutorials/', include('apps.tutorials.urls')),
    (r'^post/', include('apps.post.urls')),
    (r'^tinymce/', include('tinymce.urls')),
    #(r'^mce_filebrowser/', include('apps.mce_filebrowser.urls')),
    (r'^admin/', include(admin.site.urls)),
    (r'^accounts/', include('registration.urls')),
    (r'^profile/', 'registration.views.Profile'),
    (r'^upload/', 'apps.post.views.upload'),

)

# from django-registration / registration / auth_urls.py

urlpatterns += patterns('',

                        url(r'^login/$',

                            auth_views.login,

                            {'template_name': 'registration/login.html'},

                            name='auth_login'),

                        url(r'^logout/$',

                            auth_views.logout,

                            {'template_name': 'registration/logout.html'},

                           name='auth_logout'),

                        url(r'^password/change/$',

                            auth_views.password_change,

                           {'post_change_redirect': reverse_lazy('auth_password_change_done')},

                            name='auth_password_change'),

                        url(r'^password/change/done/$',

                            auth_views.password_change_done,

                            name='auth_password_change_done'),

                        url(r'^password/reset/$',

                            auth_views.password_reset,

                           {'post_reset_redirect': reverse_lazy('auth_password_reset_done')},

                            name='auth_password_reset'),

                     url(r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$',

                            auth_views.password_reset_confirm,

                           {'post_reset_redirect': reverse_lazy('auth_password_reset_complete')},

                            name='auth_password_reset_confirm'),

                        url(r'^password/reset/complete/$',

                            auth_views.password_reset_complete,

                            name='auth_password_reset_complete'),

                        url(r'^password/reset/done/$',

                            auth_views.password_reset_done,

                            name='auth_password_reset_done'),
                        )

urlpatterns += staticfiles_urlpatterns()
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

if settings.DEBUG:
    import debug_toolbar
    urlpatterns += patterns('',
        url(r'^__debug__/', include(debug_toolbar.urls)),
    )


text:
#include "config.h"
#include "bindings/core/v8/RetainedDOMInfo.h"

#include "core/dom/ContainerNode.h"
#include "core/dom/NodeTraversal.h"

namespace blink {

RetainedDOMInfo::RetainedDOMInfo(Node* root)
    : m_root(root)
{
    ASSERT(m_root);
}

RetainedDOMInfo::~RetainedDOMInfo()
{
}

void RetainedDOMInfo::Dispose()
{
    delete this;
}

bool RetainedDOMInfo::IsEquivalent(v8::RetainedObjectInfo* other)
{
    ASSERT(other);
    if (other == this)
        return true;
    if (strcmp(GetLabel(), other->GetLabel()))
        return false;
    return static_cast<blink::RetainedObjectInfo*>(other)->GetEquivalenceClass() == this->GetEquivalenceClass();
}

intptr_t RetainedDOMInfo::GetHash()
{
    return PtrHash<void*>::hash(m_root);
}

const char* RetainedDOMInfo::GetGroupLabel()
{
    return m_root->inDocument() ? "(Document DOM trees)" : "(Detached DOM trees)";
}

const char* RetainedDOMInfo::GetLabel()
{
    return m_root->inDocument() ? "Document DOM tree" : "Detached DOM tree";
}

intptr_t RetainedDOMInfo::GetElementCount()
{
    intptr_t count = 1;
    Node* current = m_root;
    while (current) {
        current = NodeTraversal::next(*current, m_root);
        ++count;
    }
    return count;
}

intptr_t RetainedDOMInfo::GetEquivalenceClass()
{
    return reinterpret_cast<intptr_t>(m_root);
}

} // namespace blink


text:
bowl.cli_opts package
=====================

Submodules
----------

bowl.cli_opts.add module
------------------------

.. automodule:: bowl.cli_opts.add
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.connect module
----------------------------

.. automodule:: bowl.cli_opts.connect
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.delete module
---------------------------

.. automodule:: bowl.cli_opts.delete
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.disconnect module
-------------------------------

.. automodule:: bowl.cli_opts.disconnect
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.grant module
--------------------------

.. automodule:: bowl.cli_opts.grant
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.hosts module
--------------------------

.. automodule:: bowl.cli_opts.hosts
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.image_import module
---------------------------------

.. automodule:: bowl.cli_opts.image_import
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.images module
---------------------------

.. automodule:: bowl.cli_opts.images
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.info module
-------------------------

.. automodule:: bowl.cli_opts.info
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.kill module
-------------------------

.. automodule:: bowl.cli_opts.kill
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.link module
-------------------------

.. automodule:: bowl.cli_opts.link
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.list module
-------------------------

.. automodule:: bowl.cli_opts.list
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.login module
--------------------------

.. automodule:: bowl.cli_opts.login
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.logout module
---------------------------

.. automodule:: bowl.cli_opts.logout
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.logs module
-------------------------

.. automodule:: bowl.cli_opts.logs
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.new module
------------------------

.. automodule:: bowl.cli_opts.new
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.remove module
---------------------------

.. automodule:: bowl.cli_opts.remove
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.repositories module
---------------------------------

.. automodule:: bowl.cli_opts.repositories
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.revoke module
---------------------------

.. automodule:: bowl.cli_opts.revoke
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.services module
-----------------------------

.. automodule:: bowl.cli_opts.services
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.snapshot module
-----------------------------

.. automodule:: bowl.cli_opts.snapshot
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.snapshots module
------------------------------

.. automodule:: bowl.cli_opts.snapshots
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.start module
--------------------------

.. automodule:: bowl.cli_opts.start
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.stop module
-------------------------

.. automodule:: bowl.cli_opts.stop
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.subtract module
-----------------------------

.. automodule:: bowl.cli_opts.subtract
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.test module
-------------------------

.. automodule:: bowl.cli_opts.test
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.unlink module
---------------------------

.. automodule:: bowl.cli_opts.unlink
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.update module
---------------------------

.. automodule:: bowl.cli_opts.update
    :members:
    :undoc-members:
    :show-inheritance:

bowl.cli_opts.version module
----------------------------

.. automodule:: bowl.cli_opts.version
    :members:
    :undoc-members:
    :show-inheritance:

Module contents
---------------

.. automodule:: bowl.cli_opts
    :members:
    :undoc-members:
    :show-inheritance:


text:
import { getUidFromRouter } from './router'
import { selectUserInfo, UserMap } from './profile'
import { createSelector } from 'reselect'
import { Map, List } from 'immutable'
const getFollowers = state => state.follow.get('followers')
const getFollowings = state => state.follow.get('followings')

export type Followers = List<Map<keyof User, any>>
export type Followings = List<Map<keyof User, any>>

export const selectFollowersForUser = createSelector(
  [getFollowers, getUidFromRouter, selectUserInfo],
  (followers: Map<string, any>, userId: Uid, userMap: UserMap): Followers => {
    const followerIds: string[] = followers.getIn([userId, 'followers'])
    return followerIds
      ? List(followerIds.map(id => userMap.get(id)))
      : List()
  }
)

export const selectFollowingsForUser = createSelector(
  [getFollowings, getUidFromRouter, selectUserInfo],
  (followings: Map<string, any>, userId: Uid, userMap: UserMap): Followings => {
    const followingIds = followings.getIn([userId, 'followings'])
    return followingIds
      ? List(followingIds.map(id => userMap.get(id)))
      : List()
  }
)


text:
<?php

namespace ProxyManagerTest\Inflector\Util;

use PHPUnit_Framework_TestCase;
use ProxyManager\Inflector\Util\ParameterHasher;

/**
 * Tests for {@see \ProxyManager\Inflector\Util\ParameterHasher}
 *
 * @author Marco Pivetta <ocramius@gmail.com>
 * @license MIT
 *
 * @group Coverage
 */
class ParameterHasherTest extends PHPUnit_Framework_TestCase
{
    /**
     * @dataProvider getParameters
     *
     * @covers \ProxyManager\Inflector\Util\ParameterHasher::hashParameters
     */
    public function testGeneratesValidClassName(array $parameters, $expectedHash)
    {
        $encoder = new ParameterHasher();

        $this->assertSame($expectedHash, $encoder->hashParameters($parameters));
    }

    /**
     * @return array
     */
    public function getParameters()
    {
        return array(
            array(array(), '40cd750bba9870f18aada2478b24840a'),
            array(array('foo' => 'bar'), '49a3696adf0fbfacc12383a2d7400d51'),
            array(array('bar' => 'baz'), '6ed41c8a63c1571554ecaeb998198757'),
            array(array(null), '38017a839aaeb8ff1a658fce9af6edd3'),
            array(array(null, null), '12051f9a58288e5328ad748881cc4e00'),
            array(array('bar' => null), '0dbb112e1c4e6e4126232de2daa2d660'),
            array(array('bar' => 12345), 'eb6291ea4973741bf9b6571f49b4ffd2'),
            array(array('foo' => 'bar', 'bar' => 'baz'), '4447ff857f244d24c31bd84d7a855eda'),
        );
    }
}


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=constant.LGUIMOD.html">

Redirecting to constant.LGUIMOD.html...


text:
// SearchButton.h: interface for the buttons and edit classes used by the search dialog.
//
//////////////////////////////////////////////////////////////////////

#ifndef __ATLBTN_H__
#define __ATLBTN_H__

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CEditEx : public CWindowImpl<CEditEx, CEdit>
{
public:
	CEditEx()
	{
		ATLTRACE(_T("CEditEx::CEditEx()\n"));
	}

	~CEditEx()
	{
		ATLTRACE(_T("CEditEx::~CEditEx()\n"));
	}

	BEGIN_MSG_MAP(CEditEx)
		MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)
		DEFAULT_REFLECTION_HANDLER()
	END_MSG_MAP()

	BOOL PreTranslateMessage(MSG* pMsg)
	{
		return FALSE;
	}

	LRESULT OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
	{
		// If an 'Enter' key was pressed
		if (wParam == VK_RETURN)
		{
			// Do a search
			::SendMessage(GetParent(), WMU_FINDNOTE, 0, 0);
			return 0;
		}

		// If any other key do not handle the message
		bHandled = FALSE;
		return 0;
	}
};

class CButtonExCancel : public CWindowImpl<CButtonExCancel, CButton>
{
public:
	CButtonExCancel()
	{
		ATLTRACE(_T("CButtonExCancel::CButtonExCancel()\n"));
	}

	~CButtonExCancel()
	{
		ATLTRACE(_T("CButtonExCancel::~CButtonExCancel()\n"));
	}

	BEGIN_MSG_MAP(CButtonExCancel)
		MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)
		MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)
		DEFAULT_REFLECTION_HANDLER()
	END_MSG_MAP()

	BOOL PreTranslateMessage(MSG* pMsg)
	{
		return FALSE;
	}

	// Handles clicking on 'Cancel' button
	LRESULT OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
	{
		// Close the search dialog
		// Can't use SendMessage(), because by the time SendMessage() returns
		// object's gone
		::PostMessage(GetParent(), WM_CLOSE, 0, 0);
		return 0;
	}

	// Handles pressing the 'Enter' key when 'Cancel' button has a focus
	LRESULT OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
	{
		// Close the search dialog
		// Can't use SendMessage(), because by the time SendMessage() returns
		// object's gone
		::PostMessage(GetParent(), WM_CLOSE, 0, 0);
		return 0;
	}
};

class CButtonExFind : public CWindowImpl<CButtonExFind, CButton>
{
public:
	CButtonExFind()
	{
		ATLTRACE(_T("CButtonExFind::CButtonExFind()\n"));
	}

	~CButtonExFind()
	{
		ATLTRACE(_T("CButtonExFind::~CButtonExFind()\n"));
	}

	BEGIN_MSG_MAP(CButtonExFind)
		MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)
		MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)
		DEFAULT_REFLECTION_HANDLER()
	END_MSG_MAP()

	BOOL PreTranslateMessage(MSG* pMsg)
	{
		return FALSE;
	}

	// Handles clicking on 'Find' button
	LRESULT OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
	{
		// Do a search
		::SendMessage(GetParent(), WMU_FINDNOTE, 0, 0);
		return 0;
	}

	// Handles pressing the 'Enter' key when 'Find' button has a focus
	LRESULT OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
	{
		// Do a search
		::SendMessage(GetParent(), WMU_FINDNOTE, 0, 0);
		return 0;
	}
};

class CButtonExNew : public CWindowImpl<CButtonExNew, CButton>
{
public:
	BEGIN_MSG_MAP(CButtonExNew)
		MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)
		MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)
		DEFAULT_REFLECTION_HANDLER()
	END_MSG_MAP()

	BOOL PreTranslateMessage(MSG* pMsg)
	{
		return FALSE;
	}

	// Handles clicking on 'New note' button
	LRESULT OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
	{
		// Send a message to create a new Note dialog
		::SendMessage(GetParent(), WMU_NEWNOTE, 0, 0);
		return 0;
	}

	// Handles pressing the 'Enter' key when 'New Note' button has a focus
	LRESULT OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
	{
		// Send a message to create a new Note dialog
		::SendMessage(GetParent(), WMU_NEWNOTE, 0, 0);
		return 0;
	}
};

/************************************************************************/
#endif // __ATLBTN_H__


text:
__author__ = "Andrea Biancini"
__date__ = "October 2, 2013"

import requests
import json

from datetime import datetime

from backend import Backend, BackendError
from ..secrets import es_server

class ElasticSearchBackend(Backend):
  def __init__(self, engine_config):
    Backend.__init__(self, engine_config)

  def BulkInsertTweetIntoDb(self, vals):
    max_tweetid = None
    min_tweetid = None
    inserted = 0

    if vals is None or len(vals) == 0:
      self.logger.info("Asked to bulk insert 0 tweets.")
      return [inserted, max_tweetid, min_tweetid]

    try:
      bulk_uploads = ""

      for val in vals:
        bulk_uploads += '{ "index" : { "_index" : "twitter", "_type" : "tweets", "_id" : "%s" } }\n' % val['id']

        data = {}
        data['created_at'] = val['created_at']
        data['text'] = val['text']
        data['userid'] = val['userid']
        # data['hashtags'] = val['hashtags']
        data['location'] = val['location']
        data['num_friends'] = val['num_friends']

        if val['latitude'] == 'NULL' or val['longitude'] == 'NULL':
          data['coordinates'] = None
        else:
          data['coordinates'] = "%s,%s" % (val['latitude'], val['longitude'])

        bulk_uploads += json.dumps(data) + "\n"

      host = "%s/_bulk" % es_server
      req = requests.put(host, data=bulk_uploads)
      ret = json.loads(req.content)

      for item in ret["items"]:
        if item["index"]["ok"]:
          inserted += 1
          if max_tweetid is None or max_tweetid < long(item["index"]['_id']):
            max_tweetid = long(item["index"]['_id'])
          if min_tweetid is None or min_tweetid > long(item["index"]['_id']):
            min_tweetid = long(item["index"]['_id'])
        else:
          self.logger.error("Bulk insert not ok for tweet: " % item["index"]["_id"])

      if max_tweetid is None or min_tweetid is None:
        self.logger.error("Unexpected max_tweetid or min_tweetid is None.")
        raise Exception()

    except Exception as e:
      self.logger.error("Exception while bulk inserting tweets: %s" % e)
      if max_tweetid is None or min_tweetid is None: raise e

    return [inserted, max_tweetid, min_tweetid]

  def InsertTweetIntoDb(self, vals):
    try:
      if vals is None: return 0

      host = "%s/twitter/tweets/%s" % (es_server, vals['id'])
      present = requests.head(host)
      if int(present.status_code) != 404:
        self.logger.debug("HEAD returned %s" % present.status_code)
        return 0

      data = {}
      data['created_at'] = vals['created_at']
      data['text'] = vals['text']
      data['userid'] = vals['userid']
      # data['hashtags'] = vals['hashtags']
      data['location'] = vals['location']
      data['num_friends'] = vals['num_friends']

      if vals['latitude'] == 'NULL' or vals['longitude'] == 'NULL':
        data['coordinates'] = None
      else:
        data['coordinates'] = "%s,%s" % (vals['latitude'], vals['longitude'])

      data_json = json.dumps(data, indent=2)
      req = requests.put(host, data=data_json)
      ret = json.loads(req.content)

      if not ret["ok"]: raise BackendError("Insert not ok")
      if ret["_version"] > 1: raise BackendError("Tweet already present in the DB.")
      return 1
    except Exception as e:
      self.logger.error("Exception while inserting tweet %s: %s" % (vals['id'], e))
      return 0

  def DeleteTweetFromDb(self, tweet_id):
    if tweet_id is None: raise BackendError("Wrong tweet id = %s" % tweet_id)

    try:
      host = "%s/twitter/tweets/%s" % (es_server, tweet_id)
      present = requests.head(host)
      if int(present.status_code) == 404:
        self.logger.debug("HEAD returned %s" % present.status_code)
        raise BackendError("Tweet not present in DB, id = %s" % tweet_id)

      req = requests.delete(host)
      ret = json.loads(req.content)

      if not ret["ok"]: raise BackendError("Delete not ok")
    except Exception as e:
      raise BackendError("Exception while deleting tweet %s: %s" % (tweet_id, e))

  def GetUSAKmls(self):
    self.logger.info("Retrieving all USA states")
    try:
      start = 0
      pagesize = 10
      last = None

      rows = []
      while True:
        data = { 'query' : { 'match_all' : { } },
                 'from' : start,
                 'size' : pagesize }
        data_json = json.dumps(data, indent=2)
        host = "%s/twitter/usa_states/_search" % es_server
        req = requests.get(host, data=data_json)
        ret = json.loads(req.content)

        for hit in ret['hits']['hits']:
          curhit = []
          if 'name' in hit['_source'] and 'geometry' in hit['_source']:
            curhit.append(hit['_source']['name'].replace('\\\'', '\''))
            curhit.append(hit['_source']['geometry'].replace('\\\'', '\''))
            rows.append(curhit)

        last = ret['hits']['total']
        start += pagesize
        if start > last: break

      return rows
    except Exception as e:
      raise BackendError("Error while retrieving USA kmls from ElasticSearch: %s" % e)

  def GetFrenchKmls(self):
    self.logger.info("Retrieving all French departments")
    try:
      start = 0
      pagesize = 10
      last = None

      rows = []
      while True:
        data = { 'query' : { 'match_all' : { } },
                 'from' : start,
                 'size' : pagesize }
        data_json = json.dumps(data, indent=2)
        host = "%s/twitter/french_depts/_search" % es_server
        req = requests.get(host, data=data_json)
        ret = json.loads(req.content)

        for hit in ret['hits']['hits']:
          curhit = []
          if 'NOM_REG' in hit['_source'] and 'KML' in hit['_source']:
            curhit.append(hit['_source']['NOM_REG'].replace('\\\'', '\''))
            curhit.append(hit['_source']['KML'].replace('\\\'', '\''))
            rows.append(curhit)

        last = ret['hits']['total']
        start += pagesize
        if start > last: break

      return rows
    except Exception as e:
      raise BackendError("Error while retrieving French kmls from ElasticSearch: %s" % e)

  def GetMaxId(self):
    self.logger.info("Retrieving max tweet id from database.")
    try:
      data = { 'query' : { 'match_all' : { } },
               'sort' : { '_id' : 'desc' },
               'size' : 1 }
      data_json = json.dumps(data, indent=2)
      host = "%s/twitter/tweets/_search" % es_server
      req = requests.get(host, data=data_json)
      ret = json.loads(req.content)

      hit = ret['hits']['hits'][0]
      return long(hit['_id'])
    except Exception as e:
      raise BackendError("Error while retrieving max tweet id from ElasticSearch: %s" % e)

  def _GetOldTweets(self, max_date):
    try:
      start = 0
      pagesize = 1000
      last = None

      hits = []
      while True:
        data = { 'query' : { 'filtered' : { 'query' : { 'match_all' : { } },
                                            'filter' : { 'range' : { 'created_at' : { 'to' : max_date.strftime('%Y-%m-%d %H:%M:%S') } } } } },
                 'from' : start,
                 'size' : pagesize }
        data_json = json.dumps(data, indent=2)
        host = "%s/twitter/tweets/_search" % es_server
        req = requests.get(host, data=data_json)
        ret = json.loads(req.content)

        for hit in ret['hits']['hits']:
          hits.append(hit['_id'])

        last = ret['hits']['total']
        start += pagesize
        if start > last: break

      return hits
    except Exception as e:
      raise BackendError("Error while retrieving old tweets from ElasticSearch: %s" % e)

  def RemoveOldTweets(self, max_date, execute):
    print("%s all tweets older than max_date = %s." % ("Deleting" if execute else "Evaluating delete of", max_date))

    hits_id = self._GetOldTweets(max_date)
    print("Old tweets that should be removed are: %s." % len(hits_id))

    if execute:
      deleted = 0
      for tweet_id in hits_id:
        try:
          self.DeleteTweetFromDb(tweet_id)
          deleted += 1
        except Exception as e:
          print("Error while deleting tweet with id = %s: %s." % (tweet_id, e))
      print("Deleted %s tweets." % deleted)
    else:
      print("If this query is good, you can delete tweets by calling this same command with -e flag.")

  def GetAllTweetCoordinates(self):
    try:
      start = 0
      pagesize = 10
      last = None

      tweets = []
      while True:
        data = { 'query'  : { 'match_all' : { } },
                 'from'   : start,
                 'size'   : pagesize,
                 'fields' : ['coordinates', 'created_at'],
                 'sort'   : [ { 'created_at' : 'asc' } ] }
        data_json = json.dumps(data, indent=2)
        host = "%s/twitter/tweets/_search" % es_server
        req = requests.get(host, data=data_json)
        ret = json.loads(req.content)

        for hit in ret['hits']['hits']:
          curhit = []
          if 'created_at' in hit['fields'] and 'coordinates' in hit['fields']:
            created_at = datetime.strptime(hit['fields']['created_at'], '%Y-%m-%d %H:%M:%S')
            curhit.append(created_at)
            coordinates = hit['fields']['coordinates']
            if ',' in coordinates:
              curhit.append(coordinates.split(',')[1])
              curhit.append(coordinates.split(',')[0])
            else:
              curhit.append(None)
              curhit.append(None)
            tweets.append(curhit)
            self.logger.debug("new google.maps.LatLng(%s, %s)," % (curhit[2], curhit[1]))

        last = ret['hits']['total']
        start += pagesize
        if start > last: break

      return tweets
    except Exception as e:
      raise BackendError("Error while retrieving tweet coordinates from ElasticSearch: %s" % e)

  def GetLocations(self):
    try:
      data = { 'size'   : 0,
               'facets' : { 'locations': { 'terms' : { 'field' : 'location', 'size' : 20 }, 'global': True } } }
      data_json = json.dumps(data, indent=2)
      host = "%s/twitter/tweets/_search" % es_server
      req = requests.get(host, data=data_json)
      ret = json.loads(req.content)

      locations = []
      for hit in ret['facets']['locations']['terms']:
        locations.append(hit['term'])

      return locations
    except Exception as e:
      raise BackendError("Error while retrieving locations from ElasticSearch: %s" % e)

  def _GetTweetsIdForLocation(self, location):
    try:
      start = 0
      pagesize = 10
      last = None

      rows = []
      while True:
        data = { 'query' : { "term": { "location" : location } },
                 'fields' : [ ],
                 'from'  : start,
                 'size'  : pagesize }
        data_json = json.dumps(data, indent=2)
        host = "%s/twitter/tweets/_search" % es_server
        req = requests.get(host, data=data_json)
        ret = json.loads(req.content)

        for hit in ret['hits']['hits']:
          if '_id' in hit:
            rows.append(hit['_id'])

        last = ret['hits']['total']
        start += pagesize
        if start > last: break

      return rows
    except Exception as e:
      raise BackendError("Error while retrieving kmls from ElasticSearch: %s" % e)

  def UpdateCoordinates(self, location, lat, lng):
    self.logger.info("Updating coordinate for location %s: [%s, %s]." % (location, lat, lng))
    try:
      tweetids = self._GetTweetsIdForLocation(location)

      for tweetid in tweetids:
        data = { 'script' : 'ctx._source.coordinates = newcoords',
                 'params' : { 'newcoords' : "%s,%s" % (lat, lng) } }
        data_json = json.dumps(data, indent=2)
        host = "%s/twitter/tweets/%s/_update" % (es_server, tweetid)
        req = requests.post(host, data=data_json)
        ret = json.loads(req.content)
        if not ret["ok"]: raise Exception("Insert not ok")
    except Exception as e:
      raise BackendError("Error while updating coordinates for location into ElasticSearch: %s" % e)

  def InsertUSAStates(self, vals):
    self.logger.info("Inserting row for %s (%s)." % (vals[0], vals[1]))
    try:
      data = { 'name'     : vals[0],
               'id'       : vals[1],
               'geometry' : vals[2] }

      data_json = json.dumps(data, indent=2)
      host = "%s/twitter/usa_states/%s" % (es_server, vals[0])
      req = requests.put(host, data=data_json)
      ret = json.loads(req.content)
      if not ret["ok"]: raise BackendError("Insert not ok")
    except Exception as e:
      raise BackendError("Error while inserting USA State into ElasticSearch: %s" % e)

  def InsertFrenchDepartments(self, vals):
    self.logger.info("Inserting row for %s, %s." % (vals[2], vals[6]))
    try:
      data = { 'ID_GEOFLA' : vals[0],
               'CODE_DEPT' : vals[1],
               'NOM_DEPT'  : vals[2],
               'CODE_CHF'  : vals[3],
               'NOM_CHF'   : vals[4],
               'CODE_REG'  : vals[5],
               'NOM_REG'   : vals[6],
               'KML'       : vals[7] }
      data_json = json.dumps(data, indent=2)
      host = "%s/twitter/french_depts/%s" % (es_server, vals[0])
      req = requests.put(host, data=data_json)
      ret = json.loads(req.content)
      if not ret["ok"]: raise BackendError("Insert not ok")
    except Exception as e:
      raise BackendError("Error while inserting French department into ElasticSearch: %s" % e)


text:
Dialog tag for modal

https://scotch.io/bar-talk/build-native-web-modals-using-the-dialog-element222


text:
<?xml version="1.0" encoding="utf-8"?>
<scale  xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/accelerate_decelerate_interpolator"
    android:fromXScale="1.1"
    android:fromYScale="1.1"
    android:toXScale="1"
    android:toYScale="1"
    android:fillAfter="true"
    android:pivotX="50%"
    android:pivotY="100%"
    android:duration="300">

</scale>