text:
#ifndef __LWIP_SYS_H__
#define __LWIP_SYS_H__

#include "lwip/opt.h"

#ifdef __cplusplus
extern "C" {
#endif

#if NO_SYS

/* For a totally minimal and standalone system, we provide null
   definitions of the sys_ functions. */
typedef u8_t sys_sem_t;
typedef u8_t sys_mutex_t;
typedef u8_t sys_mbox_t;

#define sys_sem_new(s, c) ERR_OK
#define sys_sem_signal(s)
#define sys_sem_wait(s)
#define sys_arch_sem_wait(s,t)
#define sys_sem_free(s)
#define sys_sem_valid(s) 0
#define sys_sem_set_invalid(s)
#define sys_mutex_new(mu) ERR_OK
#define sys_mutex_lock(mu)
#define sys_mutex_unlock(mu)
#define sys_mutex_free(mu)
#define sys_mutex_valid(mu) 0
#define sys_mutex_set_invalid(mu)
#define sys_mbox_new(m, s) ERR_OK
#define sys_mbox_fetch(m,d)
#define sys_mbox_tryfetch(m,d)
#define sys_mbox_post(m,d)
#define sys_mbox_trypost(m,d)
#define sys_mbox_free(m)
#define sys_mbox_valid(m)
#define sys_mbox_set_invalid(m)

#define sys_thread_new(n,t,a,s,p)

#define sys_msleep(t)

#else /* NO_SYS */

/** Return code for timeouts from sys_arch_mbox_fetch and sys_arch_sem_wait */
#define SYS_ARCH_TIMEOUT 0xffffffffUL

/** sys_mbox_tryfetch() returns SYS_MBOX_EMPTY if appropriate.
 * For now we use the same magic value, but we allow this to change in future.
 */
#define SYS_MBOX_EMPTY SYS_ARCH_TIMEOUT

#include "lwip/err.h"
#include "arch/sys_arch.h"

/** Function prototype for thread functions */
typedef void (*lwip_thread_fn)(void *arg);

/* Function prototypes for functions to be implemented by platform ports
   (in sys_arch.c) */

/* Mutex functions: */

/** Define LWIP_COMPAT_MUTEX if the port has no mutexes and binary semaphores
    should be used instead */
#if LWIP_COMPAT_MUTEX
/* for old ports that don't have mutexes: define them to binary semaphores */
#define sys_mutex_t                   sys_sem_t
#define sys_mutex_new(mutex)          sys_sem_new(mutex, 1)
#define sys_mutex_lock(mutex)         sys_sem_wait(mutex)
#define sys_mutex_unlock(mutex)       sys_sem_signal(mutex)
#define sys_mutex_free(mutex)         sys_sem_free(mutex)
#define sys_mutex_valid(mutex)        sys_sem_valid(mutex)
#define sys_mutex_set_invalid(mutex)  sys_sem_set_invalid(mutex)

#else /* LWIP_COMPAT_MUTEX */

/** Create a new mutex
 * @param mutex pointer to the mutex to create
 * @return a new mutex */
err_t sys_mutex_new(sys_mutex_t *mutex);
/** Lock a mutex
 * @param mutex the mutex to lock */
void sys_mutex_lock(sys_mutex_t *mutex);
/** Unlock a mutex
 * @param mutex the mutex to unlock */
void sys_mutex_unlock(sys_mutex_t *mutex);
/** Delete a semaphore
 * @param mutex the mutex to delete */
void sys_mutex_free(sys_mutex_t *mutex);
#ifndef sys_mutex_valid
/** Check if a mutex is valid/allocated: return 1 for valid, 0 for invalid */
int sys_mutex_valid(sys_mutex_t *mutex);
#endif
#ifndef sys_mutex_set_invalid
/** Set a mutex invalid so that sys_mutex_valid returns 0 */
void sys_mutex_set_invalid(sys_mutex_t *mutex);
#endif
#endif /* LWIP_COMPAT_MUTEX */

/* Semaphore functions: */

/** Create a new semaphore
 * @param sem pointer to the semaphore to create
 * @param count initial count of the semaphore
 * @return ERR_OK if successful, another err_t otherwise */
err_t sys_sem_new(sys_sem_t *sem, u8_t count);
/** Signals a semaphore
 * @param sem the semaphore to signal */
void sys_sem_signal(sys_sem_t *sem);
/** Wait for a semaphore for the specified timeout
 * @param sem the semaphore to wait for
 * @param timeout timeout in milliseconds to wait (0 = wait forever)
 * @return time (in milliseconds) waited for the semaphore
 *         or SYS_ARCH_TIMEOUT on timeout */
u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout);
/** Delete a semaphore
 * @param sem semaphore to delete */
void sys_sem_free(sys_sem_t *sem);
/** Wait for a semaphore - forever/no timeout */
#define sys_sem_wait(sem)                  sys_arch_sem_wait(sem, 0)
#ifndef sys_sem_valid
/** Check if a sempahore is valid/allocated: return 1 for valid, 0 for invalid */
int sys_sem_valid(sys_sem_t *sem);
#endif
#ifndef sys_sem_set_invalid
/** Set a semaphore invalid so that sys_sem_valid returns 0 */
void sys_sem_set_invalid(sys_sem_t *sem);
#endif

/* Time functions. */
#ifndef sys_msleep
void sys_msleep(u32_t ms); /* only has a (close to) 1 jiffy resolution. */
#endif

/* Mailbox functions. */

/** Create a new mbox of specified size
 * @param mbox pointer to the mbox to create
 * @param size (miminum) number of messages in this mbox
 * @return ERR_OK if successful, another err_t otherwise */
err_t sys_mbox_new(sys_mbox_t *mbox, int size);
/** Post a message to an mbox - may not fail
 * -> blocks if full, only used from tasks not from ISR
 * @param mbox mbox to posts the message
 * @param msg message to post (ATTENTION: can be NULL) */
void sys_mbox_post(sys_mbox_t *mbox, void *msg);
/** Try to post a message to an mbox - may fail if full or ISR
 * @param mbox mbox to posts the message
 * @param msg message to post (ATTENTION: can be NULL) */
err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg);
/** Wait for a new message to arrive in the mbox
 * @param mbox mbox to get a message from
 * @param msg pointer where the message is stored
 * @param timeout maximum time (in milliseconds) to wait for a message (0 = wait forever)
 * @return time (in milliseconds) waited for a message, may be 0 if not waited
           or SYS_ARCH_TIMEOUT on timeout
 *         The returned time has to be accurate to prevent timer jitter! */
u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout);
/* Allow port to override with a macro, e.g. special timout for sys_arch_mbox_fetch() */
#ifndef sys_arch_mbox_tryfetch
/** Wait for a new message to arrive in the mbox
 * @param mbox mbox to get a message from
 * @param msg pointer where the message is stored
 * @return 0 (milliseconds) if a message has been received
 *         or SYS_MBOX_EMPTY if the mailbox is empty */
u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg);
#endif
/** For now, we map straight to sys_arch implementation. */
#define sys_mbox_tryfetch(mbox, msg) sys_arch_mbox_tryfetch(mbox, msg)
/** Delete an mbox
 * @param mbox mbox to delete */
void sys_mbox_free(sys_mbox_t *mbox);
#define sys_mbox_fetch(mbox, msg) sys_arch_mbox_fetch(mbox, msg, 0)
#ifndef sys_mbox_valid
/** Check if an mbox is valid/allocated: return 1 for valid, 0 for invalid */
int sys_mbox_valid(sys_mbox_t *mbox);
#endif
#ifndef sys_mbox_set_invalid
/** Set an mbox invalid so that sys_mbox_valid returns 0 */
void sys_mbox_set_invalid(sys_mbox_t *mbox);
#endif

/** The only thread function:
 * Creates a new thread
 * @param name human-readable name for the thread (used for debugging purposes)
 * @param thread thread-function
 * @param arg parameter passed to 'thread'
 * @param stacksize stack size in bytes for the new thread (may be ignored by ports)
 * @param prio priority of the new thread (may be ignored by ports) */
sys_thread_t sys_thread_new(const char *name, lwip_thread_fn thread, void *arg, int stacksize, int prio);

#endif /* NO_SYS */

/* sys_init() must be called before anthing else. */
void sys_init(void);

#ifndef sys_jiffies
/** Ticks/jiffies since power up. */
u32_t sys_jiffies(void);
#endif

/** Returns the current time in milliseconds,
 * may be the same as sys_jiffies or at least based on it. */
u32_t sys_now(void);

/* Critical Region Protection */
/* These functions must be implemented in the sys_arch.c file.
   In some implementations they can provide a more light-weight protection
   mechanism than using semaphores. Otherwise semaphores can be used for
   implementation */
#ifndef SYS_ARCH_PROTECT
/** SYS_LIGHTWEIGHT_PROT
 * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection
 * for certain critical regions during buffer allocation, deallocation and memory
 * allocation and deallocation.
 */
#if SYS_LIGHTWEIGHT_PROT

/** SYS_ARCH_DECL_PROTECT
 * declare a protection variable. This macro will default to defining a variable of
 * type sys_prot_t. If a particular port needs a different implementation, then
 * this macro may be defined in sys_arch.h.
 */
#define SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev
/** SYS_ARCH_PROTECT
 * Perform a "fast" protect. This could be implemented by
 * disabling interrupts for an embedded system or by using a semaphore or
 * mutex. The implementation should allow calling SYS_ARCH_PROTECT when
 * already protected. The old protection level is returned in the variable
 * "lev". This macro will default to calling the sys_arch_protect() function
 * which should be implemented in sys_arch.c. If a particular port needs a
 * different implementation, then this macro may be defined in sys_arch.h
 */
#define SYS_ARCH_PROTECT(lev) lev = sys_arch_protect()
/** SYS_ARCH_UNPROTECT
 * Perform a "fast" set of the protection level to "lev". This could be
 * implemented by setting the interrupt level to "lev" within the MACRO or by
 * using a semaphore or mutex.  This macro will default to calling the
 * sys_arch_unprotect() function which should be implemented in
 * sys_arch.c. If a particular port needs a different implementation, then
 * this macro may be defined in sys_arch.h
 */
#define SYS_ARCH_UNPROTECT(lev) sys_arch_unprotect(lev)
sys_prot_t sys_arch_protect(void);
void sys_arch_unprotect(sys_prot_t pval);

#else

#define SYS_ARCH_DECL_PROTECT(lev)
#define SYS_ARCH_PROTECT(lev)
#define SYS_ARCH_UNPROTECT(lev)

#endif /* SYS_LIGHTWEIGHT_PROT */

#endif /* SYS_ARCH_PROTECT */

/*
 * Macros to set/get and increase/decrease variables in a thread-safe way.
 * Use these for accessing variable that are used from more than one thread.
 */

#ifndef SYS_ARCH_INC
#define SYS_ARCH_INC(var, val) do { \
                                SYS_ARCH_DECL_PROTECT(old_level); \
                                SYS_ARCH_PROTECT(old_level); \
                                var += val; \
                                SYS_ARCH_UNPROTECT(old_level); \
                              } while(0)
#endif /* SYS_ARCH_INC */

#ifndef SYS_ARCH_DEC
#define SYS_ARCH_DEC(var, val) do { \
                                SYS_ARCH_DECL_PROTECT(old_level); \
                                SYS_ARCH_PROTECT(old_level); \
                                var -= val; \
                                SYS_ARCH_UNPROTECT(old_level); \
                              } while(0)
#endif /* SYS_ARCH_DEC */

#ifndef SYS_ARCH_GET
#define SYS_ARCH_GET(var, ret) do { \
                                SYS_ARCH_DECL_PROTECT(old_level); \
                                SYS_ARCH_PROTECT(old_level); \
                                ret = var; \
                                SYS_ARCH_UNPROTECT(old_level); \
                              } while(0)
#endif /* SYS_ARCH_GET */

#ifndef SYS_ARCH_SET
#define SYS_ARCH_SET(var, val) do { \
                                SYS_ARCH_DECL_PROTECT(old_level); \
                                SYS_ARCH_PROTECT(old_level); \
                                var = val; \
                                SYS_ARCH_UNPROTECT(old_level); \
                              } while(0)
#endif /* SYS_ARCH_SET */

#ifdef __cplusplus
}
#endif

#endif /* __LWIP_SYS_H__ */


text:
#ifndef VICE_IEEE_CMDLINE_OPTIONS_H
#define VICE_IEEE_CMDLINE_OPTIONS_H

extern int ieee_cmdline_options_init(void);

#endif

redpajama_set_name: RedPajamaGithub


text:
DROP SEQUENCE IF EXISTS "SEQ_CAR";
CREATE SEQUENCE  "SEQ_CAR" INCREMENT BY 1 START WITH 108921 CACHE 20;


text:
require 'nokogiri'
require 'open-uri'

module Widgetify

  class ImageInfo

    def initialize(html_doc)
      @img_doc = html_doc.xpath("//img")
      @image = []
    end

    def look_for_images
      image = []
      @img_doc.each do |attr|
        img_hash = { }
        img_hash["src"] = attr.get_attribute("src")
        img_hash["width"] = attr.get_attribute("width")
        img_hash["height"] = attr.get_attribute("height")
        img_hash["alt"] = attr.get_attribute("alt")
        img_hash["align"] = attr.get_attribute("align")
        img_hash["class"] = attr.get_attribute("class")
        img_hash["id"] = attr.get_attribute("id")
        img_hash["lang"] = attr.get_attribute("lang")
        img_hash["style"] = attr.get_attribute("style")
        img_hash["title"] = attr.get_attribute("title")
        image << img_hash
      end
      image
    end
  end
end


text:
from typing import Optional, Union, TypeVar
import os
import re
import configparser
import warnings

from pathlib import Path

user_config = None

def xdg_config_home() -> Path:
    value = os.environ.get('XDG_CONFIG_HOME')
    if value is None:
        return Path(Path.home(), ".config")
    return Path(value)

def get_user_config_path() -> Path:
    return Path(xdg_config_home(), 'hail', 'config.ini')

def get_user_config() -> configparser.ConfigParser:
    global user_config
    if user_config is None:
        user_config = configparser.ConfigParser()
        config_file = get_user_config_path()
        # in older versions, the config file was accidentally named
        # config.yaml, if the new config does not exist, and the old
        # one does, silently rename it
        old_path = config_file.with_name('config.yaml')
        if old_path.exists() and not config_file.exists():
            old_path.rename(config_file)
        user_config.read(config_file)
    return user_config

VALID_SECTION_AND_OPTION_RE = re.compile('[a-z0-9_]+')
T = TypeVar('T')

def configuration_of(section: str, option: str, explicit_argument: Optional[str], fallback: T) -> Union[str, T]:
    assert VALID_SECTION_AND_OPTION_RE.fullmatch(section), (section, option)
    assert VALID_SECTION_AND_OPTION_RE.fullmatch(option), (section, option)

    if explicit_argument is not None:
        return explicit_argument

    envval = os.environ.get('HAIL_' + section.upper() + '_' + option.upper(), None)
    if envval is not None:
        return envval

    from_user_config = get_user_config().get(section, option, fallback=None)
    if from_user_config is not None:
        return from_user_config

    return fallback

def get_remote_tmpdir(caller_name: str,
                      *,
                      bucket: Optional[str] = None,
                      remote_tmpdir: Optional[str] = None,
                      user_config: Optional[configparser.ConfigParser] = None,
                      warnings_stacklevel: int = 2,
                      ) -> str:
    if user_config is None:
        user_config = get_user_config()

    if bucket is not None:
        warnings.warn(f'Use of deprecated argument \'bucket\' in {caller_name}(...). Specify \'remote_tmpdir\' as a keyword argument instead.',
                      stacklevel=warnings_stacklevel)

    if remote_tmpdir is not None and bucket is not None:
        raise ValueError(f'Cannot specify both \'remote_tmpdir\' and \'bucket\' in {caller_name}(...). Specify \'remote_tmpdir\' as a keyword argument instead.')

    if bucket is None and remote_tmpdir is None:
        remote_tmpdir = configuration_of('batch', 'remote_tmpdir', None, None)

    if remote_tmpdir is None:
        if bucket is None:
            bucket = user_config.get('batch', 'bucket', fallback=None)
            warnings.warn('Using deprecated configuration setting \'batch/bucket\'. Run `hailctl config set batch/remote_tmpdir` '
                          'to set the default for \'remote_tmpdir\' instead.',
                          stacklevel=warnings_stacklevel)
        if bucket is None:
            raise ValueError(
                f'Either the \'remote_tmpdir\' parameter of {caller_name}(...) must be set or you must '
                'run `hailctl config set batch/remote_tmpdir REMOTE_TMPDIR`.')
        if 'gs://' in bucket:
            raise ValueError(
                f'The bucket parameter to {caller_name}(...) and the `batch/bucket` hailctl config setting '
                'must both be bucket names, not paths. Use the remote_tmpdir parameter or batch/remote_tmpdir '
                'hailctl config setting instead to specify a path.')
        remote_tmpdir = f'gs://{bucket}/batch'
    else:
        schemes = {'gs', 'hail-az'}
        found_scheme = any(remote_tmpdir.startswith(f'{scheme}://') for scheme in schemes)
        if not found_scheme:
            raise ValueError(
                f'remote_tmpdir must be a storage uri path like gs://bucket/folder. Received: {remote_tmpdir}. Possible schemes include {schemes}')
    if remote_tmpdir[-1] != '/':
        remote_tmpdir += '/'
    return remote_tmpdir


text:
import {Component} from '@angular/core';

import {NavbarComponent} from './navbar/navbar.component';

@Component({
    selector: 'app',
    template: `hello world`,
    directives: [ NavbarComponent]
})

export class AppComponent {

}


text:
from django.db import models
from django.utils.encoding import force_text, python_2_unicode_compatible

from reversion.models import Revision

@python_2_unicode_compatible
class ReversionTestModelBase(models.Model):

    name = models.CharField(
        max_length = 100,
    )

    def __str__(self):
        return self.name

    class Meta:
        abstract = True

class ReversionTestModel1(ReversionTestModelBase):

    pass

str_pk_gen = 0;

def get_str_pk():
    global str_pk_gen
    str_pk_gen += 1;
    return force_text(str_pk_gen)

class ReversionTestModel2(ReversionTestModelBase):

    id = models.CharField(
        primary_key = True,
        max_length = 100,
        default = get_str_pk
    )

class TestFollowModel(ReversionTestModelBase):

    test_model_1 = models.ForeignKey(
        ReversionTestModel1,
    )

    test_model_2s = models.ManyToManyField(
        ReversionTestModel2,
    )

class ReversionTestModel1Proxy(ReversionTestModel1):

    class Meta:
        proxy = True

class RevisionMeta(models.Model):

    revision = models.OneToOneField(Revision)

    age = models.IntegerField()

# Admin test models.

class ParentTestAdminModel(models.Model):

    parent_name = models.CharField(
        max_length = 200,
    )

@python_2_unicode_compatible
class ChildTestAdminModel(ParentTestAdminModel):

    child_name = models.CharField(
        max_length = 200,
    )

    def __str__(self):
        return self.child_name

class InlineTestParentModel(models.Model):

    name = models.CharField(
        max_length = 100,
    )

    def __str__(self):
        return self.name

class InlineTestChildModel(models.Model):

    parent = models.ForeignKey(
        InlineTestParentModel,
        related_name = "children",
    )

    name = models.CharField(
        max_length = 100,
    )

    def __str__(self):
        return self.name

# Test that reversion handles unrelated inlines.
# Issue https://github.com/etianen/django-reversion/issues/277
class InlineTestUnrelatedParentModel(models.Model):

    pass

class InlineTestUnrelatedChildModel(models.Model):

    pass


text:
package de.crispda.sola.multitester.scenario;

import de.crispda.sola.multitester.Test;
import de.crispda.sola.multitester.web.WebActions;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;

import java.util.List;

public class GDocsTestWriteFirstLine extends Test {
    @Override
    public void test() throws Exception {
        final GDocs gDocs = new GDocs(driver);
        gDocs.hideCursor();
        maybeWait();
        List<WebElement> lines = driver.findElements(
                By.className(GDocs.lineClass));
        WebElement secondLine = lines.get(1);
        WebActions.click(secondLine);
        gDocs.sendKeys(Keys.END, "ing");
        Thread.sleep(10000);
        maybeWait();
    }

    @Override
    public int getMaybeWaitCount() {
        return 2;
    }

    @Override
    public String getInitialURL() {
        return GDocs.url;
    }
}


text:
/*
 * Do not modify this file. This file is generated from the workspaces-2015-04-08.normal.json service model.
 */
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;

using Amazon.WorkSpaces.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;

namespace Amazon.WorkSpaces.Model.Internal.MarshallTransformations
{
    /// <summary>
    /// Response Unmarshaller for RebootWorkspaces operation
    /// </summary>
    public class RebootWorkspacesResponseUnmarshaller : JsonResponseUnmarshaller
    {
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            RebootWorkspacesResponse response = new RebootWorkspacesResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;
            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("FailedRequests", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller<FailedWorkspaceChangeRequest, FailedWorkspaceChangeRequestUnmarshaller>(FailedWorkspaceChangeRequestUnmarshaller.Instance);
                    response.FailedRequests = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return response;
        }

        /// <summary>
        /// Unmarshaller error response to exception.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="innerException"></param>
        /// <param name="statusCode"></param>
        /// <returns></returns>
        public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
        {
            ErrorResponse errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
            return new AmazonWorkSpacesException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
        }

        private static RebootWorkspacesResponseUnmarshaller _instance = new RebootWorkspacesResponseUnmarshaller();

        internal static RebootWorkspacesResponseUnmarshaller GetInstance()
        {
            return _instance;
        }

        /// <summary>
        /// Gets the singleton.
        /// </summary>
        public static RebootWorkspacesResponseUnmarshaller Instance
        {
            get
            {
                return _instance;
            }
        }

    }
}


text:
.. _topics-broad-crawls:

============
Broad Crawls
============

Scrapy defaults are optimized for crawling specific sites. These sites are
often handled by a single Scrapy spider, although this is not necessary or
required (for example, there are generic spiders that handle any given site
thrown at them).

In addition to this "focused crawl", there is another common type of crawling
which covers a large (potentially unlimited) number of domains, and is only
limited by time or other arbitrary constraint, rather than stopping when the
domain was crawled to completion or when there are no more requests to perform.
These are called "broad crawls" and is the typical crawlers employed by search
engines.

These are some common properties often found in broad crawls:

* they crawl many domains (often, unbounded) instead of a specific set of sites

* they don't necessarily crawl domains to completion, because it would
  impractical (or impossible) to do so, and instead limit the crawl by time or
  number of pages crawled

* they are simpler in logic (as opposed to very complex spiders with many
  extraction rules) because data is often post-processed in a separate stage

* they crawl many domains concurrently, which allows them to achieve faster
  crawl speeds by not being limited by any particular site constraint (each site
  is crawled slowly to respect politeness, but many sites are crawled in
  parallel)

As said above, Scrapy default settings are optimized for focused crawls, not
broad crawls. However, due to its asynchronous architecture, Scrapy is very
well suited for performing fast broad crawls. This page summarizes some things
you need to keep in mind when using Scrapy for doing broad crawls, along with
concrete suggestions of Scrapy settings to tune in order to achieve an
efficient broad crawl.

Increase concurrency
====================

Concurrency is the number of requests that are processed in parallel. There is
a global limit and a per-domain limit.

The default global concurrency limit in Scrapy is not suitable for crawling
many different domains in parallel, so you will want to increase it. How much
to increase it will depend on how much CPU you crawler will have available. A
good starting point is ``100``, but the best way to find out is by doing some
trials and identifying at what concurrency your Scrapy process gets CPU
bounded. For optimum performance, you should pick a concurrency where CPU usage
is at 80-90%.

To increase the global concurrency use::

    CONCURRENT_REQUESTS = 100

Increase Twisted IO thread pool maximum size
============================================

Currently Scrapy does DNS resolution in a blocking way with usage of thread
pool. With higher concurrency levels the crawling could be slow or even fail
hitting DNS resolver timeouts. Possible solution to increase the number of
threads handling DNS queries. The DNS queue will be processed faster speeding
up establishing of connection and crawling overall.

To increase maximum thread pool size use::

    REACTOR_THREADPOOL_MAXSIZE = 20

Setup your own DNS
==================

If you have multiple crawling processes and single central DNS, it can act
like DoS attack on the DNS server resulting to slow down of entire network or
even blocking your machines. To avoid this setup your own DNS server with
local cache and upstream to some large DNS like OpenDNS or Verizon.

Reduce log level
================

When doing broad crawls you are often only interested in the crawl rates you
get and any errors found. These stats are reported by Scrapy when using the
``INFO`` log level. In order to save CPU (and log storage requirements) you
should not use ``DEBUG`` log level when preforming large broad crawls in
production. Using ``DEBUG`` level when developing your (broad) crawler may fine
though.

To set the log level use::

    LOG_LEVEL = 'INFO'

Disable cookies
===============

Disable cookies unless you *really* need. Cookies are often not needed when
doing broad crawls (search engine crawlers ignore them), and they improve
performance by saving some CPU cycles and reducing the memory footprint of your
Scrapy crawler.

To disable cookies use::

    COOKIES_ENABLED = False

Disable retries
===============

Retrying failed HTTP requests can slow down the crawls substantially, specially
when sites causes are very slow (or fail) to respond, thus causing a timeout
error which gets retried many times, unnecessarily, preventing crawler capacity
to be reused for other domains.

To disable retries use::

    RETRY_ENABLED = False

Reduce download timeout
=======================

Unless you are crawling from a very slow connection (which shouldn't be the
case for broad crawls) reduce the download timeout so that stuck requests are
discarded quickly and free up capacity to process the next ones.

To reduce the download timeout use::

    DOWNLOAD_TIMEOUT = 15

Disable redirects
=================

Consider disabling redirects, unless you are interested in following them. When
doing broad crawls it's common to save redirects and resolve them when
revisiting the site at a later crawl. This also help to keep the number of
request constant per crawl batch, otherwise redirect loops may cause the
crawler to dedicate too many resources on any specific domain.

To disable redirects use::

    REDIRECT_ENABLED = False

Enable crawling of "Ajax Crawlable Pages"
=========================================

Some pages (up to 1%, based on empirical data from year 2013) declare
themselves as `ajax crawlable`_. This means they provide plain HTML
version of content that is usually available only via AJAX.
Pages can indicate it in two ways:

1) by using ``#!`` in URL - this is the default way;
2) by using a special meta tag - this way is used on
   "main", "index" website pages.

Scrapy handles (1) automatically; to handle (2) enable
:ref:`AjaxCrawlMiddleware <ajaxcrawl-middleware>`::

    AJAXCRAWL_ENABLED = True

When doing broad crawls it's common to crawl a lot of "index" web pages;
AjaxCrawlMiddleware helps to crawl them correctly.
It is turned OFF by default because it has some performance overhead,
and enabling it for focused crawls doesn't make much sense.

.. _ajax crawlable: https://developers.google.com/webmasters/ajax-crawling/docs/getting-started


text:
namespace rc {
namespace detail {

class ValueDescription;

/// Variant class that can hold a value of any type.
class Any {
public:
  /// Constructs a new null `Any`.
  Any() noexcept;

  /// Constructs a new `Any` with the given value.
  template <typename T>
  static Any of(T &&value);

  /// Resets this `Any` to null.
  void reset();

  /// Returns a const reference to the contained value. No type checking is
  /// currently done so be careful!
  template <typename T>
  const T &get() const;

  /// Returns a reference to the contained value. No type checking is currently
  /// done so be careful!
  template <typename T>
  T &get();

  /// Returns a pair of the type name and a string representation of the
  /// value.
  std::pair<std::string, std::string> describe() const;

  /// Returns `true` if this `Any` is non-null.
  explicit operator bool() const;

  Any(Any &&other) noexcept = default;
  Any &operator=(Any &&rhs) noexcept = default;

private:
  class IAnyImpl;

  template <typename T>
  class AnyImpl;

  std::unique_ptr<IAnyImpl> m_impl;
};

std::ostream &operator<<(std::ostream &os, const Any &value);

} // namespace detail
} // namespace rc

#include "Any.hpp"


text:
using Microsoft.WindowsAzure.MobileServices;

namespace Universal.UserInterface.Utilities
{
    public class AzureMobileServiceClient
    {
        public static MobileServiceClient Client = new MobileServiceClient(AzureConfiguration.ApplicationUrl);
    }
}


text:
package edu.uci.ics.crawler4j.frontier;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.sleepycat.je.Cursor;
import com.sleepycat.je.DatabaseEntry;
import com.sleepycat.je.Environment;
import com.sleepycat.je.OperationStatus;
import com.sleepycat.je.Transaction;

import edu.uci.ics.crawler4j.url.WebURL;

/**
 * This class maintains the list of pages which are
 * assigned to crawlers but are not yet processed.
 * It is used for resuming a previous crawl.
 * 维护一个页面列表,页面还没有处理,用来当爬虫意外关闭后恢复爬取用的。
 * @author Yasser Ganjisaffar
 */
public class InProcessPagesDB extends WorkQueues {
    private static final Logger logger = LoggerFactory.getLogger(InProcessPagesDB.class);

    private static final String DATABASE_NAME = "InProcessPagesDB";

    public InProcessPagesDB(Environment env) {
        super(env, DATABASE_NAME, true);
        long docCount = getLength();
        if (docCount > 0) {
            logger.info("Loaded {} URLs that have been in process in the previous crawl.",
                        docCount);
        }
    }

    public boolean removeURL(WebURL webUrl) {
        synchronized (mutex) {
            DatabaseEntry key = getDatabaseEntryKey(webUrl);
            DatabaseEntry value = new DatabaseEntry();
            Transaction txn = beginTransaction();
            try (Cursor cursor = openCursor(txn)) {
                OperationStatus result = cursor.getSearchKey(key, value, null);

                if (result == OperationStatus.SUCCESS) {
                    result = cursor.delete();
                    if (result == OperationStatus.SUCCESS) {
                        return true;
                    }
                }
            } finally {
                commit(txn);
            }
        }
        return false;
    }
}


text:
layout: page
title: Green Swift Software Trade Fair
date: 2016-05-24
author: Jesse Pratt
tags: weekly links, java
status: published
summary: Morbi fringilla tortor ut congue porttitor. Proin id.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 04/29/2017
  endDate: 05/03/2017
  ctyhocn: VYSILHX
  groupCode: GSSTF
published: true
---
Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nunc pulvinar gravida tortor, at aliquet nibh rutrum eu. In auctor hendrerit libero eget feugiat. Duis viverra elit sit amet sem vestibulum, vitae vehicula erat venenatis. Fusce eget justo at ante suscipit dignissim ac non elit. Curabitur varius faucibus hendrerit. Fusce bibendum dui nisi. Vestibulum enim erat, tempus et mi nec, dictum sodales urna. Pellentesque consectetur tristique tincidunt. Donec mollis ullamcorper felis, nec bibendum nisi venenatis eget. Suspendisse non dui et eros fringilla varius vitae ullamcorper metus. Fusce sem urna, pellentesque ut massa ornare, viverra sodales nulla.

1 Donec condimentum purus eget rutrum blandit
1 Ut non urna auctor, convallis nunc eu, aliquam leo
1 Phasellus aliquet nisl sit amet nisl consectetur, eget sodales tellus imperdiet
1 Vestibulum cursus justo et finibus fringilla
1 Sed elementum lorem at felis ultrices suscipit.

Cras aliquet tincidunt suscipit. Fusce facilisis tortor at molestie eleifend. Donec varius turpis sit amet laoreet vestibulum. Donec convallis tellus eget dapibus dictum. Etiam eleifend rutrum sem nec mattis. Donec id laoreet diam. Curabitur maximus, est lobortis dictum mollis, nisl ante posuere nisi, in mattis risus arcu non nisi. Fusce ultricies interdum mauris sit amet cursus. Fusce sit amet tristique nisl. Fusce a blandit odio. Duis in tortor eget arcu euismod condimentum. Donec congue sodales luctus. Mauris ultrices lacus consequat, placerat magna eu, condimentum elit. Suspendisse at egestas arcu, id vestibulum orci.


text:
namespace Cronofy
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using Cronofy.Requests;

    /// <summary>
    /// Class to build an availability request.
    /// </summary>
    public sealed class AvailabilityRequestBuilder : IBuilder<AvailabilityRequest>
    {
        /// <summary>
        /// The available periods for the request.
        /// </summary>
        private readonly IList<AvailabilityRequest.AvailablePeriod> availablePeriods =
            new List<AvailabilityRequest.AvailablePeriod>();

        /// <summary>
        /// The subjects of the required participants for the request.
        /// </summary>
        private readonly IList<string> requiredSubs = new List<string>();

        /// <summary>
        /// The builders for participant groups for the request.
        /// </summary>
        private readonly IList<IBuilder<AvailabilityRequest.ParticipantGroup>> groupBuilders =
            new List<IBuilder<AvailabilityRequest.ParticipantGroup>>();

        /// <summary>
        /// The groups for the request.
        /// </summary>
        private readonly IList<AvailabilityRequest.ParticipantGroup> groups =
            new List<AvailabilityRequest.ParticipantGroup>();

        /// <summary>
        /// The required duration of the request.
        /// </summary>
        private int requiredDuration;

        /// <summary>
        /// The before buffer of the request.
        /// </summary>
        private int? beforeBuffer;

        /// <summary>
        /// The after buffer of the request.
        /// </summary>
        private int? afterBuffer;

        /// <summary>
        /// The start interval of the request.
        /// </summary>
        private int? startInterval;

        /// <summary>
        /// The maximum number of available periods or slots of the request.
        /// </summary>
        private int? maxResults;

        /// <summary>
        /// Sets the maximum number of available periods or slots of the request.
        /// </summary>
        /// <param name="maxResults">
        /// The maximum number of available periods or slots, must be greater than zero and less than or equal to 512.
        /// </param>
        /// <returns>
        /// A reference to the <see cref="AvailabilityRequestBuilder"/>.
        /// </returns>
        /// <exception cref="ArgumentException">
        /// Thrown if <paramref name="maxResults"/> is not greater than zero.
        /// Thrown if <paramref name="maxResults"/> is not less than or equal to 512.
        /// </exception>
        public AvailabilityRequestBuilder MaxResults(int maxResults)
        {
            Preconditions.True(maxResults > 0, "maxResults must be greater than zero");
            Preconditions.True(maxResults <= 512, "maxResults must be less than or equal to 512");

            this.maxResults = maxResults;

            return this;
        }

        /// <summary>
        /// Sets the required duration of the request.
        /// </summary>
        /// <param name="minutes">
        /// The number of minutes for the required duration, must be greater than zero.
        /// </param>
        /// <returns>
        /// A reference to the <see cref="AvailabilityRequestBuilder"/>.
        /// </returns>
        /// <exception cref="ArgumentException">
        /// Thrown if <paramref name="minutes"/> is not greater than zero.
        /// </exception>
        public AvailabilityRequestBuilder RequiredDuration(int minutes)
        {
            Preconditions.True(minutes > 0, "minutes must be greater than zero");

            this.requiredDuration = minutes;

            return this;
        }

        /// <summary>
        /// Sets the start interval of the request.
        /// </summary>
        /// <param name="minutes">
        /// The number of minutes for the start interval, must be greater than zero.
        /// </param>
        /// <returns>
        /// A reference to the <see cref="AvailabilityRequestBuilder"/>.
        /// </returns>
        /// <exception cref="ArgumentException">
        /// Thrown if <paramref name="minutes"/> is not greater than zero.
        /// </exception>
        public AvailabilityRequestBuilder StartInterval(int minutes)
        {
            Preconditions.True(minutes > 0, "minutes must be greater than zero");

            this.startInterval = minutes;

            return this;
        }

        /// <summary>
        /// Sets the before buffer of the request.
        /// </summary>
        /// <param name="beforeBuffer">
        /// The number of minutes for the before buffer.
        /// </param>
        /// <returns>
        /// A reference to the <see cref="AvailabilityRequestBuilder"/>.
        /// </returns>
        /// <exception cref="ArgumentException">
        /// Thrown if <paramref name="beforeBuffer"/> is not null and is negative.
        /// </exception>
        public AvailabilityRequestBuilder BeforeBuffer(int? beforeBuffer)
        {
            if (beforeBuffer.HasValue)
            {
                Preconditions.True(beforeBuffer.Value >= 0, "buffer must be postive");
            }

            this.beforeBuffer = beforeBuffer;

            return this;
        }

        /// <summary>
        /// Sets the after buffer of the request.
        /// </summary>
        /// <param name="afterBuffer">
        /// The number of minutes for the after buffer.
        /// </param>
        /// <returns>
        /// A reference to the <see cref="AvailabilityRequestBuilder"/>.
        /// </returns>
        /// <exception cref="ArgumentException">
        /// Thrown if <paramref name="afterBuffer"/> is not null or is negative.
        /// </exception>
        public AvailabilityRequestBuilder AfterBuffer(int? afterBuffer)
        {
            if (afterBuffer.HasValue)
            {
                Preconditions.True(afterBuffer.Value >= 0, "buffer must be postive");
            }

            this.afterBuffer = afterBuffer;

            return this;
        }

        /// <summary>
        /// Adds an available period to the request.
        /// </summary>
        /// <param name="start">
        /// The start of the available period.
        /// </param>
        /// <param name="end">
        /// The end of the available period.
        /// </param>
        /// <returns>
        /// A reference to the <see cref="AvailabilityRequestBuilder"/>.
        /// </returns>
        public AvailabilityRequestBuilder AddAvailablePeriod(DateTimeOffset start, DateTimeOffset end)
        {
            var period = new AvailabilityRequest.AvailablePeriod
            {
                Start = start,
                End = end,
            };

            this.availablePeriods.Add(period);

            return this;
        }

        /// <summary>
        /// Adds a required participant to the request.
        /// </summary>
        /// <param name="sub">
        /// The sub of the required participant, must not be blank.
        /// </param>
        /// <returns>
        /// A reference to the <see cref="AvailabilityRequestBuilder"/>.
        /// </returns>
        /// <exception cref="ArgumentException">
        /// Thrown if <paramref name="sub"/> is blank.
        /// </exception>
        public AvailabilityRequestBuilder AddRequiredParticipant(string sub)
        {
            Preconditions.NotBlank("sub", sub);

            this.requiredSubs.Add(sub);

            return this;
        }

        /// <summary>
        /// Adds a participant group to the request.
        /// </summary>
        /// <param name="builder">
        /// A builder for the group.
        /// </param>
        /// <returns>
        /// A reference to the <see cref="AvailabilityRequestBuilder"/>.
        /// </returns>
        /// <exception cref="ArgumentException">
        /// Thrown if <paramref name="builder"/> is <c>null</c>.
        /// </exception>
        public AvailabilityRequestBuilder AddParticipantGroup(IBuilder<AvailabilityRequest.ParticipantGroup> builder)
        {
            Preconditions.NotNull("builder", builder);

            this.groupBuilders.Add(builder);

            return this;
        }

        /// <summary>
        /// Adds a participant group to the request.
        /// </summary>
        /// <param name="participantGroup">
        /// A group.
        /// </param>
        /// <returns>
        /// A reference to the <see cref="AvailabilityRequestBuilder"/>.
        /// </returns>
        /// <exception cref="ArgumentException">
        /// Thrown if <paramref name="participantGroup"/> is <c>null</c>.
        /// </exception>
        public AvailabilityRequestBuilder AddParticipantGroup(AvailabilityRequest.ParticipantGroup participantGroup)
        {
            Preconditions.NotNull("participantGroup", participantGroup);

            this.groups.Add(participantGroup);

            return this;
        }

        /// <inheritdoc />
        public AvailabilityRequest Build()
        {
            var request = new AvailabilityRequest
            {
                RequiredDuration = this.GetRequiredDuration(),
                AvailablePeriods = this.availablePeriods.ToArray(),
            };

            var participantGroups = new List<AvailabilityRequest.ParticipantGroup>();

            if (this.requiredSubs.Count > 0)
            {
                var requiredGroup = new ParticipantGroupBuilder()
                    .AddMembers(this.requiredSubs)
                    .AllRequired();

                participantGroups.Add(requiredGroup.Build());
            }

            if (this.groups.Count > 0)
            {
                participantGroups.AddRange(this.groups);
            }

            if (this.groupBuilders.Count > 0)
            {
                participantGroups.AddRange(this.groupBuilders.Select(gb => gb.Build()));
            }

            if (this.startInterval.HasValue)
            {
                request.StartInterval = new AvailabilityRequest.Duration
                {
                    Minutes = this.startInterval.Value,
                };
            }

            if (this.beforeBuffer.HasValue || this.afterBuffer.HasValue)
            {
                request.Buffer = new AvailabilityRequest.Buffers();

                if (this.beforeBuffer.HasValue)
                {
                    request.Buffer.Before = new AvailabilityRequest.BufferDefintion
                    {
                        Minimum = new AvailabilityRequest.Duration
                        {
                            Minutes = this.beforeBuffer.Value,
                        },
                    };
                }

                if (this.afterBuffer.HasValue)
                {
                    request.Buffer.After = new AvailabilityRequest.BufferDefintion
                    {
                        Minimum = new AvailabilityRequest.Duration
                        {
                            Minutes = this.afterBuffer.Value,
                        },
                    };
                }
            }

            if (this.maxResults.HasValue)
            {
                request.MaxResults = this.maxResults.Value;
            }

            request.Participants = participantGroups;

            return request;
        }

        /// <summary>
        /// Gets the required duration as an
        /// <see cref="AvailabilityRequest.Duration"/>.
        /// </summary>
        /// <returns>
        /// The required duration as an
        /// <see cref="AvailabilityRequest.Duration"/>.
        /// </returns>
        private AvailabilityRequest.Duration GetRequiredDuration()
        {
            return new AvailabilityRequest.Duration { Minutes = this.requiredDuration };
        }
    }
}


text:
Log resque related metrics with Harness

## Installation

Add this line to your application's Gemfile:

    gem 'harness-resque'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install harness-resque

## In Jobs

```ruby
class Worker
  extend Resque::Plugins::Harness
end
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
using System;
using System.ComponentModel.DataAnnotations;
using ExpenseManager.Resources;
using ExpenseManager.Web.Constants;

namespace ExpenseManager.Web.Models.Transaction
{
    /// <summary>
    ///     Model for viewing saved transactions
    /// </summary>
    public class TransactionShowModel
    {
        /// <summary>
        ///     Unique id of transaction
        /// </summary>
        [Required]
        public Guid Id { get; set; }

        /// <summary>
        ///     Amount of money in transaction
        /// </summary>
        [Required]
        [Display(Name = "Amount", ResourceType = typeof (SharedResource))]
        public decimal Amount { get; set; }

        /// <summary>
        ///     Date when transaction occurred
        /// </summary>
        [Required]
        [DataType(DataType.DateTime)]
        [DisplayFormat(DataFormatString = SharedConstant.DateFormatModels)]
        [Display(Name = "Date", ResourceType = typeof (SharedResource))]
        public DateTime Date { get; set; }

        /// <summary>
        ///     Short description of transaction
        /// </summary>
        [Display(Name = "Description", ResourceType = typeof (SharedResource))]
        public string Description { get; set; }

        /// <summary>
        ///     Budget in which transaction belongs
        /// </summary>
        [Display(Name = "Budget", ResourceType = typeof (SharedResource))]
        public string BudgetName { get; set; }

        /// <summary>
        ///     Currency which was used for transaction
        /// </summary>
        [Display(Name = "Currency", ResourceType = typeof (SharedResource))]
        public string CurrencySymbol { get; set; }

        /// <summary>
        ///     Category in which transactions belongs
        /// </summary>
        [Display(Name = "Category", ResourceType = typeof (SharedResource))]
        public string CategoryName { get; set; }

        /// <summary>
        ///     Path to category icon
        /// </summary>
        public string CategoryIconPath { get; set; }

        /// <summary>
        ///     Name of wallet when the transaction belongs
        /// </summary>
        [Display(Name = "Wallet", ResourceType = typeof (SharedResource))]
        public string WalletName { get; set; }

        /// <summary>
        ///     Bool representing if transaction is repeatable
        /// </summary>
        [Display(Name = "RepeatableTransaction", ResourceType = typeof (SharedResource))]
        public bool IsRepeatable { get; set; }
    }
}


text:
You must complete the following data defined in the library `php-mysql.php`:

	 define ("MYSQL_HOST","");
	 define ("MYSQL_USER","");
	 define ("MYSQL_PASS","");
	 define ("MYSQL_DB","");

Example:

	<?php
	include ("php-mysql.php");

	$db = new mysql();
	$db->connect();
	$db->query("SELECT name,surname from MY_TABLE");

	while ($r = $db->fetch_array())
	 echo "Name: ".$r["name"]."/ Surname: ".$r["surname"];

	$db->close();
	?>

Other functions

+ `num_rows()`: gives the number of results.
+ `array_pos($pos)`: specify a particular position in the array of results.

==
 Contact to [Maximiliano Kestli](mailto:maxkaestli@hotmail.com)


text:
package theNinthThread;

public class TestSync implements Runnable {
    Timer timer = new Timer();

    public static void main(String[] args) {
        TestSync ts = new TestSync();
        Thread t1 = new Thread(ts);
        Thread t2 = new Thread(ts);
        t1.setName("t1");
        t2.setName("t2");
        t1.start();
        t2.start();
    }

    public void run() {
        timer.add(Thread.currentThread().getName());
    }

}


text:
var chai = require('chai'); // Test assertions that are expressive and readable
//var should = chai.should;
var expect = chai.expect;
var deepLoop = require('../../lib/object/deepLoop.js');

// Tests
// ----------------------------------------------------------------
describe('deepLoop', function() {
  'use strict';
  it('Should return the original object if callback is not passed', function() {
    var original = {
      1: 1
    };
    var modified = deepLoop(original);

    expect(modified).to.equal(original);
  });

  it('Should return the original object if callback is passed', function() {
    var original = {
      1: 1
    };
    var modified = deepLoop(original, function() {});

    expect(modified).to.equal(original);
  });

  describe('is passed nested objects', function() {

    it('Should call the callback with the keys of nested objects', function() {
      var original = {
        1: 1,
        2: {
          3: 3
        }
      };
      var testArray = [];
      var callback = function(obj, key) {
        testArray.push(obj[key]);
      };

      deepLoop(original, callback);

      expect(testArray.toString()).to.equal('1,3');
    });

    it('Should not call the callback', function() {
      var original = {
        1: {
          3: {}
        }
      };
      var x = 1;
      var callback = function() {
        x += 1;
      };

      deepLoop(original, callback);

      expect(x).to.equal(1);
    });

  });
});


text:
namespace HighIronRanch.Cqrs.EventStore.MongoDb
{
	public interface IMongoEventStoreSettings
	{
		string MongoDbEventStoreConnectionString { get; }
		string MongoDbEventStoreDatabase { get; }
	}
}


text:
#ifndef __VIBRATOR_GB_H__
#define __VIBRATOR_GB_H__

#include <osal/greybus/types.h>

/* Greybus vibrator request types */
#define GB_VIBRATOR_TYPE_INVALID             0x00
#define GB_VIBRATOR_TYPE_PROTOCOL_VERSION    0x01
#define GB_VIBRATOR_TYPE_VIBRATOR_ON         0x02
#define GB_VIBRATOR_TYPE_VIBRATOR_OFF        0x03

/* version request has no payload */
struct gb_vibrator_proto_version_response {
    __u8 major;
    __u8 minor;
};

struct gb_vibrator_on_request {
    __le16 timeout_ms;
};

#endif /* __VIBRATOR_GB_H__ */


text:
[![BuildStatus](https://travis-ci.org/tetuyoko/html-pipeline-bungo.svg?branch=master)](https://travis-ci.org/tetuyoko/html-pipeline-bungo)

# Html::Pipeline::Bungo

A html-pipeline filter that converts ruby and emphasis

小説用テキストを変換するhtml-pipelineの拡張
対応
 * ルビ
 * 強調
 * ダーシ

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'html-pipeline'
gem 'html-pipeline-bungo'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install html-pipeline-bungo

## Usage

See html-pipeline

~~~
oreore_pipeline = HTML::Pipeline.new [
    HTML::Pipeline::BungoFilter,
  ]
html_fragment = "<div>:米(こめ)</div> :傍点.."
result = oreore_pipeline.call(html_fragment)
~~~

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/html-pipeline-bungo. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).


text:
  (function() {

    var p = {

      eventDelegates: {
        down: 'downAction'
      },

      activeChanged: function() {
        this.super();

        if (this.$.ripple) {
          if (this.active) {
            // FIXME: remove when paper-ripple can have a default 'down' state.
            if (!this.lastEvent) {
              var rect = this.getBoundingClientRect();
              this.lastEvent = {
                x: rect.left + rect.width / 2,
                y: rect.top + rect.height / 2
              }
            }
            this.$.ripple.downAction(this.lastEvent);
          } else {
            this.$.ripple.upAction();
          }
        }

        this.adjustZ();
      },

      disabledChanged: function() {
        this._disabledChanged();
        this.adjustZ();
      },

      recenteringTouchChanged: function() {
        if (this.$.ripple) {
          this.$.ripple.classList.toggle('recenteringTouch', this.recenteringTouch);
        }
      },

      fillChanged: function() {
        if (this.$.ripple) {
          this.$.ripple.classList.toggle('fill', this.fill);
        }
      },

      adjustZ: function() {
        if (!this.$.shadow) {
          return;
        }
        if (this.active) {
          this.$.shadow.setZ(2);
        } else if (this.disabled) {
          this.$.shadow.setZ(0);
        } else {
          this.$.shadow.setZ(1);
        }
      },

      downAction: function(e) {
        this._downAction();

        if (this.hasAttribute('noink')) {
          return;
        }

        this.lastEvent = e;
        if (!this.$.ripple) {
          var ripple = document.createElement('paper-ripple');
          ripple.setAttribute('id', 'ripple');
          ripple.setAttribute('fit', '');
          if (this.recenteringTouch) {
            ripple.classList.add('recenteringTouch');
          }
          if (!this.fill) {
            ripple.classList.add('circle');
          }
          this.$.ripple = ripple;
          this.shadowRoot.insertBefore(ripple, this.shadowRoot.firstChild);
          // No need to forward the event to the ripple because the ripple
          // is triggered in activeChanged
        }
      }

    };

    Polymer.mixin2(p, Polymer.CoreFocusable);
    Polymer(p);

  })();


text:
//=====================================================================
//
//File:      $RCSfile: CoreGlobalsTestSuiteGenerics.java,v $
//Version:   $Revision: 1.4 $
//Modified:  $Date: 2013/01/10 22:49:08 $
//
//(c) Copyright 2007-2014 by Mentor Graphics Corp. All rights reserved.
//
//=====================================================================
// 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.
//=====================================================================

import junit.framework.Test;
import junit.framework.TestSuite;

import org.eclipse.core.runtime.CoreException;

import com.mentor.nucleus.bp.core.CorePlugin;
import com.mentor.nucleus.bp.core.common.BridgePointPreferencesStore;
import com.mentor.nucleus.bp.core.test.ActionTestGenerics;
import com.mentor.nucleus.bp.core.test.AssignClassTestGenerics;
import com.mentor.nucleus.bp.core.test.AssignComponentTestGenerics;
import com.mentor.nucleus.bp.core.test.AssignRemoveEventsGenerics;
import com.mentor.nucleus.bp.core.test.AttributeMenuItemTestGenerics;
import com.mentor.nucleus.bp.core.test.CantHappenEvtIgnoreEvtTestsGenerics;
import com.mentor.nucleus.bp.core.test.CoreGlobalsTestSuiteIGenerics;
import com.mentor.nucleus.bp.core.test.CoreTestSuiteIGenerics;
import com.mentor.nucleus.bp.core.test.DeleteAttributesTestGenerics;
import com.mentor.nucleus.bp.core.test.DeleteTestGenerics;
import com.mentor.nucleus.bp.core.test.DerivedAttributeTestGenerics;
import com.mentor.nucleus.bp.core.test.DisposeTestGenerics;
import com.mentor.nucleus.bp.core.test.FormalizeUnformalizeTestGenerics;
import com.mentor.nucleus.bp.core.test.FormalizeUnformalizeWithPrefixTestGenerics;
import com.mentor.nucleus.bp.core.test.GetNameTestGenerics;
import com.mentor.nucleus.bp.core.test.MultipleReloadGenerics;
import com.mentor.nucleus.bp.core.test.NumberingTestGenerics;
import com.mentor.nucleus.bp.core.test.OperationsTestGenerics;
import com.mentor.nucleus.bp.core.test.PreferencesTests;
import com.mentor.nucleus.bp.core.test.RenameTest2Generics;
import com.mentor.nucleus.bp.core.test.RenameTestGenerics;
import com.mentor.nucleus.bp.core.test.SetTypeTestGenerics;
import com.mentor.nucleus.bp.core.test.TigerNatureTestGenerics;
import com.mentor.nucleus.bp.core.util.WorkspaceUtil;

/**
* Test all areas of the core
*/
public class CoreGlobalsTestSuiteGenerics extends TestSuite {

	/**
	 * Returns the suite.  This is required to
	 * use the JUnit Launcher.
	 * @throws CoreException
	 */
	public static Test suite() throws CoreException {
		return new CoreGlobalsTestSuiteGenerics();
	}

	/**
	 * Construct the test suite.
	 */
	public CoreGlobalsTestSuiteGenerics() throws CoreException {

		// turn off autobuild to stop MC-3020 builders from running
		WorkspaceUtil.setAutobuilding(false); // throws CoreException
		CorePlugin.getDefault().getPreferenceStore().setValue(BridgePointPreferencesStore.USE_DEFAULT_NAME_FOR_CREATION, true);

        addTest(new TestSuite(CoreGlobalsTestSuiteIGenerics.class));
        addTest(new TestSuite(CoreTestSuiteIGenerics.class));
		addTest(new TestSuite(SetTypeTestGenerics.class));
		addTest(new TestSuite(AssignComponentTestGenerics.class));
		addTest(new TestSuite(AssignClassTestGenerics.class));
        addTest(new TestSuite(MultipleReloadGenerics.class));
		addTest(new TestSuite(NumberingTestGenerics.class));
		addTest(new TestSuite(DisposeTestGenerics.class));
		addTest(new TestSuite(ActionTestGenerics.class));
        addTest(new TestSuite(RenameTestGenerics.class));
		addTest(new TestSuite(RenameTest2Generics.class));
		addTest(new TestSuite(DeleteAttributesTestGenerics.class));
		addTest(new TestSuite(GetNameTestGenerics.class));
		addTest(new TestSuite(DerivedAttributeTestGenerics.class));
		addTest(new TestSuite(FormalizeUnformalizeTestGenerics.class));
		addTest(new TestSuite(AttributeMenuItemTestGenerics.class));
		addTest(new TestSuite(AssignRemoveEventsGenerics.class));
		addTest(new TestSuite(CantHappenEvtIgnoreEvtTestsGenerics.class));
		addTest(new TestSuite(OperationsTestGenerics.class));
		addTest(new TestSuite(FormalizeUnformalizeWithPrefixTestGenerics.class));
		addTest(new TestSuite(DeleteTestGenerics.class));
		addTest(new TestSuite(TigerNatureTestGenerics.class));
        addTest(new TestSuite(PreferencesTests.class));
	}
}


text:
package main

import (
	"github.com/Skarm/walk"
)

type myDialogUI struct {
	noProgressBtn    *walk.PushButton
	indeterminateBtn *walk.PushButton
	normalBtn        *walk.PushButton
	errBtn           *walk.PushButton
	pausedBtn        *walk.PushButton
	startBtn         *walk.PushButton
}

func (w *MyDialog) init(owner walk.Form) (err error) {
	if w.Dialog, err = walk.NewDialog(owner); err != nil {
		return err
	}

	succeeded := false
	defer func() {
		if !succeeded {
			w.Dispose()
		}
	}()

	var font *walk.Font
	if font == nil {
		font = nil
	}

	w.SetName("Dialog")
	if err := w.SetClientSize(walk.Size{598, 300}); err != nil {
		return err
	}
	if err := w.SetTitle(`Dialog`); err != nil {
		return err
	}

	// noProgressBtn
	if w.ui.noProgressBtn, err = walk.NewPushButton(w); err != nil {
		return err
	}
	w.ui.noProgressBtn.SetName("noProgressBtn")
	if err := w.ui.noProgressBtn.SetBounds(walk.Rectangle{40, 60, 161, 23}); err != nil {
		return err
	}
	if err := w.ui.noProgressBtn.SetText(`NoProgress`); err != nil {
		return err
	}
	if err := w.ui.noProgressBtn.SetMinMaxSize(walk.Size{0, 0}, walk.Size{161, 16777215}); err != nil {
		return err
	}

	// indeterminateBtn
	if w.ui.indeterminateBtn, err = walk.NewPushButton(w); err != nil {
		return err
	}
	w.ui.indeterminateBtn.SetName("indeterminateBtn")
	if err := w.ui.indeterminateBtn.SetBounds(walk.Rectangle{40, 90, 161, 23}); err != nil {
		return err
	}
	if err := w.ui.indeterminateBtn.SetText(`Indeterminate`); err != nil {
		return err
	}
	if err := w.ui.indeterminateBtn.SetMinMaxSize(walk.Size{0, 0}, walk.Size{161, 16777215}); err != nil {
		return err
	}

	// normalBtn
	if w.ui.normalBtn, err = walk.NewPushButton(w); err != nil {
		return err
	}
	w.ui.normalBtn.SetName("normalBtn")
	if err := w.ui.normalBtn.SetBounds(walk.Rectangle{40, 120, 161, 23}); err != nil {
		return err
	}
	if err := w.ui.normalBtn.SetText(`Normal`); err != nil {
		return err
	}
	if err := w.ui.normalBtn.SetMinMaxSize(walk.Size{0, 0}, walk.Size{161, 16777215}); err != nil {
		return err
	}

	// errBtn
	if w.ui.errBtn, err = walk.NewPushButton(w); err != nil {
		return err
	}
	w.ui.errBtn.SetName("errBtn")
	if err := w.ui.errBtn.SetBounds(walk.Rectangle{40, 150, 161, 23}); err != nil {
		return err
	}
	if err := w.ui.errBtn.SetText(`Error`); err != nil {
		return err
	}

	// pausedBtn
	if w.ui.pausedBtn, err = walk.NewPushButton(w); err != nil {
		return err
	}
	w.ui.pausedBtn.SetName("pausedBtn")
	if err := w.ui.pausedBtn.SetBounds(walk.Rectangle{40, 180, 161, 23}); err != nil {
		return err
	}
	if err := w.ui.pausedBtn.SetText(`Paused`); err != nil {
		return err
	}

	// startBtn
	if w.ui.startBtn, err = walk.NewPushButton(w); err != nil {
		return err
	}
	w.ui.startBtn.SetName("startBtn")
	if err := w.ui.startBtn.SetBounds(walk.Rectangle{290, 180, 75, 23}); err != nil {
		return err
	}
	if err := w.ui.startBtn.SetText(`START`); err != nil {
		return err
	}

	// Tab order

	succeeded = true

	return nil
}


text:
<?php

/**
 *  Utility class for generating necessary server-specific SQL commands
 *
 *  @author   Remy BREUILS
 *  @version  $Id: e9f382ce0ed1cdbb1c521c83a028893d69bea7a6 $
 *  @package  phing.tasks.ext.dbdeploy
 */
class DbmsSyntaxPgSQL extends DbmsSyntax
{
    public function generateTimestamp()
    {
        return "NOW()";
    }
}


text:
![Thumb Ratings](assets/thumb-ratings.jpg)

`Thumb Ratings` is a [Grav](http://github.com/getgrav/grav) Plugin that allows you to add a thumbs up/down to your posts.

# Installation

Installing the `Thumb Ratings` plugin can be done in one of two ways. The GPM (Grav Package Manager) installation method enables you to quickly and easily install the plugin with a simple terminal command, while the manual method enables you to do so via a zip file.

## GPM Installation (Preferred)

The simplest way to install this plugin is via the [Grav Package Manager (GPM)](http://learn.getgrav.org/advanced/grav-gpm) through your system's Terminal (also called the command line).  From the root of your Grav install type:

    bin/gpm install thumb-ratings

This will install the `Thumb Ratings` plugin into your `/user/plugins` directory within Grav. Its files can be found under `/your_site_grav/user/plugins/thumb-ratings`.

## Manual Installation

To install this plugin, just download the zip version of this repository and unzip it under `/your_site_grav/user/plugins`. Then, rename the folder to `thumb-ratings`. You can find these files either on [GitHub](https://github.com/iusvar/grav-plugin-thumb-ratings) or via [GetGrav.org](http://getgrav.org/downloads/plugins#extras).

You should now have all the plugin files under

    /your/site/grav/user/plugins/thumb-ratings

# Updating

As development for the `Thumb Ratings` plugin continues, new versions may become available that add additional features and functionality, improve compatibility with newer Grav releases, and generally provide a better user experience. Updating `Thumb Ratings` is easy, and can be done through Grav's GPM system, as well as manually.

## GPM Update (Preferred)

The simplest way to update this plugin is via the Grav Package Manager (GPM). You can do this with this by navigating to the root directory of your Grav install using your system's Terminal (also called command line) and typing the following:

    bin/gpm update thumb-ratings

This command will check your Grav install to see if your `Thumb Ratings` plugin is due for an update. If a newer release is found, you will be asked whether or not you wish to update. To continue, type y and hit enter. The plugin will automatically update and clear Grav's cache.

## Manual Update

Manually updating `Thumb Ratings` is pretty simple. Here is what you will need to do to get this done:

* Delete the `your/site/user/plugins/thumb-ratings` directory.

* Downalod the new version of the Thumb Ratings plugin from either [GitHub](https://github.com/iusvar/grav-plugin-thumb-ratings) or [GetGrav.org](http://getgrav.org/downloads/plugins#extras).

* Unzip the zip file in `your/site/user/plugins` and rename the resulting folder to `thumb-ratings`.

* Clear the Grav cache. The simplest way to do this is by going to the root Grav directory in terminal and typing `bin/grav clear-cache`.

Note: Any changes you have made to any of the files listed under this directory will also be removed and replaced by the new set. Any files located elsewhere (for example a YAML settings file placed in `user/config/plugins`) will remain intact.

# Usage

To use this plugin, you simplest way to display the link to print is to use the Twig function and pass it a dynamic value such as:

```
{{ thumbs(page.slug) }}
```

This will use the current page's route as the unique identifier.

The `Thumb Ratings` plugin comes with some sensible default configuration, that are pretty self explanatory:

## Config Defaults

```yaml
# Global plugin configurations.
enabled: true                   # Set to false to disable this plugin completely.
built_in_css: true              # Use built-in CSS of the plugin.

# Various checks
callback: '/thumb-ratings'      # A path that the plugin will look for when processing Ajax calls
unique_ip_check: false          # Ensures that a particular IP can only vote once
disable_after_vote: true        # Disable the interaction after the user has already made the vote
readonly: false                 # Set to readonly to disable all interaction

# Colors
up_bgcolor: '#00FF00'           # Background color thumb up
down_bgcolor: '#FF0000'         # Background color thumb down
up_color: '#ffffff'             # Color thumb up
down_color: '#ffffff'           # Color thumb down
```

If you need to change any value, then the best process is to copy the [thumb-ratings.yaml](thumb-ratings.yaml) file into your `users/config/plugins/` folder (create if doesn't exist), and modify it there. This will override the default settings.

# Acknowledgements

For this plugin I am grateful to the following:

* [Star Ratings Plugin](https://github.com/getgrav/grav-plugin-star-ratings)

* [star rating jQuery plugin](https://github.com/nashio/star-rating-svg)

# TODO

* Use technical cookies

* Show a single number, as an alternative to the double number (Up adds, Down subtracts)


text:
Fünfter Beweis: Maximaler Graph und Äquivalenzrelation
======================================================

In diesem Beweis wird angenommen, dass G ein Graph mit n Knoten und ohne p - Clique ist, welcher die maximale Anzahl an Kanten hat.
Um :math:`\mid E \mid \le (1- \frac{1}{p-1}) \frac{n^2}{2}` zu zeigen bedient sich dieser Beweis zudem folgender Behauptung:

**Behauptung:** G enthält keine drei Knoten u,v,w mit :math:`\{ v, w \} \in E`, aber :math:`\{ u, v \} \notin E` und :math:`\{ u, w \} \notin E`

Diese Behauptung beweisen wir durch Widerspruch. Hierzu unterteilen wir das Problem in zwei Fälle:

.. todo:: Bei Wiedersprüchen genau sagen mit was sie wiedersprechen

**Fall 1:** :math:`d(u) < d(v) \vee d(u) < d(w)`

Nehmen wir an, dass d(u) < d(v) gilt, denn u und v sind austauschbar.
Entfernen wir nun u, verdopplen wir v und nennen den neuen Knoten v', wobei alle Kanten ebenfalls kopiert werden, sodass v' die selben Nachbarn wie v hat. Der hieraus entstehende Graph G' hat ebenfalls keine p-Clique, da v' lediglich doppelte, so zu sagen parallele Verbindungen hinzufügt, eine bestehende Clique also nicht erweitert wird. Hieraus ergibt sich für die Kantentzahl:

.. math::
  \mid E(G') \mid = \mid E(G) \mid + d(v) - d(u) >^{\text{da } d(u) < d(v)} \mid E(G) \mid

Da G ein maximaler Graph ist, ist dies ein Widerspruch.

**Fall 2:** :math:`d(u) \ge d(v) \wedge d(u) \ge d(w)`

Hier kopieren wir u zwei mal, da es vom Grad her maximal ist, wobei wie im ersten Fall die Kanten mitkopiert werden und entfernen dann v und w. Der hieraus entstehende Graph kann wieder keine p-Clique haben, da er eine bestehende Clique durch die Veränderung nicht erweitern würde. Für die Anzahl der Kanten ergibt sich:

.. math::
  \mid E(G') \mid &= \mid E(G) \mid + 2 d(u) - (d(v) + d(w) - 1) \\
  &> \mid E(G) \mid

Hierbei ergeben sich die :math:`2d(u)` durch das doppelte Kopieren von u, die :math:`- (d(v) + d(w) - 1)` vom entfernen von v und w, sowie der Kante vw. Die Ungleichung gilt, da :math:`d(u) \ge d(v) \wedge d(u) \ge d(w)` gilt. Da G' nun mehr Kanten hat G ergibt sich wieder ein Widerspruch, womit die Behauptung bewiesen wäre.

Definieren wir :math:`u \sim v :\Longleftrightarrow \{ u,v \} \notin E(G)`, so ist dies dank der bewiesenen Behauptung eine Äquivalenzrelation:

**Reflexiv:**

.. math::
  u \sim u \Longleftrightarrow^1 \{ u,u \} \notin E(G)

(1) Dies gilt, da die hier betrachteten Graphen keine Kanten mit gleichem Start und Zielknoten erlauben.

**Transitiv:**

.. math::
  u \sim v \wedge v \sim w \Longrightarrow^1 u \sim w

(1) Dies ist exakt die oben bewiesene Behauptung.

**Symetrisch:**

.. math::
  u \sim v &\Rightarrow \{ u,v \} \notin E(G) \\
  &\Rightarrow\ v \sim u

Diese Äquivalenzrelation muss ebenfalls für alle vollständigen (p - 1) - partiten Graphen gelten, da dort lediglich Knoten aus unterschiedlichen Partitionen miteinander verbunden sind. Ein dritter Knoten muss also aufgrund der Vollständigkeit entweder mit einem der beiden oder beiden anderen verbunden sein. Dementsprechend gilt die Äquivalenzrelation auch für Turán Graphen, wodurch sowohl der maximale Graph, als auch der Turán Graph in einer Äquivalenzklasse sind.

Dementsprechend können wir unseren maximalen Graphen als einen solchen behandeln und die Aussage ist bewiesen, da wir die Behauptung schon im zweiten Beweis für einen (p - 1) - Turán Graphen gezeigt haben.


text:
import logging

from pygenie.client import Genie
from pygenie.conf import GenieConf

logging.basicConfig(level=logging.WARNING)

LOGGER = logging.getLogger(__name__)

genie_conf = GenieConf()
genie_conf.genie.url = "http://genie:8080"

genie = Genie(genie_conf)

LOGGER.warning("This script will simulate resetting production tags to the prod cluster after issue is resolved")
LOGGER.warning("Beginning process of moving production load back to prod cluster")

# Add the sched:sla tag to the prod cluster
clusters = genie.get_clusters(filters={"name": "GenieDemoProd"})
for cluster in clusters:
    cluster_id = cluster["id"]
    LOGGER.warning(f"Adding sched:sla tag to the GenieDemoProd cluster with id = {cluster_id}")
    LOGGER.warning(f"Tags before = {cluster['tags']}")
    genie.add_tags_for_cluster(cluster_id, ["sched:sla"])
    LOGGER.warning(f"Tags after = {genie.get_cluster(cluster_id)['tags']}")

# Remove the sched:sla tag from the test cluster
clusters = genie.get_clusters(filters={"name": "GenieDemoTest"})
for cluster in clusters:
    cluster_id = cluster["id"]
    LOGGER.warning(f"Removing sched:sla tag from GenieDemoTest cluster with id = {cluster_id}")
    LOGGER.warning(f"Tags before = {cluster['tags']}")
    genie.remove_tag_for_cluster(cluster_id, "sched:sla")
    LOGGER.warning(f"Tags after = {genie.get_cluster(cluster_id)['tags']}")

LOGGER.warning("Finished moving production tags to the prod cluster. All production jobs should now go to prod again")


text:
<title>
National Guard descends on N.O. protest
</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php include "../../legacy-includes/Script.htmlf" ?>

<?php include "../../legacy-includes/TopLogo.htmlf" ?>

<?php include "../../legacy-includes/TopAd.htmlf" ?>

<?php include "../../legacy-includes/LeftButtons.htmlf" ?>

<?php include "../../legacy-includes/BodyInsert.htmlf" ?>

National Guard descends on N.O. protest

By Alden Eagle and Gimena Gordillo | September 7, 2007 | Pages 1 and 8

THE NATIONAL Guard on the streets of New Orleans. It's an image that recalls the pleas for help from flood victims in the aftermath of Hurricane Katrina two years ago.

But the Guard was in short supply then--since so many of its members had been deployed to Iraq. When they did arrive, their orders were to police the people battered by Katrina, not help them.

Two years after Katrina, the National Guard was blockading streets in New Orleans--but in response to protesters demanding that needed public housing in New Orleans be reopened.

On August 31, National Guard soldiers and New Orleans police sealed off the streets around the Gentilly offices of the Housing Authority of New Orleans (HANO)--in response to a sit-in of 20 peaceful protesters.

"The police presence was excessive, and it was disproportionate considering the presence of peaceful folks who were in the building," said Rosana Cruz, co-director of the New Orleans group Safe Streets. "When I arrived, I counted 14 vehicles and Humvees from the New Orleans Police Department and from military police. Then, a SWAT team arrived, and the police presence increased even more."

Many New Orleans residents left behind after Katrina languished without food and water for days, but it took no time two years later for the Guard to descend on people asking to return to their homes. Rather than listen to the residents' grievances, HANO shut down for the day.

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

NEW ORLEANS has 5,000 empty public housing units, many of which had only minor damage from the storm. Those who used to live in these units must squeeze in with relatives or live in the streets.

Instead of reopening public housing, HANO wants to demolish the four largest developments. Their plans call for new "mixed income" neighborhoods--meaning neighborhoods that are too expensive for the people who used to call them home.

HANO's plan also calls for one of the developments to be replaced by two "championship" golf courses.

New Orleans is at about two-thirds of its pre-Katrina population. The city government is encouraging people displaced by the hurricane to come home, but the lack of housing and services makes that impossible for many.

The city's one public hospital, Charity, was closed illegally after the storm, so the poor and uninsured have literally no health care options. Some have been forced to travel to Baton Rouge, an hour-and-a-half drive, for routine care. There is no public care for mental health, despite the surge in people suffering from depression and post-traumatic stress.

Only one-sixth of city buses and one streetcar line are back in service, meaning that it is nearly impossible to get around town without a car.

The majority of schools are still closed, and those that reopened were mostly turned into charter schools. One lone school has reopened in the Lower Ninth. As a result, many parents trying to rebuild their lives in New Orleans feel like they need to leave their children in the care of relatives elsewhere. The school department has been scrambling to staff the few open schools, but this is because teachers were fired after the storm.

Bush marked the two-year anniversary of Katrina last week and talked about the city's "progress." He spoke only a few blocks away from the hardest-hit areas of the Lower Ninth--those closest to the breached Industrial Canal.

Almost nothing is left on many blocks. Most lots are abandoned, choked with weeds, with no sign that a house was once there except for the remaining concrete front steps. In other spots, where residents are still fighting to rebuild, the grass is carefully trimmed, but still, the lot is empty.

In addition to the many residents fighting to return to closed public housing, there are thousands more trying to get back inside the houses they own.

The city has made it easy for developers to get a property declared "blighted" and then swoop in to purchase it on the cheap, with no say whatsoever from its owner. So throughout the city, there are empty houses where owners have spray-painted a plea: "Don't demolish!"

"Promises, that's all there is, promises," 58-year-old Sharon Sears Jasper, who lived at the St. Bernard complex in the Seventh Ward off and on since she was baby, told the New Orleans Times-Picayune. "I want to be home. That's my house."

<?php include "../../legacy-includes/BottomNavLinks.htmlf" ?>

<?php include "../../legacy-includes/RightAdFolder.htmlf" ?>


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="cs_CZ">
<context>
    <name>SPIConfiguration</name>
    <message>
        <location filename="spiconfiguration.ui" line="14"/>
        <source>Configure SPI Plugin</source>
        <translation>Konfigurace SPI pluginu</translation>
    </message>
    <message>
        <location filename="spiconfiguration.ui" line="20"/>
        <source>Transmission frequency:</source>
        <translation>Frekvence přenosu:</translation>
    </message>
    <message>
        <location filename="spiconfiguration.ui" line="35"/>
        <source>1Mhz</source>
        <translation>1MHz</translation>
    </message>
    <message>
        <location filename="spiconfiguration.ui" line="40"/>
        <source>2Mhz</source>
        <translation>2MHz</translation>
    </message>
    <message>
        <location filename="spiconfiguration.ui" line="45"/>
        <source>4MHz</source>
        <translation>4MHz</translation>
    </message>
    <message>
        <location filename="spiconfiguration.ui" line="50"/>
        <source>8MHz</source>
        <translation>8MHz</translation>
    </message>
</context>
<context>
    <name>SPIPlugin</name>
    <message>
        <location filename="spiplugin.cpp" line="128"/>
        <source>This plugin provides DMX output for SPI devices.</source>
        <translation>Tento plugin umožnuje podporu DMX výstupů pto SPI zařízení.</translation>
    </message>
</context>
</TS>


text:
import numpy as np
import gizeh as gz
import moviepy.editor as mpy
import colorsys

fps = 24
W,H = 400,400
D = 10 # duration, in seconds
DIR = "../output/square.gif"

def make_frame(t):
    surface = gz.Surface(W,H)
    # hsl is hue color wheel degree, lightness percent, saturation percent
    hue = t * (100/D) / 100
    color = colorsys.hls_to_rgb(hue, .5, 1)
    print hue
    square = gz.square(l=396, fill=color, xy=(200, 200))
    square.draw(surface)
    return surface.get_npimage()

clip = mpy.VideoClip(make_frame, duration=D)#.resize(.5) // filesize is smaller, check that this doesnt loss too much?
clip.write_gif(DIR, fps=fps, fuzz=30, opt="OptimizePlus")


text:
package org.apache.ignite.ml.trees.trainers.columnbased.contsplitcalcs;

import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.PrimitiveIterator;
import java.util.stream.DoubleStream;
import org.apache.ignite.ml.trees.ContinuousRegionInfo;
import org.apache.ignite.ml.trees.ContinuousSplitCalculator;
import org.apache.ignite.ml.trees.trainers.columnbased.vectors.ContinuousSplitInfo;
import org.apache.ignite.ml.trees.trainers.columnbased.vectors.SplitInfo;

/**
 * Calculator of variance in a given region.
 */
public class VarianceSplitCalculator implements ContinuousSplitCalculator<VarianceSplitCalculator.VarianceData> {
    /**
     * Data used in variance calculations.
     */
    public static class VarianceData extends ContinuousRegionInfo {
        /** Mean value in a given region. */
        double mean;

        /**
         * @param var Variance in this region.
         * @param size Size of data for which variance is calculated.
         * @param mean Mean value in this region.
         */
        public VarianceData(double var, int size, double mean) {
            super(var, size);
            this.mean = mean;
        }

        /**
         * No-op constructor. For serialization/deserialization.
         */
        public VarianceData() {
            // No-op.
        }

        /** {@inheritDoc} */
        @Override public void writeExternal(ObjectOutput out) throws IOException {
            super.writeExternal(out);
            out.writeDouble(mean);
        }

        /** {@inheritDoc} */
        @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
            super.readExternal(in);
            mean = in.readDouble();
        }

        /**
         * Returns mean.
         */
        public double mean() {
            return mean;
        }
    }

    /** {@inheritDoc} */
    @Override public VarianceData calculateRegionInfo(DoubleStream s, int size) {
        PrimitiveIterator.OfDouble itr = s.iterator();
        int i = 0;

        double mean = 0.0;
        double m2 = 0.0;

        // Here we calculate variance and mean by incremental computation.
        while (itr.hasNext()) {
            i++;
            double x = itr.next();
            double delta = x - mean;
            mean += delta / i;
            double delta2 = x - mean;
            m2 += delta * delta2;
        }

        return new VarianceData(m2 / i, size, mean);
    }

    /** {@inheritDoc} */
    @Override public SplitInfo<VarianceData> splitRegion(Integer[] s, double[] values, double[] labels, int regionIdx,
        VarianceData d) {
        int size = d.getSize();

        double lm2 = 0.0;
        double rm2 = d.impurity() * size;
        int lSize = size;

        double lMean = 0.0;
        double rMean = d.mean;

        double minImpurity = d.impurity() * size;
        double curThreshold;
        double curImpurity;
        double threshold = Double.NEGATIVE_INFINITY;

        int i = 0;
        int nextIdx = s[0];
        i++;
        double[] lrImps = new double[] {lm2, rm2, lMean, rMean};

        do {
            // Process all values equal to prev.
            while (i < s.length) {
                moveLeft(labels[nextIdx], lrImps[2], i, lrImps[0], lrImps[3], size - i, lrImps[1], lrImps);
                curImpurity = (lrImps[0] + lrImps[1]);
                curThreshold = values[nextIdx];

                if (values[nextIdx] != values[(nextIdx = s[i++])]) {
                    if (curImpurity < minImpurity) {
                        lSize = i - 1;

                        lm2 = lrImps[0];
                        rm2 = lrImps[1];

                        lMean = lrImps[2];
                        rMean = lrImps[3];

                        minImpurity = curImpurity;
                        threshold = curThreshold;
                    }

                    break;
                }
            }
        }
        while (i < s.length - 1);

        if (lSize == size)
            return null;

        VarianceData lData = new VarianceData(lm2 / (lSize != 0 ? lSize : 1), lSize, lMean);
        int rSize = size - lSize;
        VarianceData rData = new VarianceData(rm2 / (rSize != 0 ? rSize : 1), rSize, rMean);

        return new ContinuousSplitInfo<>(regionIdx, threshold, lData, rData);
    }

    /**
     * Add point to the left interval and remove it from the right interval and calculate necessary statistics on
     * intervals with new bounds.
     */
    private void moveLeft(double x, double lMean, int lSize, double lm2, double rMean, int rSize, double rm2,
        double[] data) {
        // We add point to the left interval.
        double lDelta = x - lMean;
        double lMeanNew = lMean + lDelta / lSize;
        double lm2New = lm2 + lDelta * (x - lMeanNew);

        // We remove point from the right interval. lSize + 1 is the size of right interval before removal.
        double rMeanNew = (rMean * (rSize + 1) - x) / rSize;
        double rm2New = rm2 - (x - rMean) * (x - rMeanNew);

        data[0] = lm2New;
        data[1] = rm2New;

        data[2] = lMeanNew;
        data[3] = rMeanNew;
    }
}


text:
Quickly add/remove project folder.

![gif](https://raw.githubusercontent.com/t9md/t9md/c9cbeb79d3e8f86fc60efb52e696d4340012e4da/img/atom-project-folder.gif)

# What is this?

Atom provide `application:add-project-folder` to add your project to project list.
And you can right click and chose `Remove Project Folder` to remove project from list.
This package enables you to quickly do above actions and provide extra commands to manipulate project list.

# Features

* Quickly add/remove project folder, or open in new window(`ctrl-enter` in select-list)
* Can switch action between `add`/`remove` with `tab` and UI color reflect current action.
* Replace all project folders with selected item(`ctrl-r` in select-list).
* Hide already loaded folders from select list when adding.
* Continuously adding, removing without closing select list(`space` in select-list).
* Find Git project recursively from specified directory.
* User defined project-group(add/remove set of project by defined group).

# Command

* `project-folder:add`: Add project folder.
* `project-folder:remove`: Remove project folder.
* `project-folder:open-config`: Open user-config to define project-group as CSON format.

In mini editor
* `project-folder:replace`: Remove project except selected.
* `project-folder:switch-action`: Switch action 'add' / 'remove'. CSS style changes depending on action add(`blue`), remove(`red`), so that you can understand what you are doing.
* `project-folder:confirm-and-continue`: Confirm action without closing select list, you can continue to add/remove next project folder.
* `project-folder:open-in-new-window`: Open selected project in new window.
* `project-folder:set-to-top-of-projects`: Set selected project to top of project list.

# How to use

Here is training course from Basic(step-1) to step3.

## Basic.

1. Start `project-folder:add` from command palette or from keymap.
2. Chose folder you want to add.
3. Project folder added and listed in tree-view.

## Switch action by `tab`, Confirm and continue with `space`.

1. Start `project-folder:add` from command palette or from keymap.
2. Type `space` key on item you want to add, and continue to add next item with `space`.
3. Then type `tab`, selected items color change to `red` background to indicate action changed to `remove`. Then type `space` to continuously remove folder from project list.

## Replace project list by `ctrl-r`.

1. Start `project-folder:add` from command palette or from keymap.
2. Add multiple folder by typing `space` several times.
3. Then type `ctrl-r` on item you want to replace.
4. Project folders you added on 2. was replaced with only item you just replaced.

## User defined project-group and open it in new-window.

This tutorial assume you've cloned git repositories `atom`, `text-buffer` and `atom-keymap` to `~/github`.

1. From command paletter execute `project-folder:open-config`.
2. Paste following text in opened editor and save it.
```coffeescript
groups:
  atom: [
    "~/github/atom"
    "~/github/text-buffer"
    "~/github/atom-keymap"
  ]
```
3. `project-folder:add`, you can see "atom" group shows up in top of list with different icon.
4. `ctrl-enter` to open `atom` group in new window.
5. Three directories defined in group have opened in new window!(You can also remove set of directories in same way)

# Keymap

Following keymap is defined for project-folder's select-list mini editor.

```coffeescript
'.project-folder atom-text-editor[mini]':
  'ctrl-r': 'project-folder:replace'
  'tab': 'project-folder:switch-action'
  'space': 'project-folder:confirm-and-continue'
  'ctrl-enter': 'project-folder:open-in-new-window'
  'ctrl-t': 'project-folder:set-to-top-of-projects'
```

To start `project-folder:add` or `project-folder:remove`, invoke from command pallete, or set keymap by yourself.

e.g. My setting.(I'm not setting `project-folder:remove` since I can switch to it by `tab`)

```coffeescript
'atom-workspace:not([mini])':
  'cmd-p': 'project-folder:add'
```

# Config

* `projectRootDirectories`: Comma separated list of directries to search project directories.

e.g
`~/.atom/packages, ~/github`

If you want to directly edit `config.cson`, see blow.

```coffeescript
"project-folder":
  projectRootDirectories: [
    "~/.atom/packages"
    "~/github"
  ]
```


text:
<!doctype html>

		<meta charset="utf-8">

		<title>Правильная организация CSS</title>

		<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
		<meta name="author" content="Hakim El Hattab">

		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">

		<link rel="stylesheet" href="css/reveal.css">
		<link rel="stylesheet" href="css/theme/simple.css" id="theme">

		<link rel="stylesheet" href="lib/css/zenburn.css">
		<link rel="stylesheet" href="css/override.css">

Правильная организация CSS

Часть 1.

Проблемы

Типичная задача

Потеря контроля

долго вносятся изменения

исправления в одном месте ломают что-то в другом

потоянно возникает вопрос куда класть стили

возникает желание все выкинуть и переверстать заново

Почему?

            никто не знает будущего

Проблемы с CSS

использование глобального пространства имен

удаление мертвого кода

нарушение изоляции

Часть 2.

Решения

Технологии и методологии

BEM

CSS Bliss

Web Components

css in js

SMACSS

SUITCSS

OOCSS

AMCSS

БЭМ

Блок       Элемент       Модификатор

Пример

    Edit

    Delete

.button {
  display: inline-block;
  padding: 5px 10px;
  margin: 0 10px;
}

.edit {
  padding-left: 20px;
  background: url('edit-icon.png');
}

... через некоторое время

  john.doe@example.com
  Change email

/* Ooops! */
.edit {
  background: url('edit-email-icon.png');
}

.toolbar .edit {
  ...
}

.toolbar .button {
  ...
}

.user-profile .edit {
 ...
}

Cascading Style Sheets

      .toolbar .button .edit

      .toolbar__button_edit

    Edit

    Delete

.toolbar { ... }
.toolbar__button { ... }
.toolbar__button_edit { ... }
.toolbar__button_delete { ... }

Что получили

элементы инкапсулированы внутри блоков

файл (или каталог) для описания блока

прозрачная структура проекта

самодокументируемый код

упрощается поиск селекторов

упрощается модификация стилей

удаление неиспользуемого кода

Немного самодисциплины

Позиционирование блока задается родителем

Для описания сущностей используются классы, но не id

Нельзя создавать элементы элементов (block__elem1__elem2)

В именах модификаторов и элементов всегда присутствует имя блока

Из предыдущего пункта следует, что нельзя создавать глобальные
              модификаторы

Блоки могут не содержать вложенных элементов (link)

Блоки могут заключать в себе все содержимое страницы или крупные ее части (page, page-section)

Vertical Slides

Slides can be nested inside of each other.

Use the Space key to navigate through all slides.

Basement Level 1

Nested slides are useful for adding additional detail underneath a high level horizontal slide.

Basement Level 2

That's it, time to go back up.

Slides

						Not a coder? Not a problem. There's a fully-featured visual editor for authoring these, try it out at http://slides.com.

Point of View

						Press ESC to enter the slide overview.

						Hold down alt and click on any element to zoom in on it using zoom.js. Alt + click anywhere to zoom back out.

Touch Optimized

						Presentations look great on touch devices, like mobile phones and tablets. Simply swipe through your slides.

Fragments

Hit the next arrow...

... to step through ...

... a fragmented slide.

							This slide has fragments which are also stepped through in the notes window.

Fragment Styles

There's different types of fragments, like:

grow

shrink

fade-out

current-visible

highlight-red

highlight-blue

Transition Styles

						You can select from different transitions, like:

						None -
						Fade -
						Slide -
						Convex -
						Concave -
						Zoom

Themes

						reveal.js comes with a few themes built in:

						Black (default) -
						White -
						League -
						Sky -
						Beige -
						Simple

						Serif -
						Blood -
						Night -
						Moon -
						Solarized

Slide Backgrounds

							Set data-background="#dddddd" on a slide to change the background color. All CSS color formats are supported.

Image Backgrounds

<section data-background="image.png">

Tiled Backgrounds

<section data-background="image.png" data-background-repeat="repeat" data-background-size="100px">

Video Backgrounds

<section data-background-video="video.mp4,video.webm">

... and GIFs!

Background Transitions

						Different background transitions are available via the backgroundTransition option. This one's called "zoom".

Reveal.configure({ backgroundTransition: 'zoom' })

Background Transitions

						You can override background transitions per-slide.

<section data-background-transition="zoom">

Pretty Code

function linkify( selector ) {
  if( supports3DTransforms ) {

    var nodes = document.querySelectorAll( selector );

    for( var i = 0, len = nodes.length; i < len; i++ ) {
      var node = nodes[i];

      if( !node.className ) {
        node.className += ' roll';
      }
    }
  }
}

Code syntax highlighting courtesy of highlight.js.

Marvelous List

No order here

Or here

Or here

Or here

Fantastic Ordered List

One is smaller than...

Two is smaller than...

Three!

Tabular Tables

								Item
								Value
								Quantity

								Apples
								$1
								7

								Lemonade
								$2
								18

								Bread
								$3
								2

Clever Quotes

						These guys come in two forms, inline: <q cite="http://searchservervirtualization.techtarget.com/definition/Our-Favorite-Technology-Quotations">
						“The nice thing about standards is that there are so many to choose from”</q> and block:

						“For years there has been a theory that millions of monkeys typing at random on millions of typewriters would
						reproduce the entire works of Shakespeare. The Internet has proven this theory to be untrue.”

Intergalactic Interconnections

						You can link between slides internally,
						like this.

Speaker View

There's a speaker view. It includes a timer, preview of the upcoming slide as well as your speaker notes.

Press the S key to try it out.

						Oh hey, these are some notes. They'll be hidden in your presentation, but you can see them if you open the speaker notes window (hit 's' on your keyboard).

Export to PDF

Presentations can be exported to PDF, here's an example:

Global State

						Set data-state="something" on a slide and "something"
						will be added as a class to the document element when the slide is open. This lets you
						apply broader style changes, like switching the page background.

State Events

						Additionally custom events can be triggered on a per slide basis by binding to the data-state name.

Reveal.addEventListener( 'customevent', function() {
	console.log( '"customevent" has fired' );
} );

Take a Moment

						Press B or . on your keyboard to pause the presentation. This is helpful when you're on stage and want to take distracting slides off the screen.

Much more

Right-to-left support

Extensive JavaScript API

Auto-progression

Parallax backgrounds

Custom keyboard bindings

THE END

						- Try the online editor

						- Source code & documentation