text:
static MSpan *MHeap_AllocLocked(MHeap*, uintptr, int32);
static bool MHeap_Grow(MHeap*, uintptr);
static void MHeap_FreeLocked(MHeap*, MSpan*);
static MSpan *MHeap_AllocLarge(MHeap*, uintptr);
static MSpan *BestFit(MSpan*, uintptr, MSpan*);

static void
RecordSpan(void *vh, byte *p)
{
	MHeap *h;
	MSpan *s;

	h = vh;
	s = (MSpan*)p;
	s->allnext = h->allspans;
	h->allspans = s;
}

// Initialize the heap; fetch memory using alloc.
void
runtime·MHeap_Init(MHeap *h, void *(*alloc)(uintptr))
{
	uint32 i;

	runtime·FixAlloc_Init(&h->spanalloc, sizeof(MSpan), alloc, RecordSpan, h);
	runtime·FixAlloc_Init(&h->cachealloc, sizeof(MCache), alloc, nil, nil);
	// h->mapcache needs no init
	for(i=0; i<nelem(h->free); i++)
		runtime·MSpanList_Init(&h->free[i]);
	runtime·MSpanList_Init(&h->large);
	for(i=0; i<nelem(h->central); i++)
		runtime·MCentral_Init(&h->central[i], i);
}

// Allocate a new span of npage pages from the heap
// and record its size class in the HeapMap and HeapMapCache.
MSpan*
runtime·MHeap_Alloc(MHeap *h, uintptr npage, int32 sizeclass, int32 acct)
{
	MSpan *s;

	runtime·lock(h);
	runtime·purgecachedstats(m);
	s = MHeap_AllocLocked(h, npage, sizeclass);
	if(s != nil) {
		mstats.heap_inuse += npage<<PageShift;
		if(acct) {
			mstats.heap_objects++;
			mstats.heap_alloc += npage<<PageShift;
		}
	}
	runtime·unlock(h);
	return s;
}

static MSpan*
MHeap_AllocLocked(MHeap *h, uintptr npage, int32 sizeclass)
{
	uintptr n;
	MSpan *s, *t;
	PageID p;

	// Try in fixed-size lists up to max.
	for(n=npage; n < nelem(h->free); n++) {
		if(!runtime·MSpanList_IsEmpty(&h->free[n])) {
			s = h->free[n].next;
			goto HaveSpan;
		}
	}

	// Best fit in list of large spans.
	if((s = MHeap_AllocLarge(h, npage)) == nil) {
		if(!MHeap_Grow(h, npage))
			return nil;
		if((s = MHeap_AllocLarge(h, npage)) == nil)
			return nil;
	}

HaveSpan:
	// Mark span in use.
	if(s->state != MSpanFree)
		runtime·throw("MHeap_AllocLocked - MSpan not free");
	if(s->npages < npage)
		runtime·throw("MHeap_AllocLocked - bad npages");
	runtime·MSpanList_Remove(s);
	s->state = MSpanInUse;
	mstats.heap_idle -= s->npages<<PageShift;
	mstats.heap_released -= s->npreleased<<PageShift;
	s->npreleased = 0;

	if(s->npages > npage) {
		// Trim extra and put it back in the heap.
		t = runtime·FixAlloc_Alloc(&h->spanalloc);
		mstats.mspan_inuse = h->spanalloc.inuse;
		mstats.mspan_sys = h->spanalloc.sys;
		runtime·MSpan_Init(t, s->start + npage, s->npages - npage);
		s->npages = npage;
		p = t->start;
		if(sizeof(void*) == 8)
			p -= ((uintptr)h->arena_start>>PageShift);
		if(p > 0)
			h->map[p-1] = s;
		h->map[p] = t;
		h->map[p+t->npages-1] = t;
		*(uintptr*)(t->start<<PageShift) = *(uintptr*)(s->start<<PageShift);  // copy "needs zeroing" mark
		t->state = MSpanInUse;
		MHeap_FreeLocked(h, t);
	}

	if(*(uintptr*)(s->start<<PageShift) != 0)
		runtime·memclr((byte*)(s->start<<PageShift), s->npages<<PageShift);

	// Record span info, because gc needs to be
	// able to map interior pointer to containing span.
	s->sizeclass = sizeclass;
	p = s->start;
	if(sizeof(void*) == 8)
		p -= ((uintptr)h->arena_start>>PageShift);
	for(n=0; n<npage; n++)
		h->map[p+n] = s;
	return s;
}

// Allocate a span of exactly npage pages from the list of large spans.
static MSpan*
MHeap_AllocLarge(MHeap *h, uintptr npage)
{
	return BestFit(&h->large, npage, nil);
}

// Search list for smallest span with >= npage pages.
// If there are multiple smallest spans, take the one
// with the earliest starting address.
static MSpan*
BestFit(MSpan *list, uintptr npage, MSpan *best)
{
	MSpan *s;

	for(s=list->next; s != list; s=s->next) {
		if(s->npages < npage)
			continue;
		if(best == nil
		|| s->npages < best->npages
		|| (s->npages == best->npages && s->start < best->start))
			best = s;
	}
	return best;
}

// Try to add at least npage pages of memory to the heap,
// returning whether it worked.
static bool
MHeap_Grow(MHeap *h, uintptr npage)
{
	uintptr ask;
	void *v;
	MSpan *s;
	PageID p;

	// Ask for a big chunk, to reduce the number of mappings
	// the operating system needs to track; also amortizes
	// the overhead of an operating system mapping.
	// Allocate a multiple of 64kB (16 pages).
	npage = (npage+15)&~15;
	ask = npage<<PageShift;
	if(ask < HeapAllocChunk)
		ask = HeapAllocChunk;

	v = runtime·MHeap_SysAlloc(h, ask);
	if(v == nil) {
		if(ask > (npage<<PageShift)) {
			ask = npage<<PageShift;
			v = runtime·MHeap_SysAlloc(h, ask);
		}
		if(v == nil) {
			runtime·printf("runtime: out of memory: cannot allocate %D-byte block (%D in use)\n", (uint64)ask, mstats.heap_sys);
			return false;
		}
	}
	mstats.heap_sys += ask;

	// Create a fake "in use" span and free it, so that the
	// right coalescing happens.
	s = runtime·FixAlloc_Alloc(&h->spanalloc);
	mstats.mspan_inuse = h->spanalloc.inuse;
	mstats.mspan_sys = h->spanalloc.sys;
	runtime·MSpan_Init(s, (uintptr)v>>PageShift, ask>>PageShift);
	p = s->start;
	if(sizeof(void*) == 8)
		p -= ((uintptr)h->arena_start>>PageShift);
	h->map[p] = s;
	h->map[p + s->npages - 1] = s;
	s->state = MSpanInUse;
	MHeap_FreeLocked(h, s);
	return true;
}

// Look up the span at the given address.
// Address is guaranteed to be in map
// and is guaranteed to be start or end of span.
MSpan*
runtime·MHeap_Lookup(MHeap *h, void *v)
{
	uintptr p;

	p = (uintptr)v;
	if(sizeof(void*) == 8)
		p -= (uintptr)h->arena_start;
	return h->map[p >> PageShift];
}

// Look up the span at the given address.
// Address is *not* guaranteed to be in map
// and may be anywhere in the span.
// Map entries for the middle of a span are only
// valid for allocated spans.  Free spans may have
// other garbage in their middles, so we have to
// check for that.
MSpan*
runtime·MHeap_LookupMaybe(MHeap *h, void *v)
{
	MSpan *s;
	PageID p, q;

	if((byte*)v < h->arena_start || (byte*)v >= h->arena_used)
		return nil;
	p = (uintptr)v>>PageShift;
	q = p;
	if(sizeof(void*) == 8)
		q -= (uintptr)h->arena_start >> PageShift;
	s = h->map[q];
	if(s == nil || p < s->start || p - s->start >= s->npages)
		return nil;
	if(s->state != MSpanInUse)
		return nil;
	return s;
}

// Free the span back into the heap.
void
runtime·MHeap_Free(MHeap *h, MSpan *s, int32 acct)
{
	runtime·lock(h);
	runtime·purgecachedstats(m);
	mstats.heap_inuse -= s->npages<<PageShift;
	if(acct) {
		mstats.heap_alloc -= s->npages<<PageShift;
		mstats.heap_objects--;
	}
	MHeap_FreeLocked(h, s);
	runtime·unlock(h);
}

static void
MHeap_FreeLocked(MHeap *h, MSpan *s)
{
	uintptr *sp, *tp;
	MSpan *t;
	PageID p;

	if(s->state != MSpanInUse || s->ref != 0) {
		runtime·printf("MHeap_FreeLocked - span %p ptr %p state %d ref %d\n", s, s->start<<PageShift, s->state, s->ref);
		runtime·throw("MHeap_FreeLocked - invalid free");
	}
	mstats.heap_idle += s->npages<<PageShift;
	s->state = MSpanFree;
	s->unusedsince = 0;
	s->npreleased = 0;
	runtime·MSpanList_Remove(s);
	sp = (uintptr*)(s->start<<PageShift);

	// Coalesce with earlier, later spans.
	p = s->start;
	if(sizeof(void*) == 8)
		p -= (uintptr)h->arena_start >> PageShift;
	if(p > 0 && (t = h->map[p-1]) != nil && t->state != MSpanInUse) {
		tp = (uintptr*)(t->start<<PageShift);
		*tp |= *sp;	// propagate "needs zeroing" mark
		s->start = t->start;
		s->npages += t->npages;
		s->npreleased = t->npreleased; // absorb released pages
		p -= t->npages;
		h->map[p] = s;
		runtime·MSpanList_Remove(t);
		t->state = MSpanDead;
		runtime·FixAlloc_Free(&h->spanalloc, t);
		mstats.mspan_inuse = h->spanalloc.inuse;
		mstats.mspan_sys = h->spanalloc.sys;
	}
	if(p+s->npages < nelem(h->map) && (t = h->map[p+s->npages]) != nil && t->state != MSpanInUse) {
		tp = (uintptr*)(t->start<<PageShift);
		*sp |= *tp;	// propagate "needs zeroing" mark
		s->npages += t->npages;
		s->npreleased += t->npreleased;
		h->map[p + s->npages - 1] = s;
		runtime·MSpanList_Remove(t);
		t->state = MSpanDead;
		runtime·FixAlloc_Free(&h->spanalloc, t);
		mstats.mspan_inuse = h->spanalloc.inuse;
		mstats.mspan_sys = h->spanalloc.sys;
	}

	// Insert s into appropriate list.
	if(s->npages < nelem(h->free))
		runtime·MSpanList_Insert(&h->free[s->npages], s);
	else
		runtime·MSpanList_Insert(&h->large, s);
}

// Release (part of) unused memory to OS.
// Goroutine created at startup.
// Loop forever.
void
runtime·MHeap_Scavenger(void)
{
	MHeap *h;
	MSpan *s, *list;
	uint64 tick, now, forcegc, limit;
	uint32 k, i;
	uintptr released, sumreleased;
	byte *env;
	bool trace;
	Note note;

	// If we go two minutes without a garbage collection, force one to run.
	forcegc = 2*60*1e9;
	// If a span goes unused for 5 minutes after a garbage collection,
	// we hand it back to the operating system.
	limit = 5*60*1e9;
	// Make wake-up period small enough for the sampling to be correct.
	if(forcegc < limit)
		tick = forcegc/2;
	else
		tick = limit/2;

	trace = false;
	env = runtime·getenv("GOGCTRACE");
	if(env != nil)
		trace = runtime·atoi(env) > 0;

	h = &runtime·mheap;
	for(k=0;; k++) {
		runtime·noteclear(&note);
		runtime·entersyscall();
		runtime·notetsleep(&note, tick);
		runtime·exitsyscall();

		runtime·lock(h);
		now = runtime·nanotime();
		if(now - mstats.last_gc > forcegc) {
			runtime·unlock(h);
			runtime·gc(1);
			runtime·lock(h);
			now = runtime·nanotime();
			if (trace)
				runtime·printf("scvg%d: GC forced\n", k);
		}
		sumreleased = 0;
		for(i=0; i < nelem(h->free)+1; i++) {
			if(i < nelem(h->free))
				list = &h->free[i];
			else
				list = &h->large;
			if(runtime·MSpanList_IsEmpty(list))
				continue;
			for(s=list->next; s != list; s=s->next) {
				if(s->unusedsince != 0 && (now - s->unusedsince) > limit) {
					released = (s->npages - s->npreleased) << PageShift;
					mstats.heap_released += released;
					sumreleased += released;
					s->npreleased = s->npages;
					runtime·SysUnused((void*)(s->start << PageShift), s->npages << PageShift);
				}
			}
		}
		runtime·unlock(h);

		if(trace) {
			if(sumreleased > 0)
				runtime·printf("scvg%d: %p MB released\n", k, sumreleased>>20);
			runtime·printf("scvg%d: inuse: %D, idle: %D, sys: %D, released: %D, consumed: %D (MB)\n",
				k, mstats.heap_inuse>>20, mstats.heap_idle>>20, mstats.heap_sys>>20,
				mstats.heap_released>>20, (mstats.heap_sys - mstats.heap_released)>>20);
		}
	}
}

// Initialize a new span with the given start and npages.
void
runtime·MSpan_Init(MSpan *span, PageID start, uintptr npages)
{
	span->next = nil;
	span->prev = nil;
	span->start = start;
	span->npages = npages;
	span->freelist = nil;
	span->ref = 0;
	span->sizeclass = 0;
	span->state = 0;
	span->unusedsince = 0;
	span->npreleased = 0;
}

// Initialize an empty doubly-linked list.
void
runtime·MSpanList_Init(MSpan *list)
{
	list->state = MSpanListHead;
	list->next = list;
	list->prev = list;
}

void
runtime·MSpanList_Remove(MSpan *span)
{
	if(span->prev == nil && span->next == nil)
		return;
	span->prev->next = span->next;
	span->next->prev = span->prev;
	span->prev = nil;
	span->next = nil;
}

bool
runtime·MSpanList_IsEmpty(MSpan *list)
{
	return list->next == list;
}

void
runtime·MSpanList_Insert(MSpan *list, MSpan *span)
{
	if(span->next != nil || span->prev != nil) {
		runtime·printf("failed MSpanList_Insert %p %p %p\n", span, span->next, span->prev);
		runtime·throw("MSpanList_Insert");
	}
	span->next = list->next;
	span->prev = list;
	span->next->prev = span;
	span->prev->next = span;
}


text:
layout: page
show_meta: false
title: "Automatisierung"
teaser: "Vom Commit einer Sourcecode-Änderung bis zum Release eines Software-Systems in Produktion ist es meist ein weiter Weg: Änderungen müssen getestet, Konfigurationen geändert, Patches eingespielt und Datenbankschemata aktualisiert werden. Das Ergebnis sind lange Releasezyklen und \"Bauchschmerzen\" vorm nächsten Release. Gleichzeitig steigen die Erwartungen Ihrer Fachanwender. Unsere Experten helfen die letzte Meile zu bewältigen und zeigen Ihnen die richtigen Praktiken und Werzeuge, um Deplyoment-Prozesse zu automatisieren und ein effektives Monitoring von Anwendungen und Systemen sicherzustellen."
subheadline: "Continuous Delivery, DevOps, APM, Logging"
permalink: "/automatisierung/"
header:
  - title: "Automatisierung"
---

    {% for post in site.categories.automatisierung %}

{{ post.title }}

    {% endfor %}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE HTML>
<?php
$directory = "/var/www/html/test/nic/signs/images/";
$filecount = 0;
$files = glob($directory . "*.jpg");
if ($files){
    $filecount = count($files);
}

?>


text:
#ifndef __HC32_LL_UTILITY_H__
#define __HC32_LL_UTILITY_H__

/* C binding of definitions if building with C++ compiler */
#ifdef __cplusplus
extern "C"
{
#endif

/*******************************************************************************
 * Include files
 ******************************************************************************/
#include "hc32_ll_def.h"

#include "hc32f4xx.h"
#include "hc32f4xx_conf.h"

/**
 * @addtogroup LL_Driver
 * @{
 */

/**
 * @addtogroup LL_UTILITY
 * @{
 */

#if (LL_UTILITY_ENABLE == DDL_ON)

/*******************************************************************************
 * Global type definitions ('typedef')
 ******************************************************************************/

/*******************************************************************************
 * Global pre-processor symbols/macros ('#define')
 ******************************************************************************/

/*******************************************************************************
 * Global variable definitions ('extern')
 ******************************************************************************/

/*******************************************************************************
 * Global function prototypes (definition in C source)
 ******************************************************************************/
/**
 * @addtogroup UTILITY_Global_Functions
 * @{
 */

/* Imprecise delay */
void DDL_DelayMS(uint32_t u32Count);
void DDL_DelayUS(uint32_t u32Count);

/* Systick functions */
int32_t SysTick_Init(uint32_t u32Freq);
void SysTick_Delay(uint32_t u32Delay);
void SysTick_IncTick(void);
uint32_t SysTick_GetTick(void);
void SysTick_Suspend(void);
void SysTick_Resume(void);

#if (LL_PRINT_ENABLE == DDL_ON)
int32_t LL_PrintfInit(void *vpDevice, uint32_t u32Param, int32_t (*pfnPreinit)(void *vpDevice, uint32_t u32Param));
#endif

/* You can add your own assert functions by implement the function DDL_AssertHandler
   definition follow the function DDL_AssertHandler declaration */
#ifdef __DEBUG
#define DDL_ASSERT(x)                                                          \
do {                                                                           \
    ((x) ? (void)0 : DDL_AssertHandler(__FILE__, __LINE__));                   \
} while (0)
/* Exported function */
void DDL_AssertHandler(const char *file, int line);
#else
#define DDL_ASSERT(x)                   ((void)0U)
#endif /* __DEBUG */

#if (LL_PRINT_ENABLE == DDL_ON)
#include <stdio.h>
__WEAKDEF int32_t DDL_ConsoleOutputChar(char cData);

#define DDL_PrintfInit                  (void)LL_PrintfInit
#define DDL_Printf                      (void)printf
#else
#define DDL_PrintfInit(vpDevice, u32Param, pfnPreinit)
#define DDL_Printf(...)
#endif

/**
 * @}
 */

#endif /* LL_UTILITY_ENABLE */

/**
 * @}
 */

/**
 * @}
 */

#ifdef __cplusplus
}
#endif

#endif /* __HC32_LL_UTILITY_H__ */

/*******************************************************************************
 * EOF (not truncated)
 ******************************************************************************/


text:
DEBUG = False
JAVASCRIPT_BUILD_FILE = './static/build/build.js'


text:
from functools import partial
from unittest.mock import call
from tests.testcase import TestCase

from raptiformica.actions.mesh import remove_consul_local_state, CONSUL_STATE_DIRS

class TestRemoveConsulLocalState(TestCase):
    def setUp(self):
        self.rmtree = self.set_up_patch(
            'raptiformica.actions.mesh.rmtree'
        )

    def test_remove_consul_local_state_removes_tree_of_all_state_dirs(self):
        remove_consul_local_state()

        expected_calls = map(partial(call, ignore_errors=True), CONSUL_STATE_DIRS)
        self.assertCountEqual(expected_calls, self.rmtree.mock_calls)


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

package com.google.api.services.connectors.v1.model;

/**
 * Parameters to support Oauth 2.0 Client Credentials Grant Authentication. See
 * https://tools.ietf.org/html/rfc6749#section-1.3.4 for more details.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Connectors API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class Oauth2ClientCredentials extends com.google.api.client.json.GenericJson {

  /**
   * The client identifier.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String clientId;

  /**
   * Secret version reference containing the client secret.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private Secret clientSecret;

  /**
   * The client identifier.
   * @return value or {@code null} for none
   */
  public java.lang.String getClientId() {
    return clientId;
  }

  /**
   * The client identifier.
   * @param clientId clientId or {@code null} for none
   */
  public Oauth2ClientCredentials setClientId(java.lang.String clientId) {
    this.clientId = clientId;
    return this;
  }

  /**
   * Secret version reference containing the client secret.
   * @return value or {@code null} for none
   */
  public Secret getClientSecret() {
    return clientSecret;
  }

  /**
   * Secret version reference containing the client secret.
   * @param clientSecret clientSecret or {@code null} for none
   */
  public Oauth2ClientCredentials setClientSecret(Secret clientSecret) {
    this.clientSecret = clientSecret;
    return this;
  }

  @Override
  public Oauth2ClientCredentials set(String fieldName, Object value) {
    return (Oauth2ClientCredentials) super.set(fieldName, value);
  }

  @Override
  public Oauth2ClientCredentials clone() {
    return (Oauth2ClientCredentials) super.clone();
  }

}


text:
<!doctype html>

    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
    <title>ConstruMED</title>

    <link href="css/bootstrap.css" rel="stylesheet">
    <link href="css/etapa1.css" rel="stylesheet">

    <link rel='stylesheet' media='screen and (min-width: 0px) and (max-width: 450px)' href='css/etapa1-mobile.css' />
    <link rel='stylesheet' media='screen and (min-width: 450px) and (max-width: 745px)' href='css/etapa1-xs.css' />
    <link rel='stylesheet' media='screen and (min-width: 745px) and (max-width: 1200px)' href='css/etapa1-small.css' />
    <link rel='stylesheet' media='screen and (min-width: 1200px)' href='css/etapa1-large.css' />

    <link href='http://fonts.googleapis.com/css?family=Lato:100,300,400,700' rel='stylesheet' type='text/css'>

    <link rel="stylesheet" type="text/css" href="shadowbox/shadowbox.css">

Etapa 1 - Preparação

             <a tabindex="0" id="Material de Apoio" data-placement="bottom" class="leituras-content centralizado-filho" role="button" data-toggle="popover"  title="Material Complementar" data-content="

                        Materiais educacionais digitais: Conceituação/Classificação

                        Design Pedagógico: Conceituação/Fatores/Metas

                        Construtivismo de Piaget

">

                Esta é a primeira etapa da metodologia.

                Aborda a identificação das características principais do MED a ser construído.

                Meta: Preparar as informações iniciais do MED.

                Pauta:

- Definição do tema: criação de um fluxograma com os principais conceitos abordados pelo MED;

- Identificação do perfil do público-alvo;

- Identificação dos conhecimentos, habilidades e atitudes a serem desenvolvidos pelos alunos a partir da abordagem do conteúdo;

- Escolha da modalidade de utilização do MED;

Definição do Público-alvo

                Descrição das características do público-alvo (futuro usuário do MED), tais como: idade, sexo, preferências de lazer dessa faixa etária, programas que assistem, grau de preferência ou não pelo conteúdo a ser abordado pelo MED. Essas informações orientarão o planejamento do conteúdo e do design gráfico, para que seja compatível com as expectativas do usuário, permita a sua identificação e forneça credibilidade ao MED.

Estruturação do Conteúdo

            <a tabindex="0" id="Material de Apoio" data-placement="bottom" class="leituras-content centralizado-filho" role="button" data-toggle="popover"  title="Material Complementar" data-content="

Procedimento para identificar os Conhecimentos, Habilidades e Atitudes a seremdesenvolvidos pelos alunos

">

                Especificação do tema a ser abordado e suas variações. Idealização do nome (título) do MED, com ou sem acompanhamento de siglas.

Dica: a elaboração de um esquema gráfico poderá ajudar a visualizar todos os conceitos envolvidos. Um modelo é disponibilizado em Material de Apoio.

(Exemplo de esquema gráfico do tema de um MED)

                Identificação dos Conhecimentos, Habilidades e Atitudes a ser desenvolvido pelos alunos a partir da utilização do MED (interatividade com o tema em questão).O referido CHA irá orientar a elaboração do conteúdo, que será realizada na Etapa 2 – Planejamento.

Escolha do Modo de Utilização do MED

Especificação da modalidade de uso do MED:

a) A distância – utilizado totalmente a distância, pela web. Nesta modalidade, precisa-se ter o cuidado de fornecer total suporte ao desenvolvimento do conteúdo, além de atenção redobrada nas questões de usabilidade - linguagem clara, boa usabilidade e navegação intuitiva -, pois a trajetória do aluno será basicamente realizada através da interatividade usuário-MED.

b) presencial - utilizado em aulas presenciais. Pode conter elementos que sejam complementados em sala de aula, pela interação com o professor ou a utilização de outros materiais, até mesmo analógicos.

Em ambas as modalidades poderá ser sugerido o uso de um ambiente virtual de aprendizagem (AVA) de apoio. A vantagem é a utilização de ferramentas interativas como bate-papo, fórum e funcionalidades para envio e comentário de atividades, possibilitando trocas com o professor e colegas.

            <input class="next-etapa-singular" type="submit" value="Próxima Etapa">


text:
package com.badlogic.gdx.scenes.scene2d.ui;

import com.esotericsoftware.tablelayout.BaseTableLayout;
import com.esotericsoftware.tablelayout.Cell;
import com.esotericsoftware.tablelayout.Toolkit;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ImmediateModeRenderer;
import com.badlogic.gdx.graphics.glutils.ImmediateModeRenderer10;
import com.badlogic.gdx.graphics.glutils.ImmediateModeRenderer20;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.Group;
import com.badlogic.gdx.scenes.scene2d.ui.TableToolkit.DebugRect;
import com.badlogic.gdx.scenes.scene2d.utils.Layout;
import com.badlogic.gdx.utils.Array;

/** The libgdx implementation to apply a table layout.
 * @author Nathan Sweet */
class TableLayout extends BaseTableLayout<Actor, Table, TableLayout, TableToolkit> {
	Array<DebugRect> debugRects;
	private ImmediateModeRenderer debugRenderer;
	boolean round = true;

	public TableLayout () {
		super((TableToolkit)Toolkit.instance);
	}

	public void layout () {
		Table table = getTable();
		float width = table.getWidth();
		float height = table.getHeight();

		super.layout(0, 0, width, height);

		java.util.List<Cell> cells = getCells();
		if (round) {
			for (int i = 0, n = cells.size(); i < n; i++) {
				Cell c = cells.get(i);
				if (c.getIgnore()) continue;
				float widgetWidth = Math.round(c.getWidgetWidth());
				float widgetHeight = Math.round(c.getWidgetHeight());
				float widgetX = Math.round(c.getWidgetX());
				float widgetY = height - Math.round(c.getWidgetY()) - widgetHeight;
				c.setWidgetX(widgetX);
				c.setWidgetY(widgetY);
				c.setWidgetWidth(widgetWidth);
				c.setWidgetHeight(widgetHeight);
				Actor actor = (Actor)c.getWidget();
				if (actor != null) {
					actor.setX(widgetX);
					actor.setY(widgetY);
					if (actor.getWidth() != widgetWidth || actor.getHeight() != widgetHeight) {
						actor.setWidth(widgetWidth);
						actor.setHeight(widgetHeight);
						if (actor instanceof Layout) ((Layout)actor).invalidate();
					}
				}
			}
		} else {
			for (int i = 0, n = cells.size(); i < n; i++) {
				Cell c = cells.get(i);
				if (c.getIgnore()) continue;
				float widgetWidth = c.getWidgetWidth();
				float widgetHeight = c.getWidgetHeight();
				float widgetX = c.getWidgetX();
				float widgetY = height - c.getWidgetY() - widgetHeight;
				c.setWidgetX(widgetX);
				c.setWidgetY(widgetY);
				c.setWidgetWidth(widgetWidth);
				c.setWidgetHeight(widgetHeight);
				Actor actor = (Actor)c.getWidget();
				if (actor != null) {
					actor.setX(widgetX);
					actor.setY(widgetY);
					if (actor.getWidth() != widgetWidth || actor.getHeight() != widgetHeight) {
						actor.setWidth(widgetWidth);
						actor.setHeight(widgetHeight);
						if (actor instanceof Layout) ((Layout)actor).invalidate();
					}
				}
			}
		}
		// Validate children separately from sizing actors to ensure actors without a cell are validated.
		Array<Actor> children = table.getChildren();
		for (int i = 0, n = children.size; i < n; i++) {
			Actor child = children.get(i);
			if (child instanceof Layout) ((Layout)child).validate();
		}
	}

	/** Invalidates the layout of this widget and every parent widget to the root of the hierarchy. */
	public void invalidateHierarchy () {
		super.invalidate();
		getTable().invalidateHierarchy();
	}

	public void drawDebug (SpriteBatch batch) {
		if (getDebug() == Debug.none || debugRects == null) return;
		if (debugRenderer == null) {
			if (Gdx.graphics.isGL20Available())
				debugRenderer = new ImmediateModeRenderer20(64, false, true, 0);
			else
				debugRenderer = new ImmediateModeRenderer10(64);
		}

		float x = 0, y = 0;
		Actor parent = getTable();
		while (parent != null) {
			if (parent instanceof Group) {
				x += parent.getX();
				y += parent.getY();
			}
			parent = parent.getParent();
		}

		debugRenderer.begin(batch.getProjectionMatrix(), GL10.GL_LINES);
		for (int i = 0, n = debugRects.size; i < n; i++) {
			DebugRect rect = debugRects.get(i);
			float x1 = x + rect.x;
			float y1 = y + rect.y - rect.height;
			float x2 = x1 + rect.width;
			float y2 = y1 + rect.height;
			float r = rect.type == Debug.cell ? 1 : 0;
			float g = rect.type == Debug.widget ? 1 : 0;
			float b = rect.type == Debug.table ? 1 : 0;

			debugRenderer.color(r, g, b, 1);
			debugRenderer.vertex(x1, y1, 0);
			debugRenderer.color(r, g, b, 1);
			debugRenderer.vertex(x1, y2, 0);

			debugRenderer.color(r, g, b, 1);
			debugRenderer.vertex(x1, y2, 0);
			debugRenderer.color(r, g, b, 1);
			debugRenderer.vertex(x2, y2, 0);

			debugRenderer.color(r, g, b, 1);
			debugRenderer.vertex(x2, y2, 0);
			debugRenderer.color(r, g, b, 1);
			debugRenderer.vertex(x2, y1, 0);

			debugRenderer.color(r, g, b, 1);
			debugRenderer.vertex(x2, y1, 0);
			debugRenderer.color(r, g, b, 1);
			debugRenderer.vertex(x1, y1, 0);

			if (debugRenderer.getNumVertices() == 64) {
				debugRenderer.end();
				debugRenderer.begin(batch.getProjectionMatrix(), GL10.GL_LINES);
			}
		}
		debugRenderer.end();
	}
}


text:
.. currentmodule:: nani

.. _tutorial:

Tutorial
========

Creating an array in NumPy requires to provide a ``dtype`` describing the data
type for each element of the array. With Nani, a more explicit syntax is used
to define the data type, as well as other properties such as the default values
and the view types.

As a result, creating a NumPy array through Nani requires an additional step:

    * describe a NumPy array's ``dtype`` with Nani, using the
      :ref:`data types <data_types>` provided, such as :class:`Number`,
      :class:`Array`, :class:`Structure`, and so on.
    * resolve Nani's data type into a format compatible with NumPy, using
      the function :func:`resolve`.
    * use the resolved properties to create the NumPy array through the usual
      `numpy`'s API, and to optionally offer an abstraction layer around
      it.

.. _flat_number_array:

Flat Array of Integers
----------------------

.. code-block:: python

   >>> import numpy
   >>> import nani
   >>> data_type = nani.Number(type=numpy.int32)
   >>> dtype, default, view = nani.resolve(data_type)
   >>> a = numpy.arange(15, dtype=dtype)
   >>> a
   [ 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14]
   >>> type(a)
   <type 'numpy.ndarray'>
   >>> v = view(a)
   >>> v
   [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
   >>> type(v)
   <class 'nani.ArrayView'>

This example is the simplest usage possible, making it a good start to
understand what's going on.

Firstly, an integral data type using :class:`Number` is defined. This is
describing the type of each element of the NumPy array that will be created. By
default, :class:`Number` has a ``type`` value set to ``numpy.float_``,
which needs to be overriden here to describe an integer instead.

Then the :func:`resolve` function returns, amongst other properties, a NumPy
``dtype`` which is directly used to initialize the NumPy array.

The view generated by :func:`resolve` can be used to wrap the whole NumPy
array. Here it is nothing more than a simple emulation of a Python container
[1]_: it has a length, it is iterable, and it can be queried for membership
using the ``in`` keyword. Of course, it is possible to provide a different
interface.

.. _vector2:

Array of Vector2-like Elements
------------------------------

.. code-block:: python

   >>> import numpy
   >>> import nani
   >>> vector2_type = nani.Array(
   ...     element_type=nani.Number(),
   ...     shape=2,
   ...     name='Vector2')
   >>> dtype, default, view = nani.resolve(vector2_type, name='Positions')
   >>> a = numpy.zeros(3, dtype=dtype)
   >>> v = view(a)
   >>> for i, position in enumerate(v):
   ...     position[0] = i + 1
   ...     position[1] = i + 2
   >>> v
   [[1.0, 2.0], [2.0, 3.0], [3.0, 4.0]]
   >>> type(v)
   <class 'nani.Positions'>
   >>> type(v[0])
   <class 'nani.Vector2'>

Vector2 structures are best represented in NumPy using a sub-array of size 2.
The same can be expressed in Nani and the view generated will correctly wrap
the whole NumPy array into a container-like class [1]_, but accessing its
elements will also return yet another object with a similar interface.

.. _vector2_custom_view:

Vector2 Array With a Custom View
--------------------------------

.. code-block:: python

   >>> import math
   >>> import numpy
   >>> import nani
   >>> class Vector2(object):
   ...     __slots__ = ('_data',)
   ...     def __init__(self, data):
   ...         self._data = data
   ...     def __str__(self):
   ...         return "(%s, %s)" % (self.x, self.y)
   ...     @property
   ...     def x(self):
   ...         return self._data[0]
   ...     @x.setter
   ...     def x(self, value):
   ...         self._data[0] = value
   ...     @property
   ...     def y(self):
   ...         return self._data[1]
   ...     @y.setter
   ...     def y(self, value):
   ...         self._data[1] = value
   ...     def length(self):
   ...         return math.sqrt(self.x ** 2 + self.y ** 2)
   >>> vector2_type = nani.Array(
   ...     element_type=nani.Number(),
   ...     shape=2,
   ...     view=Vector2)
   >>> dtype, default, view = nani.resolve(vector2_type, name='Positions')
   >>> a = numpy.array([(1.0, 3.0), (2.0, 4.0)], dtype=dtype)
   >>> v = view(a)
   >>> for position in v:
   ...     position.x *= 1.5
   ...     position.y *= 2.5
   ...     position.length()
   7.64852927039
   10.4403065089
   >>> a
   [[  1.5   7.5]
   [  3.   10. ]]
   >>>  v
   [(1.5, 7.5), (3.0, 10.0)]

This time a custom view for the Vector2 elements is provided. As per the
documentation for the Nani data type :class:`Array`, the view is a class
accepting a single parameter ``data``.

This view defines a custom interface that allows accessing the Vector2 elements
through the ``x`` and ``y`` properties, as well as retrieving the length of
the vector.

.. note::

   To expose a sequence-like interface, similar to what Nani generates
   dynamically, it is necessary to implement it manually.

.. _particle_struct:

Particle Structure
------------------

.. code-block:: python

   >>> import numpy
   >>> import nani
   >>> class Vector2(object):
   ...     __slots__ = ('_data',)
   ...     def __init__(self, data):
   ...         self._data = data
   ...     def __str__(self):
   ...         return "(%s, %s)" % (self.x, self.y)
   ...     @property
   ...     def x(self):
   ...         return self._data[0]
   ...     @x.setter
   ...     def x(self, value):
   ...         self._data[0] = value
   ...     @property
   ...     def y(self):
   ...         return self._data[1]
   ...     @y.setter
   ...     def y(self, value):
   ...         self._data[1] = value
   >>> vector2_type = nani.Array(
   ...     element_type=nani.Number(),
   ...     shape=2,
   ...     view=Vector2)
   >>> particle_type = nani.Structure(
   ...     fields=(
   ...         ('position', vector2_type),
   ...         ('velocity', vector2_type),
   ...         ('size', nani.Number(default=1.0)),
   ...     ),
   ...     name='Particle')
   >>> dtype, default, view = nani.resolve(particle_type, name='Particles')
   >>> a = numpy.array([default] * 2, dtype=dtype)
   >>> v = view(a)
   >>> for i, particle in enumerate(v):
   ...     particle.position.x = (i + 2) * 3
   ...     particle.velocity.y = (i + 2) * 4
   ...     particle.size *= 2
   ...     particle
   Particle(position=(6.0, 0.0), velocity=(0.0, 8.0), size=2.0)
   Particle(position=(9.0, 0.0), velocity=(0.0, 12.0), size=2.0)
   >>> data = nani.get_data(v)
   >>> data['position'] += data['velocity']
   >>> data
   [([6.0, 8.0], [0.0, 8.0], 1.0) ([9.0, 12.0], [0.0, 12.0], 2.0)]

Building upon the previous example, a particle data type is defined in the form
of a NumPy structured array. The Vector2 data type is reused for the
``position`` and ``velocity`` fields, with its custom view still giving access
to the ``x`` and ``y`` properties.

The default values returned by the :func:`resolve` function is also used
here to initialize NumPy's array, ensuring that the ``size`` field is set to
``1.0`` for each particle.

At any time, the NumPy array data can be retrieved from an array view generated
by Nani using the :func:`get_data` function, allowing the user to bypass
the interface provided.

.. _atomic_views:

Atomic Views
------------

When accessing or setting an atomic element—such as a number—in a NumPy array,
its value is directly returned. The views dynamically generated by Nani follow
this principle by default but also offer the possibility to add an extra layer
between the user and the value. One use case could be to provide a more
user-friendly interface to manipulate bit fields (or flags):

   >>> import sys
   >>> import numpy
   >>> import nani
   >>> if sys.version_info[0] == 2:
   ...     def iteritems(d):
   ...         return d.iteritems()
   ... else:
   ...     def iteritems(d):
   ...         return iter(d.items())
   >>> _PLAYER_STATE_ALIVE = 1 << 0
   >>> _PLAYER_STATE_MOVING = 1 << 1
   >>> _PLAYER_STATE_SHOOTING = 1 << 2
   >>> _PLAYER_STATE_LABELS = {
   ...     _PLAYER_STATE_ALIVE: 'alive',
   ...     _PLAYER_STATE_MOVING: 'moving',
   ...     _PLAYER_STATE_SHOOTING: 'shooting'
   ... }
   >>> class PlayerState(object):
   ...     __slots__ = ('_data', '_index')
   ...     def __init__(self, data, index):
   ...         self._data = data
   ...         self._index = index
   ...     def __str__(self):
   ...         value = self._data[self._index]
   ...         return ('(%s)' % (', '.join([
   ...             "'%s'" % (name,)
   ...             for state, name in iteritems(_PLAYER_STATE_LABELS)
   ...             if value & state
   ...         ])))
   ...     @property
   ...     def alive(self):
   ...         return self._data[self._index] & _PLAYER_STATE_ALIVE != 0
   ...     @alive.setter
   ...     def alive(self, value):
   ...         self._data[self._index] |= _PLAYER_STATE_ALIVE
   ...     @property
   ...     def moving(self):
   ...         return self._data[self._index] & _PLAYER_STATE_MOVING != 0
   ...     @moving.setter
   ...     def moving(self, value):
   ...         self._data[self._index] |= _PLAYER_STATE_MOVING
   ...     @property
   ...     def shooting(self):
   ...         return self._data[self._index] & _PLAYER_STATE_SHOOTING != 0
   ...     @shooting.setter
   ...     def shooting(self, value):
   ...         self._data[self._index] |= _PLAYER_STATE_SHOOTING
   >>> vector2_type = nani.Array(
   ...     element_type=nani.Number(),
   ...     shape=2)
   >>> player_type = nani.Structure(
   ...     fields=(
   ...         ('name', nani.String(length=32, default='unnamed')),
   ...         ('position', vector2_type),
   ...         ('state', nani.Number(
   ...             type=numpy.uint8,
   ...             default=_PLAYER_STATE_ALIVE,
   ...             view=PlayerState)),
   ...     ),
   ...     name='Player')
   >>> dtype, default, view = nani.resolve(player_type, name='Players')
   >>> a = numpy.array([default] * 2, dtype=dtype)
   >>> v = view(a)
   >>> first_player = v[0]
   >>> first_player
   Player(name=unnamed, position=[0.0, 0.0], state=('alive'))
   >>> first_player.state.moving = True
   >>> first_player.state
   ('alive', 'moving')
   >>> first_player.state.shooting
   False

The NumPy array created here is made of elements each representing a ``Player``
from a game. The view class ``PlayerState`` allows to manipulate the state
of the player (alive, moving, shooting) by abstracting the bitwise operations
required to read/set the flags from/to the ``numpy.uint8`` data. As per the
documentation of the data type :class:`Number`, the view class' ``__init__``
method is required to accept 2 parameters: ``data`` and ``index``.

----

.. [1] See the ``Collection`` item in the table for
   `Abstract Base Classes for Containers`_.

.. _Abstract Base Classes for Containers:
   https://docs.python.org/library/collections.abc.html


text:
ruboto
======

Ruboto hello world


text:
#include <stdlib.h>
#include <stdio.h>
//#include <sys/io.h>
#include <stdint.h>
#include <memory.h>

typedef uint8_t BYTE;
typedef uint16_t WORD;
typedef uint32_t DWORD;

extern bool LoadTarga(const char *strFileName, WORD &wWidthOfImage, WORD &wHeightOfImage, WORD &wDepthInBytes, BYTE **pData);

#endif // LOADTARGA_H


text:
require 'rubygems'
require 'test/unit'
require 'spec/mini'
require 'mocha'

require 'tissues'

begin
  require 'redgreen'
rescue LoadError
end

class Test::Unit::TestCase
end


text:
const {Helper, Type} = require("@kaoscript/runtime");
module.exports = function() {
	const f = Helper.vcurry(Helper.function((prefix, name) => {
		return prefix + name;
	}, (fn, ...args) => {
		const t0 = Type.isString;
		if(args.length === 2) {
			if(t0(args[0]) && t0(args[1])) {
				return fn.call(this, args[0], args[1]);
			}
		}
		throw Helper.badArgs();
	}), null, "Hello ");
	console.log(Helper.toString(f("White")));
};


text:
#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

/** Connector for bridging communication between Firebase SDKs and FIRMessaging API. */
NS_SWIFT_NAME(MessagingInterop) @protocol FIRMessagingInterop

/**
 * The FCM registration token is used to identify this device so that FCM can send notifications to
 * it. It is associated with your APNs token when the APNs token is supplied, so messages sent to
 * the FCM token will be delivered over APNs.
 *
 * The FCM registration token is sometimes refreshed automatically. In your FIRMessaging delegate,
 * the delegate method `messaging:didReceiveRegistrationToken:` will be called once a token is
 * available, or has been refreshed. Typically it should be called once per app start, but
 * may be called more often if the token is invalidated or updated.
 *
 * Once you have an FCM registration token, you should send it to your application server, so it can
 * use the FCM token to send notifications to your device.
 */
@property(nonatomic, readonly, nullable) NSString *FCMToken NS_SWIFT_NAME(fcmToken);

@end

NS_ASSUME_NONNULL_END


text:
const can = require('can/');

can.append();
can.append = false;


text:
> NOTE: This software is not being actively developed or maintained. Some fork (such as [slater1/BrowseRouter](https://github.com/slater1/BrowseRouter) may be more up-to-date).

# Browser Selector [![Build status](https://ci.appveyor.com/api/projects/status/github/DanTup/BrowserSelector?svg=true)](https://ci.appveyor.com/project/DanTup/browserselector)

Small utility to launch a different browser depending on the domain of the url being launched.

> **[Read the blog post about this here](http://blog.dantup.com/2015/09/simple-windows-browser-selector/)**.

## Setting Up

1. Grab the [latest release](https://github.com/DanTup/BrowserSelector/releases) and extract to a folder somewhere on your PC.
2. Open the BrowserSelector.ini file and customise paths to your browsers and domain patterns (see below).
3. Run `BrowserSelector.exe --register` from this folder to register the tool in Windows as a web browser.
4. Open the "Choose a default browser" screen in Windows (you can simply search for "default browser" from the start screen).
5. Select BrowserSelector as the default browser.

So far, it has been tested on the following:

- Windows 8.1
- Windows 10 Pro

## Usage

    BrowserSelector.exe --register
        Register as web browser

    BrowserSelector.exe --unregister
        Unregister as web browser

    BrowserSelector.exe --create
        Creates a default/sample settings file

    BrowserSelector.exe "http://example.org/"
        Launch example.org

    BrowserSelector.exe [--wait] "http://example.org/"
        Launch example.org, optionally waiting for the browser to close..

    BrowserSelector.exe "http://example.org/" "http://example.com/" [...]
        Launches multiple urls

    BrowserSelector.exe "my bookmark file.url"
        Launches the URL specified in the .url file.

    BrowserSelector.exe "my bookmark file.webloc"
        Launches the URL specified in the .webloc (osx) file.

If you use the --wait flag with multiple urls/files each will open one after the other, in order. Each waits for the previous to close before opening. Using the --wait flag is tricky, though, since many (most) browsers open new urls as a new tab in an existing instance.

To open multiple urls at the same time and wait for them, try the following:

    BrowserSelector.exe "url-or-file" "url-or-file" --wait "url-or-file"

## Config

Config is a poor mans INI file:

```ini
; Default browser is first in list
; Use `{url}` to specify UWP app browser details
[browsers]
chrome = C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
ff = C:\Program Files (x86)\Mozilla Firefox\firefox.exe
edge = microsoft-edge:{url}
ie = iexplore.exe
chrome_prof8 = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory="Profile 8"

; Url preferences.
; Only * is treated as a special character (wildcard).
; Matches are domain-only. Protocols and paths are ignored.
; Use "*.blah.com" for subdomains, not "*blah.com" as that would also match "abcblah.com".
[urls]
microsoft.com = ie
*.microsoft.com = ie

; Use my project-based Chrome profile
myproject.live = chrome_prof8
myproject.local = chrome_prof8

; if the key is wrapped in /'s, it is treated as a regex.
/sites\.google\.com/a/myproject.live\.com/ = chrome_prof8

google.com = chrome
visualstudio.com = edge
```

### Browsers

    chrome = C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
    chrome_prof8 = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory="Profile 8"

- Browser exes must be exact paths to the browser executable.
- Arguments are optional. However, if you provide arguments the exe _must_ be enclosed in quotes.
- If there are no arguments, then the exe paths do not need to be quoted.

**Special cases:**

    edge = microsoft-edge:{url}

- For special browsers, you can include the `{url}` flag. This allows better control over the browser command-line arguments.
- This is required when specifying UWP app's such as Microsoft Edge.
- By default, the url is used as an argument when launching the exe. If the `{url}` flag is specified, it will not be added to the arguments. (In other words, it _won't_ be added twice..)

### Urls

There are two ways to specify an Url. You can use simple wildcards or full regular expressions.

**Simple wildcards:**

    microsoft.com = ie
    *.microsoft.com = ie

- Only `*` is treated as a special character in URL patterns, and matches any characters (equivalent to the `.*` regex syntax).
- Only the domain part (or IP address) of a URL is checked.
- There is no implied wildcard at the start or end, so you must include these if you need them, but be aware that "microsoft.\*" will not only match "microsoft.com" and "microsoft.co.uk" but also "microsoft.somethingelse.com".

**Full regular expressions:**

```regex
	/sites\.google\.com/a/myproject.live\.com/ = chrome_prof8
```

- Full regular expressions are specified by wrapping it in /'s.
- The domain _and_ path are used in the Url comparison.
- The regular expression syntax is based on the Microsoft .NET implementation.


text:
<?php

namespace app\assets;

use yii\web\AssetBundle;
use yii\web\View;

class IESupportAsset extends AssetBundle
{
    public $js = [
        'https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js',
        'https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js'
    ];
    public $jsOptions = [
        'condition'=>'lt IE 9',
        'position' => View::POS_HEAD,
    ];
}


text:
class Message < ActiveRecord::Base
  belongs_to :conversation
  belongs_to :user

  validates :body, presence: true
  validates :conversation_id, presence: true
  validates :user_id, presence: true
end


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    {% if page.url == '/' %}
        <title>{{ site.data.project.title }} - {{ site.data.project.tagline }}</title>
    {% else %}
        <title>{{ page.title }} - {{ site.data.project.title }}</title>
    {% endif %}
    {% if site.data.project.description %}
        <meta name="description" content="{{ site.data.project.description }}">
    {% endif %}
    {% if site.github.url %}
        <base href="{{ site.github.url }}">
    {% endif %}
    {% if site.data.images.favicon %}
        <link rel="icon" type="image/x-icon" href="{{ site.data.images.favicon }}" />
    {% else %}
        <link rel="icon" type="image/x-icon" href="http://theme.thephpleague.com/img/favicon.ico" />
    {% endif %}
    {% if site.data.images.apple_touch %}
        <link rel="apple-touch-icon-precomposed" href="{{ site.data.images.apple_touch }}">
    {% else %}
        <link rel="apple-touch-icon-precomposed" href="http://theme.thephpleague.com/img/apple-touch-icon-precomposed.png">
    {% endif %}
    <link rel="stylesheet" href="http://theme.thephpleague.com/css/all.css">
    <link rel="stylesheet" href="/css/custom.css">

Our Packages:

        {% if site.data.images.logo %}

        {% endif %}
        {{ site.data.project.title }}
        {{ site.data.project.tagline }}

        Presented by The League of Extraordinary Packages

<input type="checkbox" id="menu">

☰ Menu

☰ Hide Menu

    <menu>
        {% for section in site.data.menu %}

{{ section[0] }}

                {% for link in section[1] %}

                        {{ link[0] }}

                {% endfor %}

        {% endfor %}
    </menu>

        {{ content }}

    © Copyright The League of Extraordinary Packages.
    Site design by Jonathan Reinink.

{% if site.data.project.google_analytics_tracking_id %}

{% endif %}


text:
namespace anl { namespace parser
{

class KTraceParser: public ParserBase
{
public:
  KTraceParser( void );
  virtual ~KTraceParser( void )   { this->close(); }

  virtual bool          open( FilePath const &  filepath );
  virtual void          close( void );

  virtual ParserBase&   operator >>( LogMessage&  msg );
  virtual bool          eof( void ) const;

private:
  std::ifstream     log_stream_;

};

}} // namespace anl parser

#endif  // ANL_PARSER_HPP_INCLUDED


text:
export const NOTIFICATION = 'NOTIFICATION';

export default NOTIFICATION;


text:
<!DOCTYPE html>

        <meta charset="utf-8">

        <title>DoA - A Good Day To Die</title>

        <link rel="shortcut icon" href="favicon.png" type="image/png">

        <meta name="description" content="A good day to die - rogue-like text rpg.">
        <meta name="author" content="edloidas@gmail.com">

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

{{meta.franchise}}

{{meta.name}}

                            {{el.name}}

{{submenu.title}}

                                    Game size :

                                        <select ng-model="settings.size"
                                                ng-options="e for e in submenu.settings.size"
                                                ng-change="saveSettings()">
                                        </select>

                                    Color theme :

                                        <select ng-model="settings.theme"
                                                ng-options="e for e in submenu.settings.theme"
                                                ng-change="saveSettings()">
                                        </select>

                                    Fullscreen :

                                        <input type="checkbox"
                                               ng-model="settings.fullscreen"
                                               ng-change="toggleFullscreen()">

                                    {{el.name}} :
                                    {{el.values.toString().replace(',', ', ')}}

Episode #{{$index + 1}}

{{ep.name}}

                        Lorem ipsum

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec imperdiet posuere nisi, et iaculis orci luctus dictum. Nunc dolor tortor, dignissim eu augue non, egestas pharetra nisi. Duis porttitor nibh nulla, a feugiat leo tincidunt id. Nunc aliquam mollis eros rhoncus facilisis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Fusce imperdiet hendrerit est, ut fringilla mauris molestie nec. Sed iaculis nisi ut mauris tincidunt vulputate. Pellentesque auctor porta leo quis ullamcorper. Nulla imperdiet aliquam sem non imperdiet. Nam ultricies eros nibh. Pellentesque congue velit purus. Phasellus lobortis ornare purus, id vestibulum dui pellentesque sed.

Aliquam risus augue, suscipit non bibendum elementum, sollicitudin id diam. Donec at imperdiet massa. Integer sed vulputate massa. Mauris sit amet suscipit dui. Suspendisse iaculis elit porttitor molestie tincidunt. Proin pretium sollicitudin neque eu vehicula. Duis scelerisque nunc at facilisis vehicula.

Duis sodales sagittis mattis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Morbi sit amet dapibus lectus, eu volutpat felis. Aenean consectetur vehicula justo vel laoreet. Cras tempor interdum nulla nec iaculis. Nam quis commodo nulla, sit amet congue est. Pellentesque aliquam tristique libero. Aenean dictum quis urna sit amet accumsan. Pellentesque semper mauris a dolor imperdiet facilisis. Morbi malesuada, augue vel suscipit cursus, libero sem gravida nibh, id vehicula sem urna eu mi. Aenean vestibulum dolor odio. Nunc nisl lacus, aliquam a erat sed, molestie consectetur velit. Cras porttitor interdum felis sit amet aliquam. Aenean iaculis ultricies nulla vel dignissim.

HP57%

IMP3/6

INV12/25

COM

EXT

Target

Use

Talk

Attack

menu


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="info.androidhive.navigationdrawer">

    <uses-permission android:name="android.permission.INTERNET" />

    <!-- To auto-complete the email text field in the login form with the user's emails -->
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.READ_PROFILE" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name="com.c2c.learnopedia.activity.SplashActivity"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.c2c.learnopedia.activity.MainActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar">

            <!--
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            -->
        </activity>
        <activity
            android:name="com.c2c.learnopedia.activity.AboutUsActivity"
            android:label="@string/activity_title_about_us" />
        <activity
            android:name="com.c2c.learnopedia.activity.PrivacyPolicyActivity"
            android:label="@string/activity_title_privacy_policy" />
        <activity
            android:name="com.c2c.learnopedia.activity.LoginActivity"
            android:label="@string/title_activity_login"
            android:screenOrientation="portrait"></activity>
        <activity android:name="com.c2c.learnopedia.activity.Sign_Up_Activity"
            android:label="@string/title_activity_register"
            android:screenOrientation="portrait"
            android:configChanges="keyboardHidden|screenSize|orientation"/>
        <activity android:name="com.c2c.learnopedia.activity.Otp_Activity"
            android:label="@string/title_activity_register"
            android:screenOrientation="portrait"/>
        <activity android:name="com.c2c.learnopedia.activity.ListOfCoursesActivity"
            android:label="@string/title_activity_register"
            android:screenOrientation="portrait"/>
    </application>

</manifest>


text:
package edu.stanford.nlp.parser.lexparser;

import edu.stanford.nlp.trees.PennTreebankLanguagePack;
import edu.stanford.nlp.fsm.TransducerGraph;
import edu.stanford.nlp.fsm.QuasiDeterminizer;
import edu.stanford.nlp.fsm.AutomatonMinimizer;
import edu.stanford.nlp.fsm.FastExactAutomatonMinimizer;

import java.util.List;

/**
 * @author Teg Grenager (grenager@cs.stanford.edu)
 */
public class ExactGrammarCompactor extends GrammarCompactor {

  TransducerGraph.GraphProcessor quasiDeterminizer = new QuasiDeterminizer();
  AutomatonMinimizer minimizer = new FastExactAutomatonMinimizer();
  TransducerGraph.NodeProcessor ntsp = new TransducerGraph.SetToStringNodeProcessor(new PennTreebankLanguagePack());
  TransducerGraph.NodeProcessor otsp = new TransducerGraph.ObjectToSetNodeProcessor();
  TransducerGraph.ArcProcessor isp = new TransducerGraph.InputSplittingProcessor();
  TransducerGraph.ArcProcessor ocp = new TransducerGraph.OutputCombiningProcessor();
  private boolean saveGraphs; // = false;

  public ExactGrammarCompactor(Options op,
                               boolean saveGraphs, boolean verbose) {
    super(op);
    this.saveGraphs = saveGraphs;
    this.verbose = verbose;
    outputType = NORMALIZED_LOG_PROBABILITIES;
  }

  @Override
  protected TransducerGraph doCompaction(TransducerGraph graph, List l1, List l3) {
    TransducerGraph result = graph;
    if (saveGraphs) {
      writeFile(result, "unminimized", (String) result.getEndNodes().iterator().next());
    }
    result = quasiDeterminizer.processGraph(result);
    result = new TransducerGraph(result, ocp); // combine outputs into inputs
    result = minimizer.minimizeFA(result); // minimize the thing
    //result = new  TransducerGraph(graph, otsp); // for debugging
    result = new TransducerGraph(result, ntsp);  // pull out strings from sets returned by minimizer
    result = new TransducerGraph(result, isp); // split outputs from inputs
    if (saveGraphs) {
      writeFile(result, "exactminimized", (String) result.getEndNodes().iterator().next());
    }
    // for debugging do comparison of the paths accepted by graph and result
    //System.err.println(TransducerGraph.testGraphPaths(graph, result, 100));
    return result;
  }

}


text:
package node

import (
	"github.com/Telmate/proxmox-api-go/cli"
	"github.com/spf13/cobra"
)

var shutdown_nodeCmd = &cobra.Command{
	Use:   "shutdown NODE",
	Short: "Shuts the specified node down",
	Args:  cobra.ExactArgs(1),
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		node := cli.RequiredIDset(args, 0, "node")
		c := cli.NewClient()
		_, err = c.ShutdownNode(node)
		if err != nil {
			return
		}
		cli.RootCmd.Printf("Node %s is shutting down", node)
		return
	},
}

func init() {
	nodeCmd.AddCommand(shutdown_nodeCmd)
}


text:
package ru.job4j.servletsform;

import org.apache.commons.dbcp.BasicDataSource;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;

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

/**
 * Class AdvancedUserStore описывает хранилище пользователей.
 * @author Timur Kapkaev (tikmur.kap@yandex.ru)
 * @version $ID$
 * @since 09.11.2017
 * @param <E> - тип объекта с которым работает база данных
 * */
public abstract class AdvancedStore<E extends ICRUDQueries> {

    /** логгер. */
    private static final Logger LOGGER = LogManager.getLogger(AdvancedStore.class);

    /** пул соединений. */
    private  BasicDataSource connectionPool;

    /** таблица пользователей. */
    private String table;

    /** Преобразователь результата запроса в объект. */
    private final IResultSetConverter<E> converter;

    /**
     * Конструктор класса AdvancedUserStore.
     * @param converter - преобразователь результата запроса в объект.
     * */
    public AdvancedStore(IResultSetConverter<E> converter) {
        this.converter = converter;
        try {
            this.connectionPool = createConnectionPool();
            this.table = extractTableName();
        } catch (IOException e) {
            LOGGER.error(e);
        }
    }

    /**
     * Возвращает пул соединений.
     * @return возвращает пул соединений.
     * @throws IOException - ошибка конфигурационного файла.
     * */
    private BasicDataSource createConnectionPool() throws IOException {
        InputStream propertyFile = AdvancedStore.class.getResourceAsStream("/config.properties");
        Properties properties = new Properties();
        properties.load(propertyFile);
        String url = properties.getProperty("url");
        String user = properties.getProperty("user");
        String password = properties.getProperty("password");

        BasicDataSource pool = new BasicDataSource();
        pool.setDriverClassName("org.postgresql.Driver");
        pool.setUrl(url);
        pool.setUsername(user);
        pool.setPassword(password);
        return pool;
    }

    /**
     * Извлекает имя таблицы пользователей из конфигурационного файла.
     * @return имя таблицы пользователей
     * @throws IOException - ошибка конфигурационного файла
     * */
    protected abstract String extractTableName() throws IOException;
    /**
     * Возвращает соединение с базой данных.
     * @return соединение с базой данных.
     * @throws SQLException - ошибка соединения
     * */
    protected Connection getConnection() throws SQLException {
        return connectionPool.getConnection();
    }

    /**
     * Возвращает всех пользователей из базы данных.
     * @return пользователи базы данных.
     * @throws SQLException - ошибка запроса
     * */
    public List<E> getAllUsers() throws SQLException {
        List<E> users = new ArrayList<>();
        try (Connection con = getConnection();
             Statement st = con.createStatement();
             ResultSet rs = st.executeQuery(String.format("SELECT * FROM %s;", table))) {
            while (rs.next()) {
                users.add(converter.apply(rs));
            }
        }
        return users;
    }

    /**
     * Добавление пользователя.
     * @param user - пользователь
     * @return true, если пользователь был добавлен
     * @throws SQLException - ошибка SQL запроса
     * */
    public boolean insert(E user) throws SQLException {
        boolean result;
        try (Connection con = getConnection();
             PreparedStatement ps = user.insert(con, table)) {
            try {
                ps.execute();
                result = true;
            } catch (SQLException e) {
                result = false;
            }
        }
        return result;
    }

    /**
     * Обновление пользователя.
     * @param user - обновленныйй пользователь
     * @throws SQLException - ошибка SQL запроса
     * */

    public void update(E user) throws SQLException {
        try (Connection con = getConnection();
             PreparedStatement ps = user.update(con, table)) {
             ps.execute();
        }
    }

    /**
     * Удаление пользователя.
     * @param user - удаляемый пользователь
     * @throws SQLException - ошибка SQL запроса
     * */
    public void delete(E user) throws SQLException {
        try (Connection con = getConnection();
             PreparedStatement ps = user.delete(con, table)) {
            ps.execute();
        }
    }

    /**
     * Ищет пользователя по первичному ключу.
     * @param primaryKey - первичный ключ.
     * @return объект, соответствующий первичному ключу (null - если объект не найден)
     * @throws SQLException - ошибка поиска пользователя по первичному ключу
     * */
    public E searchByPrimaryKey(PrimaryKey primaryKey) throws SQLException {
        try (Connection connection = getConnection();
             PreparedStatement ps = primaryKey.searchQuery(connection, table);
             ResultSet rs = ps.executeQuery()) {
            return rs.next() ? converter.apply(rs) : null;
        }
    }

    /**
     * Очищает таблицу с пользователями.
     * @throws SQLException - ошибка удаления пользователей
     * */
    public void clearUsers() throws SQLException {
        try (Connection con = getConnection();
             Statement st = con.createStatement()
        ) {
            st.execute(String.format("DELETE FROM %s;", table));
        }
    }
}


text:
/* cocos2d for iPhone
 *
 * http://www.cocos2d-iphone.org
 *
 *
 * Inflates either zlib or gzip deflated memory. The inflated memory is
 * expected to be freed by the caller.
 *
 * inflateMemory_ based on zlib example code
 *		http://www.zlib.net
 *
 * Some ideas were taken from:
 *		http://themanaworld.org/
 *		from the mapreader.cpp file
 */

#import <Availability.h>

#import <zlib.h>
#import <stdlib.h>
#import <assert.h>
#import <stdio.h>

#import "ZipUtils.h"
#import "CCFileUtils.h"
#import "../ccMacros.h"

// memory in iPhone is precious
// Should buffer factor be 1.5 instead of 2 ?
#define BUFFER_INC_FACTOR (2)

static int inflateMemoryWithHint(unsigned char *in, unsigned int inLength, unsigned char **out, unsigned int *outLength, unsigned int outLenghtHint )
{
	/* ret value */
	int err = Z_OK;

	int bufferSize = outLenghtHint;
	*out = (unsigned char*) malloc(bufferSize);

    z_stream d_stream; /* decompression stream */
    d_stream.zalloc = (alloc_func)0;
    d_stream.zfree = (free_func)0;
    d_stream.opaque = (voidpf)0;

    d_stream.next_in  = in;
    d_stream.avail_in = inLength;
	d_stream.next_out = *out;
	d_stream.avail_out = bufferSize;

	/* window size to hold 256k */
	if( (err = inflateInit2(&d_stream, 15 + 32)) != Z_OK )
		return err;

    for (;;) {
        err = inflate(&d_stream, Z_NO_FLUSH);

		if (err == Z_STREAM_END)
			break;

		switch (err) {
			case Z_NEED_DICT:
				err = Z_DATA_ERROR;
			case Z_DATA_ERROR:
			case Z_MEM_ERROR:
				inflateEnd(&d_stream);
				return err;
		}

		// not enough memory ?
		if (err != Z_STREAM_END) {

			unsigned char *tmp = realloc(*out, bufferSize * BUFFER_INC_FACTOR);

			/* not enough memory, ouch */
			if (! tmp ) {
				CCLOG(@"cocos2d: ZipUtils: realloc failed");
				inflateEnd(&d_stream);
				return Z_MEM_ERROR;
			}
			/* only assign to *out if tmp is valid. it's not guaranteed that realloc will reuse the memory */
			*out = tmp;

			d_stream.next_out = *out + bufferSize;
			d_stream.avail_out = bufferSize;
			bufferSize *= BUFFER_INC_FACTOR;
		}
    }

	*outLength = bufferSize - d_stream.avail_out;
    err = inflateEnd(&d_stream);
	return err;
}

int ccInflateMemoryWithHint(unsigned char *in, unsigned int inLength, unsigned char **out, unsigned int outLengthHint )
{
	unsigned int outLength = 0;
	int err = inflateMemoryWithHint(in, inLength, out, &outLength, outLengthHint );

	if (err != Z_OK || *out == NULL) {
		if (err == Z_MEM_ERROR)
			CCLOG(@"cocos2d: ZipUtils: Out of memory while decompressing map data!");

		else if (err == Z_VERSION_ERROR)
			CCLOG(@"cocos2d: ZipUtils: Incompatible zlib version!");

		else if (err == Z_DATA_ERROR)
			CCLOG(@"cocos2d: ZipUtils: Incorrect zlib compressed data!");

		else
			CCLOG(@"cocos2d: ZipUtils: Unknown error while decompressing map data!");

		free(*out);
		*out = NULL;
		outLength = 0;
	}

	return outLength;
}

int ccInflateMemory(unsigned char *in, unsigned int inLength, unsigned char **out)
{
	// 256k for hint
	return ccInflateMemoryWithHint(in, inLength, out, 256 * 1024 );
}

int ccInflateGZipFile(const char *path, unsigned char **out)
{
	int len;
	unsigned int offset = 0;

	NSCAssert( out, @"ccInflateGZipFile: invalid 'out' parameter");
	NSCAssert( &*out, @"ccInflateGZipFile: invalid 'out' parameter");

	gzFile inFile = gzopen(path, "rb");
	if( inFile == NULL ) {
		CCLOG(@"cocos2d: ZipUtils: error open gzip file: %s", path);
		return -1;
	}

	/* 512k initial decompress buffer */
	int bufferSize = 512 * 1024;
	unsigned int totalBufferSize = bufferSize;

	*out = malloc( bufferSize );
	if( ! out ) {
		CCLOG(@"cocos2d: ZipUtils: out of memory");
		return -1;
	}

	for (;;) {
		len = gzread(inFile, *out + offset, bufferSize);
		if (len < 0) {
			CCLOG(@"cocos2d: ZipUtils: error in gzread");
			free( *out );
			*out = NULL;
			return -1;
		}
		if (len == 0)
			break;

		offset += len;

		// finish reading the file
		if( len < bufferSize )
			break;

		bufferSize *= BUFFER_INC_FACTOR;
		totalBufferSize += bufferSize;
		unsigned char *tmp = realloc(*out, totalBufferSize );

		if( ! tmp ) {
			CCLOG(@"cocos2d: ZipUtils: out of memory");
			free( *out );
			*out = NULL;
			return -1;
		}

		*out = tmp;
	}

	if (gzclose(inFile) != Z_OK)
		CCLOG(@"cocos2d: ZipUtils: gzclose failed");

	return offset;
}

int ccInflateCCZFile(const char *path, unsigned char **out)
{
	NSCAssert( out, @"ccInflateCCZFile: invalid 'out' parameter");
	NSCAssert( &*out, @"ccInflateCCZFile: invalid 'out' parameter");

	// load file into memory
	unsigned char *compressed = NULL;
	NSInteger fileLen  = ccLoadFileIntoMemory( path, &compressed );
	if( fileLen < 0 ) {
		CCLOG(@"cocos2d: Error loading CCZ compressed file");
		return -1;
	}

	struct CCZHeader *header = (struct CCZHeader*) compressed;

	// verify header
	if( header->sig[0] != 'C' || header->sig[1] != 'C' || header->sig[2] != 'Z' || header->sig[3] != '!' ) {
		CCLOG(@"cocos2d: Invalid CCZ file");
		free(compressed);
		return -1;
	}

	// verify header version
	uint16_t version = CFSwapInt16BigToHost( header->version );
	if( version > 2 ) {
		CCLOG(@"cocos2d: Unsupported CCZ header format");
		free(compressed);
		return -1;
	}

	// verify compression format
	if( CFSwapInt16BigToHost(header->compression_type) != CCZ_COMPRESSION_ZLIB ) {
		CCLOG(@"cocos2d: CCZ Unsupported compression method");
		free(compressed);
		return -1;
	}

	uint32_t len = CFSwapInt32BigToHost( header->len );

	*out = malloc( len );
	if(! *out )
	{
		CCLOG(@"cocos2d: CCZ: Failed to allocate memory for texture");
		free(compressed);
		return -1;
	}

	uLongf destlen = len;
	uLongf source = (uLongf) compressed + sizeof(*header);
	int ret = uncompress(*out, &destlen, (Bytef*)source, fileLen - sizeof(*header) );

	free( compressed );

	if( ret != Z_OK )
	{
		CCLOG(@"cocos2d: CCZ: Failed to uncompress data");
		free( *out );
		*out = NULL;
		return -1;
	}

	return len;
}


text:
int (setsockopt)(int sockfd, int level, int optname, const void *optval, socklen_t optlen)
#else
LONG (setsockopt)(LONG sockfd, LONG level, LONG optname, const void *optval, LONG optlen)
#endif
{
#ifdef __amigaos4__
  GETISOCKET();
  if(ISocket) return ISocket->setsockopt(sockfd, level, optname, (void *)optval, optlen);
  else return -1;
#elif __MORPHOS__
  GETSOCKET();
  if(SocketBase) return setsockopt(sockfd, level, optname, optval, optlen);
  else return -1;
#else
	GETSTATE();

	if (state->SocketBase)
	{
		switch(state->TCPIPStackType)
		{
			case TCPIP_Roadshow:
			case TCPIP_Miami:
			case TCPIP_AmiTCP:
			case TCPIP_MLink:
				return amitcp_SetSockOpt(sockfd, level, optname, optval, optlen);
				break;
			case TCPIP_IN225:
				return in225_setsockopt(sockfd, level, optname, optval, optlen);
				break;
			case TCPIP_Termite:
				return termite_setsockopt(sockfd, level, optname, (void *)optval, optlen);
				break;
		}
	}

	return(-1);
#endif
}


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="oval"
       android:useLevel="false">
    <solid android:color="@color/positive"/>
    <!--solid表示远的填充色、stroke则代表远的边框线、-->
    <solid android:color="@color/positive"/>
    <size
        android:width="15dp"
        android:height="15dp"/>
</shape>