tinymce.addI18n('nb_NO',{
"Redo": "Gj\u00f8r om",
"Undo": "Angre",
"Cut": "Klipp ut",
"Copy": "Kopier",
"Paste": "Lim inn",
"Select all": "Marker alt",
"New document": "Nytt dokument",
"Ok": "Ok",
"Cancel": "Avbryt",
"Visual aids": "Visuelle hjelpemidler",
"Bold": "Fet",
"Italic": "Kursiv",
"Underline": "Understreking",
"Strikethrough": "Gjennomstreking",
"Superscript": "Hevet skrift",
"Subscript": "Senket skrift",
"Clear formatting": "Fjern formateringer",
"Align left": "Venstrejuster",
"Align center": "Midtstill",
"Align right": "H\u00f8yrejuster",
"Justify": "Blokkjuster",
"Bullet list": "Punktliste",
"Numbered list": "Nummerliste",
"Decrease indent": "Reduser innrykk",
"Increase indent": "\u00d8k innrykk",
"Close": "Lukk",
"Formats": "Stiler",
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Nettleseren din st\u00f8tter ikke direkte tilgang til utklippsboken. Bruk istedet tastatursnarveiene Ctrl+X\/C\/V.",
"Headers": "Overskrifter",
"Header 1": "Overskrift 1",
"Header 2": "Overskrift 2",
"Header 3": "Overskrift 3",
"Header 4": "Overskrift 4",
"Header 5": "Overskrift 5",
"Header 6": "Overskrift 6",
"Headings": "Overskrifter",
"Heading 1": "Overskrift 1",
"Heading 2": "Overskrift 2",
"Heading 3": "Overskrift 3",
"Heading 4": "Overskrift 4",
"Heading 5": "Overskrift 5",
"Heading 6": "Overskrift 6",
"Preformatted": "Forh\u00e5ndsformatert",
"Div": "Div",
"Pre": "Pre",
"Code": "Kode",
"Paragraph": "Avsnitt",
"Blockquote": "Blockquote",
"Inline": "Innkapslet ",
"Blocks": "Blokker",
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Lim inn er n\u00e5 i ren-tekst modus. Kopiert innhold vil bli limt inn som ren tekst inntil du sl\u00e5r av dette valget.",
"Fonts": "Fonter",
"Font Sizes": "Fontst\u00f8rrelser",
"Class": "Klasse",
"Browse for an image": "S\u00f8k etter bilde",
"OR": "ELLER",
"Drop an image here": "Slipp et bilde her",
"Upload": "Last opp",
"Block": "Blokk",
"Align": "Juster",
"Default": "Normal",
"Circle": "\u00c5pen sirkel",
"Disc": "Fylt sirkel",
"Square": "Fylt firkant",
"Lower Alpha": "Minuskler",
"Lower Greek": "Greske minuskler",
"Lower Roman": "Romerske minuskler",
"Upper Alpha": "Versaler",
"Upper Roman": "Romerske versaler",
"Anchor...": "Lenke",
"Name": "Navn",
"Id": "Id",
"Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.": "Id burde starte med en bokstav, bare fulgt av bokstaver, nummer, streker, punktum, koloner eller understreker.",
"You have unsaved changes are you sure you want to navigate away?": "Du har ikke arkivert endringene. Vil du fortsette uten \u00e5 arkivere?",
"Restore last draft": "Gjenopprett siste utkast",
"Special characters...": "Spesialtegn",
"Source code": "Kildekode",
"Insert\/Edit code sample": "Sett inn\/endre kodeeksempel",
"Language": "Spr\u00e5k",
"Code sample...": "Kodeeksempel",
"Color Picker": "Fargevelger",
"R": "R",
"G": "G",
"B": "B",
"Left to right": "Venstre til h\u00f8yre",
"Right to left": "H\u00f8yre til venstre",
"Emoticons...": "Emoticons..",
"Metadata and Document Properties": "Metadata og dokumentverdier",
"Title": "Tittel",
"Keywords": "N\u00f8kkelord",
"Description": "Beskrivelse",
"Robots": "Roboter",
"Author": "Forfatter",
"Encoding": "Tegnkoding",
"Fullscreen": "Fullskjerm",
"Action": "Handling",
"Shortcut": "Snarvei",
"Help": "Hjelp",
"Address": "Adresse",
"Focus to menubar": "Fokus p\u00e5 menylinje",
"Focus to toolbar": "Fokus p\u00e5 verkt\u00f8ylinje",
"Focus to element path": "Fokus p\u00e5 elementsti",
"Focus to contextual toolbar": "Fokus p\u00e5 kontekstuell verkt\u00f8ylinje",
"Insert link (if link plugin activated)": "Sett inn lenke (dersom lenketillegg er aktivert)",
"Save (if save plugin activated)": "Lagre (dersom lagretillegg er aktivert)",
"Find (if searchreplace plugin activated)": "Finn (dersom tillegg for s\u00f8k og erstatt er aktivert)",
"Plugins installed ({0}):": "Installerte tillegg ({0}):",
"Premium plugins:": "Premiumtillegg:",
"Learn more...": "Les mer ...",
"You are using {0}": "Du bruker {0}",
"Plugins": "Tillegg",
"Handy Shortcuts": "Nyttige snarveier",
"Horizontal line": "Horisontal linje",
"Insert\/edit image": "Sett inn\/endre bilde",
"Image description": "Bildebeskrivelse",
"Source": "Bildelenke",
"Dimensions": "Dimensjoner",
"Constrain proportions": "Behold proporsjoner",
"General": "Generelt",
"Advanced": "Avansert",
"Style": "Stil",
"Vertical space": "Vertikal marg",
"Horizontal space": "Horisontal marg",
"Border": "Ramme",
"Insert image": "Sett inn bilde",
"Image...": "Bilde...",
"Image list": "Bildeliste",
"Rotate counterclockwise": "Roter mot venstre",
"Rotate clockwise": "Roter mot h\u00f8yre",
"Flip vertically": "Speilvend vertikalt",
"Flip horizontally": "Speilvend horisontalt",
"Edit image": "Rediger bilde",
"Image options": "Bilde innstillinger",
"Zoom in": "Zoom inn",
"Zoom out": "Zoom ut",
"Crop": "Beskj\u00e6r",
"Resize": "Skaler",
"Orientation": "Orientering",
"Brightness": "Lysstyrke",
"Sharpen": "Skarphet",
"Contrast": "Kontrast",
"Color levels": "Fargeniv\u00e5",
"Gamma": "Gamma",
"Invert": "Inverter",
"Apply": "Utf\u00f8r",
"Back": "Tilbake",
"Insert date\/time": "Sett inn dato\/tid",
"Date\/time": "Dato\/tid",
"Insert\/Edit Link": "Sett inn \/ Rediger lenke",
"Insert\/edit link": "Sett inn\/endre lenke",
"Text to display": "Tekst som skal vises",
"Url": "Url",
"Open link in...": "\u00c5pne lenke i..",
"Current window": "N\u00e5v\u00e6rende vindu",
"None": "Ingen",
"New window": "Nytt vindu",
"Remove link": "Fjern lenke",
"Anchors": "Anker",
"Link...": "Lenke...",
"Paste or type a link": "Lim inn eller skriv en lenke",
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "Oppgitte URL ser ut til \u00e5 v\u00e6re en epost-adresse. \u00d8nsker du \u00e5 sette inn p\u00e5krevet mailto: prefiks forran epost-adressen?",
"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "Oppgitt URL ser ut til \u00e5 v\u00e6re en e-postadresse. \u00d8nsker du \u00e5 sette inn p\u00e5krevd mailto:-prefiks foran e-postadressen?",
"Link list": "Lenkeliste",
"Insert video": "Sett inn video",
"Insert\/edit video": "Sett inn\/rediger video",
"Insert\/edit media": "Sett inn\/endre media",
"Alternative source": "Alternativ kilde",
"Alternative source URL": "Alternativ kilde URL",
"Media poster (Image URL)": "Mediaposter (bilde-URL)",
"Paste your embed code below:": "Lim inn  inkluderings-koden nedenfor",
"Embed": "Inkluder",
"Media...": "Media..",
"Nonbreaking space": "Hardt mellomrom",
"Page break": "Sideskifte",
"Paste as text": "Lim inn som tekst",
"Preview": "Forh\u00e5ndsvisning",
"Print...": "Skriv ut...",
"Save": "Arkiver",
"Find": "Finn",
"Replace with": "Erstatt med",
"Replace": "Erstatt",
"Replace all": "Erstatt alle",
"Previous": "Forrige",
"Next": "Neste",
"Find and replace...": "Finn og erstatt...",
"Could not find the specified string.": "Kunne ikke finne den spesifiserte teksten",
"Match case": "Match store og sm\u00e5 bokstaver",
"Find whole words only": "Finn kun hele ord",
"Spell check": "Stavekontroll",
"Ignore": "Ignorer",
"Ignore all": "Ignorer alle",
"Finish": "Avslutt",
"Add to Dictionary": "Legg til i ordliste",
"Insert table": "Sett inn tabell",
"Table properties": "Tabell egenskaper",
"Delete table": "Slett tabell",
"Cell": "Celle",
"Row": "Rad",
"Column": "Kolonne",
"Cell properties": "Celle egenskaper",
"Merge cells": "Sl\u00e5 sammen celler",
"Split cell": "Splitt celle",
"Insert row before": "Sett inn rad f\u00f8r",
"Insert row after": "Sett in rad etter",
"Delete row": "Slett rad",
"Row properties": "Rad egenskaper",
"Cut row": "Klipp ut rad",
"Copy row": "Kopier rad",
"Paste row before": "Lim inn rad f\u00f8r",
"Paste row after": "Lim inn rad etter",
"Insert column before": "Sett inn kolonne f\u00f8r",
"Insert column after": "Sett inn kolonne etter",
"Delete column": "Slett kolonne",
"Cols": "Kolonner",
"Rows": "Rader",
"Width": "Bredde",
"Height": "H\u00f8yde",
"Cell spacing": "Celleavstand",
"Cell padding": "Cellemarg",
"Show caption": "Vis bildetekst",
"Left": "Venstre",
"Center": "Midtstilt",
"Right": "H\u00f8yre",
"Cell type": "Celletype",
"Scope": "Omfang",
"Alignment": "Justering",
"H Align": "H Justering",
"V Align": "V Justering",
"Top": "Topp",
"Middle": "Midten",
"Bottom": "Bunn",
"Header cell": "Topptekst-celle",
"Row group": "Radgruppe",
"Column group": "Kolonnegruppe",
"Row type": "Rad-type",
"Header": "Topptekst",
"Body": "Br\u00f8dtekst",
"Footer": "Bunntekst",
"Border color": "Rammefarge",
"Insert template...": "Sett inn mal..",
"Templates": "Maler",
"Template": "Mal",
"Text color": "Tekstfarge",
"Background color": "Bakgrunnsfarge",
"Custom...": "Tilpass...",
"Custom color": "Tilpasset farge",
"No color": "Ingen farge",
"Remove color": "Fjern farge",
"Table of Contents": "Innholdsfortegnelse",
"Show blocks": "Vis blokker",
"Show invisible characters": "Vis skjulte tegn",
"Word count": "Ordtelling",
"Words: {0}": "Antall ord: {0}",
"{0} words": "{0} ord",
"File": "Arkiv",
"Edit": "Rediger",
"Insert": "Sett inn",
"View": "Vis",
"Format": "Format",
"Table": "Tabell",
"Tools": "Verkt\u00f8y",
"Powered by {0}": "Redigert med {0}",
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Tekstredigering. Tast ALT-F9 for meny. Tast ALT-F10 for verkt\u00f8ys-rader. Tast ALT-0 for hjelp.",
"Image title": "Bildetittel",
"Border width": "Bordbredde",
"Border style": "Bordstil",
"Error": "Feil",
"Warn": "Advarsel",
"Valid": "Gyldig",
"To open the popup, press Shift+Enter": "For \u00e5 \u00e5pne popup, trykk Shift+Enter",
"Rich Text Area. Press ALT-0 for help.": "Rik-tekstomr\u00e5de. Trykk ALT-0 for hjelp.",
"System Font": "Systemfont",
"Failed to upload image: {0}": "Opplasting av bilde feilet: {0}",
"Failed to load plugin: {0} from url {1}": "Kunne ikke laste tillegg: {0} from url {1}",
"Failed to load plugin url: {0}": "Kunne ikke laste tillegg url: {0}",
"Failed to initialize plugin: {0}": "Kunne ikke initialisere tillegg: {0}",
"example": "eksempel",
"Search": "S\u00f8k",
"All": "Alle",
"Currency": "Valuta",
"Text": "Tekst",
"Quotations": "Sitater",
"Mathematical": "Matematisk",
"Extended Latin": "Utvidet latin",
"Symbols": "Symboler",
"Arrows": "Piler",
"User Defined": "Brukerdefinert",
"dollar sign": "dollartegn",
"currency sign": "valutasymbol",
"euro-currency sign": "Euro-valutasymbol",
"colon sign": "kolon-symbol",
"cruzeiro sign": "cruzeiro-symbol",
"french franc sign": "franske franc-symbol",
"lira sign": "lire-symbol",
"mill sign": "mill-symbol",
"naira sign": "naira-symbol",
"peseta sign": "peseta-symbol",
"rupee sign": "rupee-symbol",
"won sign": "won-symbol",
"new sheqel sign": "Ny sheqel-symbol",
"dong sign": "dong-symbol",
"kip sign": "kip-symbol",
"tugrik sign": "tugrik-symbol",
"drachma sign": "drachma-symbol",
"german penny symbol": "tysk penny-symbol",
"peso sign": "peso-symbol",
"guarani sign": "quarani-symbol",
"austral sign": "austral-symbol",
"hryvnia sign": "hryvina-symbol",
"cedi sign": "credi-symbol",
"livre tournois sign": "livre tournois-symbol",
"spesmilo sign": "spesmilo-symbol",
"tenge sign": "tenge-symbol",
"indian rupee sign": "indisk rupee-symbol",
"turkish lira sign": "tyrkisk lire-symbol",
"nordic mark sign": "nordisk mark-symbol",
"manat sign": "manat-symbol",
"ruble sign": "ruble-symbol",
"yen character": "yen-symbol",
"yuan character": "yuan-symbol",
"yuan character, in hong kong and taiwan": "yuan-symbol, i Hongkong og Taiwan",
"yen\/yuan character variant one": "yen\/yuan-symbol variant en",
"Loading emoticons...": "Laster emoticons..",
"Could not load emoticons": "Kunne ikke laste emoticons",
"People": "Mennesker",
"Animals and Nature": "Dyr og natur",
"Food and Drink": "Mat og drikke",
"Activity": "Aktivitet",
"Travel and Places": "Reise og steder",
"Objects": "Objekter",
"Flags": "Flagg",
"Characters": "Tegn",
"Characters (no spaces)": "Tegn (uten mellomrom)",
"Error: Form submit field collision.": "Feil: Skjemafelt innsendingskollisjon",
"Error: No form element found.": "Feil: Intet skjemafelt funnet.",
"Update": "Oppdater",
"Color swatch": "Fargepalett",
"Turquoise": "Turkis",
"Green": "Gr\u00f8nn",
"Blue": "Bl\u00e5",
"Purple": "Lilla",
"Navy Blue": "Marinebl\u00e5",
"Dark Turquoise": "M\u00f8rk turkis",
"Dark Green": "M\u00f8rkegr\u00f8nn",
"Medium Blue": "Mellombl\u00e5",
"Medium Purple": "Medium lilla",
"Midnight Blue": "Midnattbl\u00e5",
"Yellow": "Gul",
"Orange": "Oransje",
"Red": "R\u00f8d",
"Light Gray": "Lys gr\u00e5",
"Gray": "Gr\u00e5",
"Dark Yellow": "M\u00f8rk gul",
"Dark Orange": "M\u00f8rk oransje",
"Dark Red": "M\u00f8rker\u00f8d",
"Medium Gray": "Medium gr\u00e5",
"Dark Gray": "M\u00f8rk gr\u00e5",
"Black": "Svart",
"White": "Hvit",
"Switch to or from fullscreen mode": "Bytt til eller fra fullskjermmodus",
"Open help dialog": "\u00c5pne hjelp-dialog",
"history": "historikk",
"styles": "stiler",
"formatting": "formatering",
"alignment": "justering",
"indentation": "innrykk",
"permanent pen": "permanent penn",
"comments": "kommentarer",
"Anchor": "Anker",
"Special character": "Spesialtegn",
"Code sample": "Kodeeksempel",
"Color": "Farge",
"Emoticons": "Hum\u00f8rfjes",
"Document properties": "Dokumentegenskaper",
"Image": "Bilde",
"Insert link": "Sett inn lenke",
"Target": "M\u00e5l",
"Link": "Lenke",
"Poster": "Plakatbilde",
"Media": "Media",
"Print": "Skriv ut",
"Prev": "Forrige",
"Find and replace": "Finn og erstatt",
"Whole words": "Hele ord",
"Spellcheck": "Stavekontroll",
"Caption": "Tittel",
"Insert template": "Sett inn mal"
});


/*
 * Copyright (C) 2010 The Android Open Source Project
 *
 * 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.
 */

package com.facebook.jni;

import com.facebook.soloader.SoLoader;

import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLContext;
import javax.microedition.khronos.egl.EGLDisplay;

public class Prerequisites {
  private static final int EGL_OPENGL_ES2_BIT = 0x0004;

  public static void ensure() {
    SoLoader.loadLibrary("fbjni");
  }

  // Code is simplified version of getDetectedVersion()
  // from cts/tests/tests/graphics/src/android/opengl/cts/OpenGlEsVersionTest.java
  static public boolean supportsOpenGL20() {
    EGL10 egl = (EGL10) EGLContext.getEGL();
    EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
    int[] numConfigs = new int[1];

    if (egl.eglInitialize(display, null)) {
      try {
        if (egl.eglGetConfigs(display, null, 0, numConfigs)) {
          EGLConfig[] configs = new EGLConfig[numConfigs[0]];
          if (egl.eglGetConfigs(display, configs, numConfigs[0], numConfigs)) {
            int[] value = new int[1];
            for (int i = 0; i < numConfigs[0]; i++) {
              if (egl.eglGetConfigAttrib(display, configs[i],
                                         EGL10.EGL_RENDERABLE_TYPE, value)) {
                if ((value[0] & EGL_OPENGL_ES2_BIT) == EGL_OPENGL_ES2_BIT) {
                  return true;
                }
              }
            }
          }
        }
      } finally {
        egl.eglTerminate(display);
      }
    }
    return false;
  }
}


/*****************************************************************************
 *
 *  PROJECT:     Multi Theft Auto v1.0
 *  LICENSE:     See LICENSE in the top level directory
 *  FILE:        multiplayer_sa/CPopulationSA.cpp
 *  PURPOSE:     Ped world population class
 *
 *  Multi Theft Auto is available from http://www.multitheftauto.com/
 *
 *****************************************************************************/

#include "StdInc.h"

using std::list;

CPedSAInterface* pPedStorage;
CPopulationSA*   pSingleton;
DWORD            pedVtable;

VOID HOOK_EndOf_CPopulation__Add();
VOID HOOK_CPopulation__RemovePed();

CivilianAddHandler*    m_pCivilianAddHandler;
CivilianRemoveHandler* m_pCivilianRemoveHandler;

CPopulationSA::CPopulationSA()
{
    dwPedCount = 0;
    HookInstall(HOOKPOS_EndOf_CPopulation__Add, (DWORD)HOOK_EndOf_CPopulation__Add, 6);
    HookInstall(HOOKPOS_CPopulation__RemovePed, (DWORD)HOOK_CPopulation__RemovePed, 6);
    pSingleton = this;
    m_pCivilianRemoveHandler = NULL;
    m_pCivilianAddHandler = NULL;
}

VOID CPopulationSA::AddPed(CCivilianPed* ped)
{
    CCivilianPedSA* pPedSA = dynamic_cast<CCivilianPedSA*>(ped);
    if (!pPedSA)
        return;

    CEntitySAInterface* pPedSAInterface = pPedSA->GetInterface();

    list<CCivilianPedSA*>::iterator iter;
    for (iter = peds.begin(); iter != peds.end(); ++iter)
    {
        if ((*iter)->GetInterface() == pPedSAInterface)
        {
            return;
        }
    }

    peds.push_back(pPedSA);
    dwPedCount++;
}

VOID CPopulationSA::AddPed(CPedSAInterface* ped)
{
    list<CCivilianPedSA*>::iterator iter;
    for (iter = peds.begin(); iter != peds.end(); ++iter)
    {
        if ((*iter)->GetInterface() == ped)
        {
            return;
        }
    }

    CCivilianPedSA* pedSA = dynamic_cast<CCivilianPedSA*>(pGameInterface->GetPools()->AddCivilianPed((DWORD*)ped));
    if (!pedSA)
        return;

    char  szDebug[255] = {'\0'};
    DWORD dwPedInterface = (DWORD)pedSA->GetInterface();
    sprintf(szDebug, "Civ ped added (%d) (0x%p -> 0x%X)\n", dwPedCount + 1, ped, dwPedInterface);
    // OutputDebugString ( szDebug );

    if (m_pCivilianAddHandler)
        m_pCivilianAddHandler(pedSA);

    peds.push_back(pedSA);
    ++dwPedCount;
}

VOID CPopulationSA::RemovePed(CCivilianPed* ped)
{
    if (!ped)
        return;

    CCivilianPedSA* pPedSA = dynamic_cast<CCivilianPedSA*>(ped);
    if (!pPedSA)
        return;

    ped->SetDoNotRemoveFromGameWhenDeleted(true);
    pGameInterface->GetPools()->RemovePed((CPed*)ped);
    if (!peds.empty())
        peds.remove(pPedSA);
    dwPedCount--;
}

VOID CPopulationSA::RemovePed(CPedSAInterface* ped)
{
    list<CCivilianPedSA*>::iterator iter;
    for (iter = peds.begin(); iter != peds.end(); ++iter)
    {
        if ((*iter)->GetInterface() == ped)
        {
            char szDebug[255] = {'\0'};
            sprintf(szDebug, "Civ ped removed (%d)\n", dwPedCount - 1);
            pGameInterface->GetPools()->RemovePed((CPed*)(CCivilianPed*)(*iter), false);
            // OutputDebugString ( szDebug );

            if (m_pCivilianRemoveHandler)
                m_pCivilianRemoveHandler((*iter));

            peds.erase(iter);
            dwPedCount--;
            return;
        }
    }
    // OutputDebugString ( "Tried to remove Civ Ped, but Civ Ped not found!\n" );
}

DWORD CPopulationSA::GetPedCount()
{
    return dwPedCount;
}

CCivilianPed* CPopulationSA::GetFirstPed()
{
    if (peds.size() > 0)
    {
        pedIter = peds.begin();
        return *peds.begin();
    }
    else
    {
        return NULL;
    }
}

CCivilianPed* CPopulationSA::GetNextPed()
{
    ++(pedIter);
    if (pedIter != peds.end())
    {
        return *pedIter;
    }
    else
    {
        return NULL;
    }
}

void CPopulationSA::SetCivilianAddHandler(CivilianAddHandler* pCivilianAddHandler)
{
    m_pCivilianAddHandler = pCivilianAddHandler;
}

void CPopulationSA::SetCivilianRemoveHandler(CivilianRemoveHandler* pCivilianRemoveHandler)
{
    m_pCivilianRemoveHandler = pCivilianRemoveHandler;
}

VOID _declspec(naked) HOOK_EndOf_CPopulation__Add()
{
    _asm
    {
        mov     pPedStorage, eax
        pushad
    }

    pSingleton->AddPed(pPedStorage);

    _asm
    {
        popad
        add     esp, 0x3C
        retn
    }
}

VOID _declspec(naked) HOOK_CPopulation__RemovePed()
{
    /*
    00610F20  /$ 56             PUSH ESI
    00610F21  |. 8B7424 08      MOV ESI,DWORD PTR SS:[ESP+8]
    00610F25  |. 56             PUSH ESI
    */

    _asm
    {

        push    esi
        mov     esi, [esp+8]
        push    esi
        mov     pPedStorage, esi
        mov     ecx, [esi]
        mov     pedVtable, ecx
        pushad
    }

    if (pedVtable == VTBL_CPlayerPed)
    {
        _asm
        {
            popad
            pop     esi
            pop     esi
            retn
        }
    }

    pSingleton->RemovePed(pPedStorage);

    _asm
    {
        popad
        mov     ecx, HOOKPOS_CPopulation__RemovePed
        add     ecx, 6
        jmp     ecx
    }
}


/**
 * Copyright (c) 2014-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
#pragma once
#include <string>

#include "Yoga.h"

namespace facebook {
namespace yoga {

void YGNodeToString(
    std::string* str,
    YGNodeRef node,
    YGPrintOptions options,
    uint32_t level);

} // namespace yoga
} // namespace facebook


/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;

/**
 * Checks if `value` is a valid array-like length.
 *
 * **Note:** This method is loosely based on
 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
 * @example
 *
 * _.isLength(3);
 * // => true
 *
 * _.isLength(Number.MIN_VALUE);
 * // => false
 *
 * _.isLength(Infinity);
 * // => false
 *
 * _.isLength('3');
 * // => false
 */
function isLength(value) {
  return typeof value == 'number' &&
    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}

module.exports = isLength;


/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* 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.
*/

/* Modifications Copyright (c) Microsoft. */

#pragma once
#include "cuda.h"
#include "cuda_fp16.h"
#include "cuda_runtime.h"

namespace onnxruntime {
namespace cuda {

__device__ __forceinline__ void atomic_add(float *address, float value) {
    atomicAdd(address, value);
}

__device__ __forceinline__ void atomic_add(double *address, double value) {
#if __CUDA_ARCH__ < 600
  unsigned long long* raw_address = reinterpret_cast<unsigned long long*>(address);
  unsigned long long raw_old_value = 0ULL;
  unsigned long long raw_new_value = 0ULL;
  unsigned long long seen_old_value = 0ULL;
  double* const p_old_value = reinterpret_cast<double*>(&raw_old_value);
  double* const p_new_value = reinterpret_cast<double*>(&raw_new_value);
  do {
    *p_old_value = *address;
    *p_new_value = *address + value;
     seen_old_value = atomicCAS(raw_address, raw_old_value, raw_new_value);
  } while (seen_old_value != raw_old_value);
#else
  atomicAdd(address, value);
#endif
}

//
// ref: https://github.com/pytorch/pytorch/blob/master/aten/src/THC/THCAtomics.cuh
//
__device__ __forceinline__ void atomic_add(half *address, half value) {
#if __CUDA_ARCH__ < 700
  unsigned int* base_address = (unsigned int*)((char*)address - ((size_t)address & 2));
  unsigned int old = *base_address;
  unsigned int assumed;
  unsigned short x;

  do {
    assumed = old;
    x = (size_t)address & 2 ? (old >> 16) : (old & 0xffff);
    x = __half_as_short(__float2half(__half2float(*reinterpret_cast<const __half*>(&x)) + __half2float(value)));
    old = (size_t)address & 2 ? (old & 0xffff) | (x << 16) : (old & 0xffff0000) | x;
    old = atomicCAS(base_address, assumed, old);
  } while (assumed != old);
#else
  atomicAdd(address, value);
#endif
}

}  // namespace cuda
}  // namespace onnxruntime


# Redis 代理

- Redis [架构概述](../../intro/arch_overview/redis.md#arch-overview-redis)
- [v1 接口文档](https://www.envoyproxy.io/docs/envoy/latest/api-v1/network_filters/redis_proxy_filter#config-network-filters-redis-proxy-v1)
- [v2 接口文档](https://www.envoyproxy.io/docs/envoy/latest/api-v2/config/filter/network/redis_proxy/v2/redis_proxy.proto#envoy-api-msg-config-filter-network-redis-proxy-v2-redisproxy)

## 统计

每个已配置的 Redis 代理过滤器都有以 *redis.<stat_prefix>.* 开头的统计，并提供如下的统计报告：

| Name                            | Type    | Description                                  |
| ------------------------------- | ------- | -------------------------------------------- |
| downstream_cx_active            | Gauge   | 活跃的连接总数                     |
| downstream_cx_protocol_error    | Counter | 协议错误总次数                        |
| downstream_cx_rx_bytes_buffered | Gauge   | 当前接收并缓存的总字节数      |
| downstream_cx_rx_bytes_total    | Counter | 接收的总字节数                         |
| downstream_cx_total             | Counter | 连接总数                            |
| downstream_cx_tx_bytes_buffered | Gauge   | 当前发送并缓存的总字节数          |
| downstream_cx_tx_bytes_total    | Counter | 发送的总字节数                             |
| downstream_cx_drain_close       | Counter | 因连接耗尽而关闭的连接总数 |
| downstream_rq_active            | Gauge   | 活跃的请求总数                        |
| downstream_rq_total             | Counter | 请求总数                               |

## 分离器统计

Redis 过滤器将采集命令分离器的统计信息，并存放到以 *redis.<stat_prefix>.splitter* 开头的统计中，提供如下的统计报告：

| Name                | Type    | Description                                                  |
| ------------------- | ------- | ------------------------------------------------------------ |
| invalid_request     | Counter | 参数个数不正确的请求数     |
| unsupported_command | Counter | 命令分离器无法识别的命令数 |

## 每个命令的统计

Redis 过滤器将收集每个命令的统计信息，并存放到以 *redis.<stat_prefix>.command.<command>* 开头的命名空间中，提供如下的统计报告：

| Name  | Type    | Description        |
| ----- | ------- | ------------------ |
| total | Counter | 命令数 |

## 运行时

Redis 代理过滤器支持如下的运行时设置：

- redis.drain_close_enabled

  当服务器因为连接耗尽而尝试关闭连接的百分比。 默认值是 100。


【 日  期 】19960509
【 版  号 】2
【 标  题 】公交系统引进竞争机制你追我赶  广州“老爷车”基本消失
【 作  者 】杨广增
【 正  文 】
    据新华社广州５月８日电  （记者杨广增）不少外地人到广州都发现，广州的公共
汽车大多宽敞、美观、舒适，昔日破旧的“老爷车”已基本消失。
    这只是广州公交客运表面的变化。据了解，１９９４年以来，广州市已扭转了公交
客运量５年下降的趋势，使城市公共交通告别了萎缩的历史，进入了新的发展时期。广
州市客运交通管理处的负责人称，这都是公交系统勇于改革的结果。
    １９９３年８月广州公交主力军“一汽”借鉴国外先进经验，开始推行无人售票制
度。车辆的营运收入直接集中到结算中心，公司通过电脑就可直接掌握每辆车每天的营
运情况。既减少了中间管理环节，又避免了各管理层之间的扯皮。企业成本大大降低，
职工待遇有了较大提高。
    广州市公交公司在对内实行改革的同时，大力引进外资。澳门新福利公共汽车有限
公司率先与广州市电车公司合作，于１９９４年１月成立广州新福利巴士服务有限公司
，一举打破了国有企业在巴士市场“一统天下”的局面。“新福利”只设车管、财务、
行政三个部门，实行无人售票，公司不设食堂、医院、托儿所，票款由银行派员上门收
集。其车辆全为空调大巴，车辆美观、整洁、车门宽大，座椅舒适，自动报站清晰响亮
。“新福利”给人耳目一新之感，引来了市民争相乘坐。随后，“冠忠”、“新穗”、
“马会”、“珍宝”等中外合资、合作或联营公司进入广州公共交通行业，它们与原有
的国营公司一起，形成了广州市公共汽车运输市场你追我赶的局面。面对激烈竞争，广
州国有公交企业加大了改革的力度，“一汽”比原计划提前了３年全面实施无人售票。
目前，广州已有１０６条线路近１８００辆公共汽车、电车实行了无人售票。


<?php

/**
 * This file is part of the Carbon package.
 *
 * (c) Brian Nesbitt <brian@nesbot.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/*
 * Authors:
 * - bug-glibc-locales@gnu.org
 */
return array_replace_recursive(require __DIR__.'/en.php', [
    'formats' => [
        'L' => 'DD.MM.YYYY',
    ],
    'months' => ['studzienia', 'lutaha', 'sakavika', 'krasavika', 'maja', 'červienia', 'lipienia', 'žniŭnia', 'vieraśnia', 'kastryčnika', 'listapada', 'śniežnia'],
    'months_short' => ['Stu', 'Lut', 'Sak', 'Kra', 'Maj', 'Čer', 'Lip', 'Žni', 'Vie', 'Kas', 'Lis', 'Śni'],
    'weekdays' => ['Niadziela', 'Paniadziełak', 'Aŭtorak', 'Sierada', 'Čaćvier', 'Piatnica', 'Subota'],
    'weekdays_short' => ['Nia', 'Pan', 'Aŭt', 'Sie', 'Čać', 'Pia', 'Sub'],
    'weekdays_min' => ['Nia', 'Pan', 'Aŭt', 'Sie', 'Čać', 'Pia', 'Sub'],
    'first_day_of_week' => 1,
    'day_of_first_week_of_year' => 1,
]);


# == Class: govuk::apps::email_alert_api:checks
#
# Various Icinga checks for Email Alert API.
#
class govuk::apps::email_alert_api::checks(
  $ensure = present,
) {

  sidekiq_queue_check {
    'delivery_transactional':
      latency_warning  => '300', # 5 minutes
      latency_critical => '600'; # 10 minutes

    'delivery_immediate':
      latency_warning  => '1200', # 20 minutes
      latency_critical => '1800'; # 30 minutes

    'delivery_immediate_high':
      latency_warning  => '300', # 5 minutes
      latency_critical => '600'; # 10 minutes

    'delivery_digest':
      latency_warning  => '3600', # 60 minutes
      latency_critical => '5400'; # 90 minutes
  }

  @@icinga::check::graphite { 'email-alert-api-unprocessed-content-changes':
    ensure    => $ensure,
    host_name => $::fqdn,
    target    => 'transformNull(keepLastValue(averageSeries(stats.gauges.govuk.app.email-alert-api.*.content_changes.unprocessed_total)))',
    warning   => '0',
    critical  => '0',
    from      => '15minutes',
    desc      => 'email-alert-api - unprocessed content changes older than 120 minutes',
    notes_url => monitoring_docs_url(email-alert-api-unprocessed-content-changes),
  }

  @@icinga::check::graphite { 'email-alert-api-critical-digest-runs':
    ensure    => $ensure,
    host_name => $::fqdn,
    target    => 'transformNull(keepLastValue(averageSeries(stats.gauges.govuk.app.email-alert-api.*.digest_runs.critical_total)))',
    warning   => '0',
    critical  => '0',
    from      => '1hour',
    desc      => 'email-alert-api - incomplete digest runs - critical',
    notes_url => monitoring_docs_url(email-alert-api-incomplete-digest-runs),
  }

  @@icinga::check::graphite { 'email-alert-api-unprocessed-messages':
    ensure    => $ensure,
    host_name => $::fqdn,
    target    => 'transformNull(keepLastValue(averageSeries(stats.gauges.govuk.app.email-alert-api.*.messages.unprocessed_total)))',
    warning   => '0',
    critical  => '0',
    from      => '1hour',
    desc      => 'email-alert-api - unprocessed messages older than 120 minutes',
    notes_url => monitoring_docs_url(email-alert-api-unprocessed-messages),
  }
}


misc ops
rot
	| x1 x2 x3 |
	x1 := self pop.
	x2 := self pop.
	x3 := self pop.
	self push: x2.
	self push: x1.
	self push: x3


package com.forezp;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest
public class EurekaClientApplicationTests {

	@Test
	public void contextLoads() {
	}

}


/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.
 */

package org.apache.hadoop.yarn.server.nodemanager.webapp.dao.gpu;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

/**
 * Temperature of GPU
 */
@InterfaceAudience.Private
@InterfaceStability.Unstable
@XmlRootElement(name = "temperature")
public class PerGpuTemperature {
  private float currentGpuTemp = Float.MIN_VALUE;
  private float maxGpuTemp = Float.MIN_VALUE;
  private float slowThresholdGpuTemp = Float.MIN_VALUE;

  /**
   * Get current celsius GPU temperature
   * @return temperature
   */
  @XmlJavaTypeAdapter(PerGpuDeviceInformation.StrToFloatBeforeSpaceAdapter.class)
  @XmlElement(name = "gpu_temp")
  public Float getCurrentGpuTemp() {
    return currentGpuTemp;
  }

  public void setCurrentGpuTemp(Float currentGpuTemp) {
    this.currentGpuTemp = currentGpuTemp;
  }

  /**
   * Get max possible celsius GPU temperature
   * @return temperature
   */
  @XmlJavaTypeAdapter(PerGpuDeviceInformation.StrToFloatBeforeSpaceAdapter.class)
  @XmlElement(name = "gpu_temp_max_threshold")
  public Float getMaxGpuTemp() {
    return maxGpuTemp;
  }

  public void setMaxGpuTemp(Float maxGpuTemp) {
    this.maxGpuTemp = maxGpuTemp;
  }

  /**
   * Get celsius GPU temperature which could make GPU runs slower
   * @return temperature
   */
  @XmlJavaTypeAdapter(PerGpuDeviceInformation.StrToFloatBeforeSpaceAdapter.class)
  @XmlElement(name = "gpu_temp_slow_threshold")
  public Float getSlowThresholdGpuTemp() {
    return slowThresholdGpuTemp;
  }

  public void setSlowThresholdGpuTemp(Float slowThresholdGpuTemp) {
    this.slowThresholdGpuTemp = slowThresholdGpuTemp;
  }
}


# log4js-node [![Build Status](https://secure.travis-ci.org/nomiddlename/log4js-node.png?branch=master)](http://travis-ci.org/nomiddlename/log4js-node)

[![NPM](https://nodei.co/npm/log4js.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/log4js/)

This is a conversion of the [log4js](https://github.com/stritti/log4js)
framework to work with [node](http://nodejs.org). I've mainly stripped out the browser-specific code and tidied up some of the javascript.

Out of the box it supports the following features:

* coloured console logging to stdout or stderr
* replacement of node's console.log functions (optional)
* file appender, with log rolling based on file size
* SMTP appender
* GELF appender
* hook.io appender
* Loggly appender
* Logstash UDP appender
* logFaces appender
* multiprocess appender (useful when you've got worker processes)
* a logger for connect/express servers
* configurable log message layout/patterns
* different log levels for different log categories (make some parts of your app log as DEBUG, others only ERRORS, etc.)

NOTE: from log4js 0.5 onwards you'll need to explicitly enable replacement of node's console.log functions. Do this either by calling `log4js.replaceConsole()` or configuring with an object or json file like this:

```javascript
{
  appenders: [
    { type: "console" }
  ],
  replaceConsole: true
}
```

## installation

npm install log4js

## usage

Minimalist version:
```javascript
var log4js = require('log4js');
var logger = log4js.getLogger();
logger.debug("Some debug messages");
```
By default, log4js outputs to stdout with the coloured layout (thanks to [masylum](http://github.com/masylum)), so for the above you would see:
```bash
[2010-01-17 11:43:37.987] [DEBUG] [default] - Some debug messages
```
See example.js for a full example, but here's a snippet (also in fromreadme.js):
```javascript
var log4js = require('log4js');
//console log is loaded by default, so you won't normally need to do this
//log4js.loadAppender('console');
log4js.loadAppender('file');
//log4js.addAppender(log4js.appenders.console());
log4js.addAppender(log4js.appenders.file('logs/cheese.log'), 'cheese');

var logger = log4js.getLogger('cheese');
logger.setLevel('ERROR');

logger.trace('Entering cheese testing');
logger.debug('Got cheese.');
logger.info('Cheese is Gouda.');
logger.warn('Cheese is quite smelly.');
logger.error('Cheese is too ripe!');
logger.fatal('Cheese was breeding ground for listeria.');
```
Output:
```bash
[2010-01-17 11:43:37.987] [ERROR] cheese - Cheese is too ripe!
[2010-01-17 11:43:37.990] [FATAL] cheese - Cheese was breeding ground for listeria.
```
The first 5 lines of the code above could also be written as:
```javascript
var log4js = require('log4js');
log4js.configure({
  appenders: [
    { type: 'console' },
    { type: 'file', filename: 'logs/cheese.log', category: 'cheese' }
  ]
});
```

## configuration

You can configure the appenders and log levels manually (as above), or provide a
configuration file (`log4js.configure('path/to/file.json')`), or a configuration object. The
configuration file location may also be specified via the environment variable
LOG4JS_CONFIG (`export LOG4JS_CONFIG=path/to/file.json`).
An example file can be found in `test/log4js.json`. An example config file with log rolling is in `test/with-log-rolling.json`.
You can configure log4js to check for configuration file changes at regular intervals, and if changed, reload. This allows changes to logging levels to occur without restarting the application.

To turn it on and specify a period:

```javascript
log4js.configure('file.json', { reloadSecs: 300 });
```
For FileAppender you can also pass the path to the log directory as an option where all your log files would be stored.

```javascript
log4js.configure('my_log4js_configuration.json', { cwd: '/absolute/path/to/log/dir' });
```
If you have already defined an absolute path for one of the FileAppenders in the configuration file, you could add a "absolute": true to the particular FileAppender to override the cwd option passed. Here is an example configuration file:

#### my_log4js_configuration.json ####
```json
{
  "appenders": [
    {
      "type": "file",
      "filename": "relative/path/to/log_file.log",
      "maxLogSize": 20480,
      "backups": 3,
      "category": "relative-logger"
    },
    {
      "type": "file",
      "absolute": true,
      "filename": "/absolute/path/to/log_file.log",
      "maxLogSize": 20480,
      "backups": 10,
      "category": "absolute-logger"
    }
  ]
}
```
Documentation for most of the core appenders can be found on the [wiki](https://github.com/nomiddlename/log4js-node/wiki/Appenders), otherwise take a look at the tests and the examples.

## Documentation
See the [wiki](https://github.com/nomiddlename/log4js-node/wiki). Improve the [wiki](https://github.com/nomiddlename/log4js-node/wiki), please.

There's also [an example application](https://github.com/nomiddlename/log4js-example).

## Contributing
Contributions welcome, but take a look at the [rules](https://github.com/nomiddlename/log4js-node/wiki/Contributing) first.

## License

The original log4js was distributed under the Apache 2.0 License, and so is this. I've tried to
keep the original copyright and author credits in place, except in sections that I have rewritten
extensively.


<!doctype html>

  <meta charset="UTF-8">
  <title>Example - example-ng-hide-complex-jquery</title>
  <link href="animations.css" rel="stylesheet" type="text/css">

  Hide: <input type="checkbox" ng-model="checked" aria-label="Toggle ngHide">

  I hide when your checkbox is checked.


using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.ApplicationModel.AppService;
using Windows.ApplicationModel.Core;
using Windows.Foundation.Collections;
using Windows.System.RemoteSystems;
using Windows.UI.Core;

namespace Adventure_Works
{
    public class RomeHelper : IDisposable
    {
        private RemoteSystemWatcher _remoteSystemWatcher;

        private ObservableCollection<AdventureRemoteSystem> _availableRemoteSystems = new ObservableCollection<AdventureRemoteSystem>();
        private List<RemoteSystem> _remoteSystems = new List<RemoteSystem>();

        public ObservableCollection<AdventureRemoteSystem> AvailableRemoteSystems
        {
            get { return _availableRemoteSystems; }
        }

        public event EventHandler<AdventureRemoteSystem> RemoteSystemAdded;
        public event EventHandler<AdventureRemoteSystem> RemoteSystemRemoved;

        private RemoteSystem _currentSystem;

        public async Task Initialize()
        {
            if (_remoteSystemWatcher != null)
                return;

            RemoteSystemAccessStatus accessStatus = await RemoteSystem.RequestAccessAsync();
            if (accessStatus == RemoteSystemAccessStatus.Allowed)
            {
                _remoteSystemWatcher = RemoteSystem.CreateWatcher(BuildFilters());
                _remoteSystemWatcher.RemoteSystemAdded += RemoteSystemWatcher_RemoteSystemAdded;
                _remoteSystemWatcher.RemoteSystemRemoved += RemoteSystemWatcher_RemoteSystemRemoved;
                _remoteSystemWatcher.RemoteSystemUpdated += RemoteSystemWatcher_RemoteSystemUpdated;
                _remoteSystemWatcher.Start();
            }
        }

        private List<IRemoteSystemFilter> BuildFilters()
        {
            List<IRemoteSystemFilter> filters = new List<IRemoteSystemFilter>();

            filters.Add(new RemoteSystemDiscoveryTypeFilter(RemoteSystemDiscoveryType.Proximal));

            filters.Add(new RemoteSystemKindFilter(new string[] { RemoteSystemKinds.Desktop, RemoteSystemKinds.Xbox }));

            filters.Add(new RemoteSystemStatusTypeFilter(RemoteSystemStatusType.Any));

            return filters;
        }

        private async void RemoteSystemWatcher_RemoteSystemAdded(RemoteSystemWatcher sender, RemoteSystemAddedEventArgs args)
        {
            _remoteSystems.Add(args.RemoteSystem);
            var system = await AdventureRemoteSystem.CreateAdventureRemoteSystem(args.RemoteSystem).ConfigureAwait(false);
            if (system != null)
            {
                var t = Helpers.RunOnCoreDispatcherIfPossible(() =>
                {
                    if (_availableRemoteSystems.Where(s => s.RemoteSystem.Id == system.RemoteSystem.Id).Count() == 0)
                    {
                        _availableRemoteSystems.Add(system);
                        RemoteSystemAdded?.Invoke(this, system);
                    }

                });
            }
        }

        private void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
        {
            var remoteSystem = _remoteSystems.Where(s => s.Id == args.RemoteSystemId).FirstOrDefault();
            if (remoteSystem != null)
            {
                _remoteSystems.Remove(remoteSystem);
            }

            var system = _availableRemoteSystems.Where(s => s.RemoteSystem.Id == args.RemoteSystemId).FirstOrDefault();
            if (system != null)
            {
                var t = Helpers.RunOnCoreDispatcherIfPossible(() =>
                {
                    _availableRemoteSystems.Remove(system);
                    RemoteSystemRemoved?.Invoke(this, system);
                });
            }
        }

        private async void RemoteSystemWatcher_RemoteSystemUpdated(RemoteSystemWatcher sender, RemoteSystemUpdatedEventArgs args)
        {
            var remoteSystem = _remoteSystems.Where(s => s.Id == args.RemoteSystem.Id).FirstOrDefault();
            if (remoteSystem != null)
                return;

            var existingSystem = _availableRemoteSystems.Where(s => s.RemoteSystem.Id == args.RemoteSystem.Id).FirstOrDefault();
            if (existingSystem == null)
            {
                var system = await AdventureRemoteSystem.CreateAdventureRemoteSystem(args.RemoteSystem).ConfigureAwait(false);
                if (system != null)
                {
                    var t = Helpers.RunOnCoreDispatcherIfPossible(() =>
                    {
                        if (_availableRemoteSystems.Where(s => s.RemoteSystem.Id == system.RemoteSystem.Id).Count() == 0)
                        {
                            _availableRemoteSystems.Add(system);
                            RemoteSystemAdded?.Invoke(this, system);
                        }
                    });
                }
            }
        }

        public void Dispose()
        {
            if (_remoteSystemWatcher != null)
            {
                foreach (var system in _availableRemoteSystems)
                {
                    system.Dispose();
                }

                _remoteSystemWatcher.RemoteSystemAdded -= RemoteSystemWatcher_RemoteSystemAdded;
                _remoteSystemWatcher.RemoteSystemRemoved -= RemoteSystemWatcher_RemoteSystemRemoved;
                _remoteSystemWatcher.RemoteSystemUpdated -= RemoteSystemWatcher_RemoteSystemUpdated;
                _remoteSystemWatcher.Stop();
                _remoteSystemWatcher = null;
            }
        }
    }
}


This folder contains a couple of benchmark utities and Eigen benchmarks.

****************************
* bench_multi_compilers.sh *
****************************

This script allows to run a benchmark on a set of different compilers/compiler options.
It takes two arguments:
 - a file defining the list of the compilers with their options
 - the .cpp file of the benchmark

Examples:

$ ./bench_multi_compilers.sh basicbench.cxxlist basicbenchmark.cpp

    g++-4.1 -O3 -DNDEBUG -finline-limit=10000
    3d-3x3   /   4d-4x4   /   Xd-4x4   /   Xd-20x20   /
    0.271102   0.131416   0.422322   0.198633
    0.201658   0.102436   0.397566   0.207282

    g++-4.2 -O3 -DNDEBUG -finline-limit=10000
    3d-3x3   /   4d-4x4   /   Xd-4x4   /   Xd-20x20   /
    0.107805   0.0890579   0.30265   0.161843
    0.127157   0.0712581   0.278341   0.191029

    g++-4.3 -O3 -DNDEBUG -finline-limit=10000
    3d-3x3   /   4d-4x4   /   Xd-4x4   /   Xd-20x20   /
    0.134318   0.105291   0.3704   0.180966
    0.137703   0.0732472   0.31225   0.202204

    icpc -fast -DNDEBUG -fno-exceptions -no-inline-max-size
    3d-3x3   /   4d-4x4   /   Xd-4x4   /   Xd-20x20   /
    0.226145   0.0941319   0.371873   0.159433
    0.109302   0.0837538   0.328102   0.173891

$ ./bench_multi_compilers.sh ompbench.cxxlist ompbenchmark.cpp

    g++-4.2 -O3 -DNDEBUG -finline-limit=10000 -fopenmp
    double, fixed-size 4x4: 0.00165105s  0.0778739s
    double, 32x32: 0.0654769s 0.075289s  => x0.869674 (2)
    double, 128x128: 0.054148s 0.0419669s  => x1.29025 (2)
    double, 512x512: 0.913799s 0.428533s  => x2.13239 (2)
    double, 1024x1024: 14.5972s 9.3542s  => x1.5605 (2)

    icpc -fast -DNDEBUG -fno-exceptions -no-inline-max-size -openmp
    double, fixed-size 4x4: 0.000589848s  0.019949s
    double, 32x32: 0.0682781s 0.0449722s  => x1.51823 (2)
    double, 128x128: 0.0547509s 0.0435519s  => x1.25714 (2)
    double, 512x512: 0.829436s 0.424438s  => x1.9542 (2)
    double, 1024x1024: 14.5243s 10.7735s  => x1.34815 (2)


Kopiowanie plików klastra

Ten moduł pozwala na zaplanowany transfer plików z głównego serwera
na inne serwery w klastrze Webmina. Może to być przydatne do rozesłania
takich plików jak np. <tt>/etc/hosts</tt>, <tt>httpd.conf</tt> i innych, dla
których nie s± dostępne protokoły sieciowe takie jak NIS lub LDAP.

Na głównej stronie modułu znajduje się lista wszystkich zaplanowanych kopii
oraz link umożliwiaj±cy stworzenie nowych. Dla każdej kopii możesz okreliść
plik Źródłowy, katalog docelowy i czas uruchomienia. Serwery docelowe muszą
być najpierw dodane do  modułu Serwery Webmina z loginem i hasłem


#
# 1. Set up a replication connection from server 1 to server 2
include/master-slave.inc
Warnings:
Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
Note	####	Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
#
# 2. Create a table for testing
[connection server_1]
CREATE TABLE test.t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
include/sync_slave_sql_with_master.inc
#
# 3. Install clone on server 2
#    Configure server 3 to invoke clone
[connection server_2]
INSTALL PLUGIN clone SONAME 'CLONE_PLUGIN';
[connection server_3]
include/spawn_monitoring_process.inc
INSTALL PLUGIN clone SONAME 'CLONE_PLUGIN';
SET GLOBAL clone_valid_donor_list = 'localhost:SERVER2_PORT';
CLONE INSTANCE FROM root@localhost:SERVER2_PORT IDENTIFIED BY '';
include/rpl_reconnect.inc
#
# 4. Execute a transaction on server 1, check 3 received it
[connection server_1]
INSERT INTO t1 VALUES (1);
include/sync_slave_sql_with_master.inc
[connection server_3]
include/assert.inc [All info from server 1 is present]
#
# 5. Cleanup
[connection server_1]
DROP TABLE test.t1;
include/rpl_sync.inc
[connection server_2]
UNINSTALL PLUGIN clone;
[connection server_3]
STOP SLAVE;
RESET SLAVE ALL;
UNINSTALL PLUGIN clone;
include/rpl_clear_priv_checks_user_configuration.inc
include/clean_monitoring_process.inc
SET SESSION sql_log_bin=0;
call mtr.add_suppression("Clone removing all user data for provisioning: Started");
call mtr.add_suppression("Clone removing all user data for provisioning: Finished");
call mtr.add_suppression("Recovery from master pos [0-9]+ and file [a-zA-Z-]+\.[0-9]+ for channel ''*");
call mtr.add_suppression("Relay log information for channel '' was found after a clone operation. Relay log recovery");
SET SESSION sql_log_bin=1;
include/rpl_end.inc


# coding=utf-8
# Copyright 2018 The DisentanglementLib Authors.  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.

evaluation.evaluation_fn = @irs
dataset.name="auto"
evaluation.random_seed = 0
irs.num_train=10000
irs.batch_size=16
discretizer.num_bins=20
discretizer.discretizer_fn=@histogram_discretizer


/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

package mozilla.components.browser.engine.gecko.webpush

import androidx.test.ext.junit.runners.AndroidJUnit4
import mozilla.components.support.test.any
import mozilla.components.support.test.eq
import mozilla.components.support.test.mock
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito.`when`
import org.mockito.Mockito.isNull
import org.mockito.Mockito.verify
import org.mozilla.geckoview.GeckoRuntime
import org.mozilla.geckoview.WebPushController

@RunWith(AndroidJUnit4::class)
class GeckoWebPushHandlerTest {

    lateinit var runtime: GeckoRuntime
    lateinit var controller: WebPushController

    @Before
    fun setup() {
        controller = mock()
        runtime = mock()
        `when`(runtime.webPushController).thenReturn(controller)
    }

    @Test
    fun `runtime controller is invoked`() {
        val handler = GeckoWebPushHandler(runtime)

        handler.onPushMessage("", null)
        verify(controller).onPushEvent(any(), isNull())

        handler.onSubscriptionChanged("test")
        verify(controller).onSubscriptionChanged(eq("test"))
    }
}


---
title: "bzr-builder"
layout: formula
---
{{ content }}


using System;
using System.IO;

namespace SharpVectors.Net
{
	public sealed class NoCacheManager : ICacheManager
	{
		public NoCacheManager()
		{
		}

		public CacheInfo GetCacheInfo(Uri uri)
		{
			return null;
		}

		public void SetCacheInfo(Uri uri, CacheInfo cacheInfo, Stream stream)
		{
		}
	}
}


Mitmachen • Re: YaCy und Add-ons
================================

Date: 2014-11-01 16:07:46

Hallo,\
\

>

>
> fherb hat geschrieben:\
> Aber ich habe nirgendwo gelesen, dass jemand gesagt hätte \"Ok
> Orbitter, um die Entwicklungsarbeit der Beteiligten zu verringern,
> übernehme ich gern und sofort die Pflege und Weiterentwicklung des
> Proxy.\"\
>
>

Was denkt ihr warum das so ist? Ich persönlich bin ein geübter
C-Programmierer mit viel Erfahrung in TCP und HTTP und anderen
Protokollen auf dieser Ebene, einen externen Proxy der wie von Orbiter
gewünscht einfach alles was durchläuft per Push-API an einen (fest
konfigurierten) YaCy-Peer weiterreicht würde ich in recht kurzer Zeit
auf die Beine bekommen. Warum ich das aber nicht vorhabe ist relativ
einfach erklärt: ich sehe darin keinen Nutzwert. Grund:
Verschlüsselung.\
Ich als normaler Internet-Nutzer bin der Meinung das es überhaupt gar
keinen Grund gibt auch nur ein einziges Bit unverschlüsselt durchs
Internet zu schicken! Da diese Meinung in Kreisen der Leute die sich
bemühen die Zukunft des Internets zu gestalten, z.B. die Leute die für
die Entwicklung von HTTP 2 verantwortlich sind und wollen das dort
Verschlüsselung zum [nicht]{style="font-style: italic"} abschaltbaren
\"Must-Have\" wird, sehr verbreitet ist habe ich als normaler
Internet-Nutzer in diesem Punkt ein positives Gefühl für die Zukunft.\
Als Programmierer kenne ich natürlich auch den Aufwand der sich hinter
der Verschlüsselung verbirgt aber das sehen die normalen Anwender nicht
die einfach nur \"sicher\" Kommunizieren wollen, und die müssen das auch
nicht sehen, es ist die Aufgabe der Programmierer (da zähle ich mich
gerne mit dazu) dafür zu sorgen dass das einfach funktioniert.\
\
Was ich sagen will: es wird sich wohl kaum jemand finden der einen Proxy
programmiert und wartet/weiterentwickelt der die übertragenen Daten in
irgendeiner Form verarbeitet, einfach aus dem simplen Grund heraus dass
das auf absehbare Zeit immer weniger Nutzen bringt.\
\
Wenn man an die unverschlüsselten Daten ran will dann geht das nur
entweder direkt am Web-Server oder direkt im Browser, es gibt keine
andere Möglichkeit, außer auf Verschlüsselung zu verzichten und das ist
wohl bei den meisten Nutzern und \"Muttis\" und \"Omas\" nicht mehr
konsensfähig!\
(Meine Mutter, und die ist kurz vor der Rente, kennt sich mit Computern
nicht viel aus obwohl sie den ganzen Tag an einem arbeitet und wie
Verschlüsselung funktioniert weiß sie ebenfalls nicht, aber warum
Verschlüsselung so wichtig ist das weiß meine Mutter ganz genau)\
\
Langfristig sehe ich für das Konzept \"Browser-AddOn\" keine
Alternative, aber da ich mir der Probleme dieses Konzepts also die
Vielzahl der Browser bewusst bin ist mir klar das auch diese Lösung sehr
suboptimal ist.\
Wie kann das nun gelöst werden? Hat hier jemand echte Vorschläge?\
\

>

>
> fherb hat geschrieben:\
> Der wichtigste Punkt ist, dass der bisherige Weg über den Yacy-eigenen
> Proxy abgelöst wird: Verringert den Wartungs- und Entwicklungsaufwand
> von YaCy.\
>
>

YaCy dürfte durch den Wegfall des Proxy so einiges an Ballast verlieren,
es gibt z.B. einen Cache für den durchgeleiteten Web-Inhalt der
ebenfalls entfallen kann und noch einiges andere mehr (den Hinweis auf
den HTTP-Fehler 403 kann ich mir hier sicher sparen).\
\
Mit der Beschränkung des AddOns aufs wirklich Notwendige, so wie von
fherb vorgeschlagen, bin ich einverstanden.\
\
Ich bin auch der Meinung das sich dem Nutzer von YaCy irgendeine Art von
[spürbaren]{style="font-style: italic"} Mehrwert ergeben muss. Was
könnte das sein und wie sollte das realisiert werden?\
\
An der Idee YaCy selber auf Smartphones und Tablets zu portieren sehe
ich zwar keine technischen Probleme, Java als Laufzeitumgebung ist für
alle relevanten Plattformen verfügbar, aber bis diese Geräte wirklich
genügend CPU-Power und RAM und
[Festplatten]{style="font-style: italic"}kapazität haben dürften noch
ein paar Jahre vergehen (ich bin mir aber sicher das der technische
Fortschritt das in nicht allzu ferner Zukunft möglich machen wird).\
\
Grüße\
Erik

Statistik: Verfasst von
[Erik\_S](http://forum.yacy-websuche.de/memberlist.php?mode=viewprofile&u=9480)
--- Sa Nov 01, 2014 4:07 pm

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


# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p

class DebugLinkMemoryRead(p.MessageType):
    MESSAGE_WIRE_TYPE = 110

    def __init__(
        self,
        address: int = None,
        length: int = None,
    ) -> None:
        self.address = address
        self.length = length

    @classmethod
    def get_fields(cls):
        return {
            1: ('address', p.UVarintType, 0),
            2: ('length', p.UVarintType, 0),
        }


--- /Users/mbolin/src/atom/src/compile-cache.js	2016-11-02 19:50:02.000000000 -0700
+++ scripts/patches/src/compile-cache.js	2016-12-13 20:16:37.000000000 -0800
@@ -29,6 +29,8 @@
   packageTranspilationRegistry.removeTranspilerConfigForPath(packagePath)
 }

+exports.COMPILERS = COMPILERS
+
 var cacheStats = {}
 var cacheDirectory = null

@@ -37,12 +39,13 @@
   if (process.env.USER === 'root' && process.env.SUDO_USER && process.env.SUDO_USER !== process.env.USER) {
     cacheDir = path.join(cacheDir, 'root')
   }
-  this.setCacheDirectory(cacheDir)
+  setCacheDirectory(cacheDir)
 }

-exports.setCacheDirectory = function (directory) {
+function setCacheDirectory (directory) {
   cacheDirectory = directory
 }
+exports.setCacheDirectory = setCacheDirectory

 exports.getCacheDirectory = function () {
   return cacheDirectory
@@ -95,6 +98,7 @@
   }
   return sourceCode
 }
+exports.compileFileAtPath = compileFileAtPath

 function readCachedJavascript (relativeCachePath) {
   var cachePath = path.join(cacheDirectory, relativeCachePath)
@@ -206,6 +210,11 @@
 }

 Object.keys(COMPILERS).forEach(function (extension) {
+  // This will happen when run in a browser.
+  if (require.extensions == null) {
+    return;
+  }
+
   var compiler = COMPILERS[extension]

   Object.defineProperty(require.extensions, extension, {


global.os = require('os');
global.fs = require('fs');
global.net = require('net');
global.http = require('http');
global.util = require('util');
global.App = require('./app_ctrl');

global.mode = 'DEBUG';
//global.mode = 'DEBUG';

global.debug = function(str){
  if(mode == 'DEBUG')
    console.log(str);
}

global.output = function(str){
  console.log(str);
}

global.inspect = function(obj){
  if(mode == 'DEBUG')
    debug(util.inspect(obj));
}

global.main = function(fn){
  fn();
}

global.isEmpty = function(obj){
  for(var i in obj){
    return false;
  }
  return true;
}

//shallow extend
global.extend = function(des, src){
  for(var key in src){
    if(src.hasOwnProperty(key))
      des[key] = src[key];
  }
}

//shallow clone
global.clone = function(obj){
  var ret = {};
  for(var key in obj){
    if(obj.hasOwnProperty(key))
      ret[key] = obj[key];
  }
  return ret;
}

// the member function to be used as callback
// and set 'this' as the context
global.memcb = function(context, mem){
  return function(){
    context[mem].apply(context, arguments);
  }
}

/*this function will throw an exception ,
**so it will end the request ,I use this way to
substitute the combination of :
** #1 send_error
** #2 return
*/
global.replyError = function(req, res, code ,info){
  var  map = {
    404 : 'Not Found',
    400 : 'Bad Request',
    500 : 'Internal Server Error'
  }
  var err_str = map[code] || 'error occurred';
  var body = info || err_str;
  res.writeHead(code , {'Content-Type' : 'text/plain'});
  res.end(body.toString());
}

//we throw this type of exception to
//stop the process
global.SExcp = function(err){
  this.err = err;
}

//empty exception,just for jump out of process
//maybe throwed by controllers
global.NullExcp = function(){
  this.type = 'null';
}

//default we send http 500 error
process.on('uncaughtException', function(obj) {
  if(obj instanceof NullExcp){
    //log.error(obj.info);
  }else if(obj instanceof SExcp){
    log.error(obj.err);
    process.exit(-1);
  }else{
    log.error(obj.toString());
  }
  delete obj;
});

//test the file's accessibility
global.access = function(filepath){
  var ok = true;
  try{
    fs.readFileSync(filepath);
  }catch(e){
    ok =false;
  }
  return ok;
}

//would be reset when require log.js
global.log =  {
  error : function(str){
    console.log('[Error]\t' + str + '\t'+ new Date());
  },
  warning : function(str){
    console.log('[Warning]\t' + str + '\t' + new Date());
  },
  info : function(str){
    console.log('[Info]\t' + str + '\t'  + new Date());
  }
};


class WorkFlowStateManager :
    """
    2. Tables
    NN_WF_STATE_INFO
    NN_WF_NODE_INFO
    NN_WF_NODE_RELATION
    """
    def duplicate_state_info(self, nn_id, wf_ver):

        return None

    def get_state_draw_info(self):

        return None

    def update_state_draw_info(self):

        return None

    def get_node_menu_info(self):

        return None

    def get_node_detail_info(self):

        return None

    def get_node(self):

        return None

    def delete_node(self):

        return None

    def update_node_status(self):

        return None

    def _update_node(self):

        return None

    def _insert_node(self):

        return None

    def _serialize_node_data(self):

        return None

    def _parse_json_to_node(self):

        return None


#if !defined(foo)
#define goo
int n;
#endif


[program:nmcauxmaker]
directory=/work/btcpool/build/run_nmcauxmaker
command=/work/btcpool/build/run_nmcauxmaker/nmcauxmaker -c /work/btcpool/build/run_nmcauxmaker/nmcauxmaker.cfg -l /work/btcpool/build/run_nmcauxmaker/log_nmcauxmaker
autostart=true
autorestart=true
startsecs=6
startretries=20

redirect_stderr=true
stdout_logfile_backups=5
stdout_logfile=/work/btcpool/build/run_nmcauxmaker/log_nmcauxmaker/nmcauxmaker_stdout.log


#ifndef __SOUND_VT1724_H
#define __SOUND_VT1724_H

/*
 *   ALSA driver for ICEnsemble VT1724 (Envy24)
 *
 *	Copyright (c) 2000 Jaroslav Kysela <perex@perex.cz>
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 *
 */

#include <sound/control.h>
#include <sound/ac97_codec.h>
#include <sound/rawmidi.h>
#include <sound/i2c.h>
#include <sound/pcm.h>

#include "ice1712.h"

enum {
	ICE_EEP2_SYSCONF = 0,	/* 06 */
	ICE_EEP2_ACLINK,	/* 07 */
	ICE_EEP2_I2S,		/* 08 */
	ICE_EEP2_SPDIF,		/* 09 */
	ICE_EEP2_GPIO_DIR,	/* 0a */
	ICE_EEP2_GPIO_DIR1,	/* 0b */
	ICE_EEP2_GPIO_DIR2,	/* 0c */
	ICE_EEP2_GPIO_MASK,	/* 0d */
	ICE_EEP2_GPIO_MASK1,	/* 0e */
	ICE_EEP2_GPIO_MASK2,	/* 0f */
	ICE_EEP2_GPIO_STATE,	/* 10 */
	ICE_EEP2_GPIO_STATE1,	/* 11 */
	ICE_EEP2_GPIO_STATE2	/* 12 */
};

/*
 *  Direct registers
 */

#define ICEREG1724(ice, x) ((ice)->port + VT1724_REG_##x)

#define VT1724_REG_CONTROL		0x00	/* byte */
#define   VT1724_RESET			0x80	/* reset whole chip */
#define VT1724_REG_IRQMASK		0x01	/* byte */
#define   VT1724_IRQ_MPU_RX		0x80
#define   VT1724_IRQ_MPU_TX		0x20
#define   VT1724_IRQ_MTPCM		0x10
#define VT1724_REG_IRQSTAT		0x02	/* byte */
/* look to VT1724_IRQ_* */
#define VT1724_REG_SYS_CFG		0x04	/* byte - system configuration PCI60 on Envy24*/
#define   VT1724_CFG_CLOCK	0xc0
#define     VT1724_CFG_CLOCK512	0x00	/* 22.5692Mhz, 44.1kHz*512 */
#define     VT1724_CFG_CLOCK384  0x40	/* 16.9344Mhz, 44.1kHz*384 */
#define   VT1724_CFG_MPU401	0x20		/* MPU401 UARTs */
#define   VT1724_CFG_ADC_MASK	0x0c	/* one, two or one and S/PDIF, stereo ADCs */
#define   VT1724_CFG_ADC_NONE	0x0c	/* no ADCs */
#define   VT1724_CFG_DAC_MASK	0x03	/* one, two, three, four stereo DACs */

#define VT1724_REG_AC97_CFG		0x05	/* byte */
#define   VT1724_CFG_PRO_I2S	0x80	/* multitrack converter: I2S or AC'97 */
#define   VT1724_CFG_AC97_PACKED	0x01	/* split or packed mode - AC'97 */

#define VT1724_REG_I2S_FEATURES		0x06	/* byte */
#define   VT1724_CFG_I2S_VOLUME	0x80	/* volume/mute capability */
#define   VT1724_CFG_I2S_96KHZ	0x40	/* supports 96kHz sampling */
#define   VT1724_CFG_I2S_RESMASK	0x30	/* resolution mask, 16,18,20,24-bit */
#define   VT1724_CFG_I2S_192KHZ	0x08	/* supports 192kHz sampling */
#define   VT1724_CFG_I2S_OTHER	0x07	/* other I2S IDs */

#define VT1724_REG_SPDIF_CFG		0x07	/* byte */
#define   VT1724_CFG_SPDIF_OUT_EN	0x80	/*Internal S/PDIF output is enabled*/
#define   VT1724_CFG_SPDIF_OUT_INT	0x40	/*Internal S/PDIF output is implemented*/
#define   VT1724_CFG_I2S_CHIPID	0x3c	/* I2S chip ID */
#define   VT1724_CFG_SPDIF_IN	0x02	/* S/PDIF input is present */
#define   VT1724_CFG_SPDIF_OUT	0x01	/* External S/PDIF output is present */

/*there is no consumer AC97 codec with the VT1724*/
//#define VT1724_REG_AC97_INDEX		0x08	/* byte */
//#define VT1724_REG_AC97_CMD		0x09	/* byte */

#define VT1724_REG_MPU_TXFIFO		0x0a	/*byte ro. number of bytes in TX fifo*/
#define VT1724_REG_MPU_RXFIFO		0x0b	/*byte ro. number of bytes in RX fifo*/

#define VT1724_REG_MPU_DATA		0x0c	/* byte */
#define VT1724_REG_MPU_CTRL		0x0d	/* byte */
#define   VT1724_MPU_UART	0x01
#define   VT1724_MPU_TX_EMPTY	0x02
#define   VT1724_MPU_TX_FULL	0x04
#define   VT1724_MPU_RX_EMPTY	0x08
#define   VT1724_MPU_RX_FULL	0x10

#define VT1724_REG_MPU_FIFO_WM	0x0e	/*byte set the high/low watermarks for RX/TX fifos*/
#define   VT1724_MPU_RX_FIFO	0x20	//1=rx fifo watermark 0=tx fifo watermark
#define   VT1724_MPU_FIFO_MASK	0x1f

#define VT1724_REG_I2C_DEV_ADDR	0x10	/* byte */
#define   VT1724_I2C_WRITE		0x01	/* write direction */
#define VT1724_REG_I2C_BYTE_ADDR	0x11	/* byte */
#define VT1724_REG_I2C_DATA		0x12	/* byte */
#define VT1724_REG_I2C_CTRL		0x13	/* byte */
#define   VT1724_I2C_EEPROM		0x80	/* 1 = EEPROM exists */
#define   VT1724_I2C_BUSY		0x01	/* busy bit */

#define VT1724_REG_GPIO_DATA	0x14	/* word */
#define VT1724_REG_GPIO_WRITE_MASK	0x16 /* word */
#define VT1724_REG_GPIO_DIRECTION	0x18 /* dword? (3 bytes) 0=input 1=output.
						bit3 - during reset used for Eeprom power-on strapping
						if TESTEN# pin active, bit 2 always input*/
#define VT1724_REG_POWERDOWN	0x1c
#define VT1724_REG_GPIO_DATA_22	0x1e /* byte direction for GPIO 16:22 */
#define VT1724_REG_GPIO_WRITE_MASK_22	0x1f /* byte write mask for GPIO 16:22 */

/*
 *  Professional multi-track direct control registers
 */

#define ICEMT1724(ice, x) ((ice)->profi_port + VT1724_MT_##x)

#define VT1724_MT_IRQ			0x00	/* byte - interrupt mask */
#define   VT1724_MULTI_PDMA4	0x80	/* SPDIF Out / PDMA4 */
#define	  VT1724_MULTI_PDMA3	0x40	/* PDMA3 */
#define   VT1724_MULTI_PDMA2	0x20	/* PDMA2 */
#define   VT1724_MULTI_PDMA1	0x10	/* PDMA1 */
#define   VT1724_MULTI_FIFO_ERR 0x08	/* DMA FIFO underrun/overrun. */
#define   VT1724_MULTI_RDMA1	0x04	/* RDMA1 (S/PDIF input) */
#define   VT1724_MULTI_RDMA0	0x02	/* RMDA0 */
#define   VT1724_MULTI_PDMA0	0x01	/* MC Interleave/PDMA0 */

#define VT1724_MT_RATE			0x01	/* byte - sampling rate select */
#define   VT1724_SPDIF_MASTER		0x10	/* S/PDIF input is master clock */
#define VT1724_MT_I2S_FORMAT		0x02	/* byte - I2S data format */
#define   VT1724_MT_I2S_MCLK_128X	0x08
#define   VT1724_MT_I2S_FORMAT_MASK	0x03
#define   VT1724_MT_I2S_FORMAT_I2S	0x00
#define VT1724_MT_DMA_INT_MASK		0x03	/* byte -DMA Interrupt Mask */
/* lool to VT1724_MULTI_* */
#define VT1724_MT_AC97_INDEX		0x04	/* byte - AC'97 index */
#define VT1724_MT_AC97_CMD		0x05	/* byte - AC'97 command & status */
#define   VT1724_AC97_COLD	0x80	/* cold reset */
#define   VT1724_AC97_WARM	0x40	/* warm reset */
#define   VT1724_AC97_WRITE	0x20	/* W: write, R: write in progress */
#define   VT1724_AC97_READ	0x10	/* W: read, R: read in progress */
#define   VT1724_AC97_READY	0x08	/* codec ready status bit */
#define   VT1724_AC97_ID_MASK	0x03	/* codec id mask */
#define VT1724_MT_AC97_DATA		0x06	/* word - AC'97 data */
#define VT1724_MT_PLAYBACK_ADDR		0x10	/* dword - playback address */
#define VT1724_MT_PLAYBACK_SIZE		0x14	/* dword - playback size */
#define VT1724_MT_DMA_CONTROL		0x18	/* byte - control */
#define   VT1724_PDMA4_START	0x80	/* SPDIF out / PDMA4 start */
#define   VT1724_PDMA3_START	0x40	/* PDMA3 start */
#define   VT1724_PDMA2_START	0x20	/* PDMA2 start */
#define   VT1724_PDMA1_START	0x10	/* PDMA1 start */
#define   VT1724_RDMA1_START	0x04	/* RDMA1 start */
#define   VT1724_RDMA0_START	0x02	/* RMDA0 start */
#define   VT1724_PDMA0_START	0x01	/* MC Interleave / PDMA0 start */
#define VT1724_MT_BURST			0x19	/* Interleaved playback DMA Active streams / PCI burst size */
#define VT1724_MT_DMA_FIFO_ERR		0x1a	/*Global playback and record DMA FIFO Underrun/Overrun */
#define   VT1724_PDMA4_UNDERRUN		0x80
#define   VT1724_PDMA2_UNDERRUN		0x40
#define   VT1724_PDMA3_UNDERRUN		0x20
#define   VT1724_PDMA1_UNDERRUN		0x10
#define   VT1724_RDMA1_UNDERRUN		0x04
#define   VT1724_RDMA0_UNDERRUN		0x02
#define   VT1724_PDMA0_UNDERRUN		0x01
#define VT1724_MT_DMA_PAUSE		0x1b	/*Global playback and record DMA FIFO pause/resume */
#define	  VT1724_PDMA4_PAUSE	0x80
#define	  VT1724_PDMA3_PAUSE	0x40
#define	  VT1724_PDMA2_PAUSE	0x20
#define	  VT1724_PDMA1_PAUSE	0x10
#define	  VT1724_RDMA1_PAUSE	0x04
#define	  VT1724_RDMA0_PAUSE	0x02
#define	  VT1724_PDMA0_PAUSE	0x01
#define VT1724_MT_PLAYBACK_COUNT	0x1c	/* word - playback count */
#define VT1724_MT_CAPTURE_ADDR		0x20	/* dword - capture address */
#define VT1724_MT_CAPTURE_SIZE		0x24	/* word - capture size */
#define VT1724_MT_CAPTURE_COUNT		0x26	/* word - capture count */

#define VT1724_MT_ROUTE_PLAYBACK	0x2c	/* word */

#define VT1724_MT_RDMA1_ADDR		0x30	/* dword - RDMA1 capture address */
#define VT1724_MT_RDMA1_SIZE		0x34	/* word - RDMA1 capture size */
#define VT1724_MT_RDMA1_COUNT		0x36	/* word - RDMA1 capture count */

#define VT1724_MT_SPDIF_CTRL		0x3c	/* word */
#define VT1724_MT_MONITOR_PEAKINDEX	0x3e	/* byte */
#define VT1724_MT_MONITOR_PEAKDATA	0x3f	/* byte */

/* concurrent stereo channels */
#define VT1724_MT_PDMA4_ADDR		0x40	/* dword */
#define VT1724_MT_PDMA4_SIZE		0x44	/* word */
#define VT1724_MT_PDMA4_COUNT		0x46	/* word */
#define VT1724_MT_PDMA3_ADDR		0x50	/* dword */
#define VT1724_MT_PDMA3_SIZE		0x54	/* word */
#define VT1724_MT_PDMA3_COUNT		0x56	/* word */
#define VT1724_MT_PDMA2_ADDR		0x60	/* dword */
#define VT1724_MT_PDMA2_SIZE		0x64	/* word */
#define VT1724_MT_PDMA2_COUNT		0x66	/* word */
#define VT1724_MT_PDMA1_ADDR		0x70	/* dword */
#define VT1724_MT_PDMA1_SIZE		0x74	/* word */
#define VT1724_MT_PDMA1_COUNT		0x76	/* word */

unsigned char snd_vt1724_read_i2c(struct snd_ice1712 *ice, unsigned char dev, unsigned char addr);
void snd_vt1724_write_i2c(struct snd_ice1712 *ice, unsigned char dev, unsigned char addr, unsigned char data);

#endif /* __SOUND_VT1724_H */


owner = NOR
controller = NOR
add_core = NOR

infra = 1
1940.5.10 = {
	controller = GER

}
1941.6.22 = {
	controller = GER
}


    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Библиотека Арифметика</title>

Библиотека Арифметика

Библиотека Арифметика включает комбинационные компоненты, которые выполняют арифметические действия над значениями в виде беззнаковых чисел и в дополнительном коде.

	Сумматор

	Вычитатель

	Множитель

	Делитель

	Отрицатель

	Компаратор

	Сдвигатель

	Сумматор битов

	Искатель битов

Назад к Справке по библиотеке


load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
    name = "go_default_library",
    srcs = ["jws.go"],
    importmap = "k8s.io/kops/vendor/golang.org/x/oauth2/jws",
    importpath = "golang.org/x/oauth2/jws",
    visibility = ["//visibility:public"],
)


#define LIBCO_C
#include "libco.h"
#include "settings.h"

#ifdef __cplusplus
extern "C" {
#endif

#if defined(__clang__) || defined(__GNUC__)
  #define fastcall __attribute__((fastcall))
#elif defined(_MSC_VER)
  #define fastcall __fastcall
#else
  #error "libco: please define fastcall macro"
#endif

static thread_local long co_active_buffer[64];
static thread_local cothread_t co_active_handle = 0;
static void (fastcall *co_swap)(cothread_t, cothread_t) = 0;

#ifdef LIBCO_MPROTECT
  alignas(4096)
#else
  section(text)
#endif
/* ABI: fastcall */
static const unsigned char co_swap_function[4096] = {
  0x89, 0x22,        /* mov [edx],esp    */
  0x8b, 0x21,        /* mov esp,[ecx]    */
  0x58,              /* pop eax          */
  0x89, 0x6a, 0x04,  /* mov [edx+ 4],ebp */
  0x89, 0x72, 0x08,  /* mov [edx+ 8],esi */
  0x89, 0x7a, 0x0c,  /* mov [edx+12],edi */
  0x89, 0x5a, 0x10,  /* mov [edx+16],ebx */
  0x8b, 0x69, 0x04,  /* mov ebp,[ecx+ 4] */
  0x8b, 0x71, 0x08,  /* mov esi,[ecx+ 8] */
  0x8b, 0x79, 0x0c,  /* mov edi,[ecx+12] */
  0x8b, 0x59, 0x10,  /* mov ebx,[ecx+16] */
  0xff, 0xe0,        /* jmp eax          */
};

#ifdef _WIN32
  #include <windows.h>

  static void co_init() {
    #ifdef LIBCO_MPROTECT
    DWORD old_privileges;
    VirtualProtect((void*)co_swap_function, sizeof co_swap_function, PAGE_EXECUTE_READ, &old_privileges);
    #endif
  }
#else
  #ifdef LIBCO_MPROTECT
    #include <unistd.h>
    #include <sys/mman.h>
  #endif

  static void co_init() {
    #ifdef LIBCO_MPROTECT
    unsigned long addr = (unsigned long)co_swap_function;
    unsigned long base = addr - (addr % sysconf(_SC_PAGESIZE));
    unsigned long size = (addr - base) + sizeof co_swap_function;
    mprotect((void*)base, size, PROT_READ | PROT_EXEC);
    #endif
  }
#endif

static void crash() {
  LIBCO_ASSERT(0);  /* called only if cothread_t entrypoint returns */
}

cothread_t co_active() {
  if(!co_active_handle) co_active_handle = &co_active_buffer;
  return co_active_handle;
}

cothread_t co_derive(void* memory, unsigned int size, void (*entrypoint)(void)) {
  cothread_t handle;
  if(!co_swap) {
    co_init();
    co_swap = (void (fastcall*)(cothread_t, cothread_t))co_swap_function;
  }
  if(!co_active_handle) co_active_handle = &co_active_buffer;

  if(handle = (cothread_t)memory) {
    unsigned int offset = (size & ~15) - 32;
    long *p = (long*)((char*)handle + offset);  /* seek to top of stack */
    *--p = (long)crash;                         /* crash if entrypoint returns */
    *--p = (long)entrypoint;                    /* start of function */
    *(long*)handle = (long)p;                   /* stack pointer */
  }

  return handle;
}

cothread_t co_create(unsigned int size, void (*entrypoint)(void)) {
  void* memory = LIBCO_MALLOC(size);
  if(!memory) return (cothread_t)0;
  return co_derive(memory, size, entrypoint);
}

void co_delete(cothread_t handle) {
  LIBCO_FREE(handle);
}

void co_switch(cothread_t handle) {
  register cothread_t co_previous_handle = co_active_handle;
  co_swap(co_active_handle = handle, co_previous_handle);
}

int co_serializable() {
  return 1;
}

#ifdef __cplusplus
}
#endif


<!doctype html>

		<meta charset="utf-8">

		<title>reveal.js - Tests</title>

		<link rel="stylesheet" href="../css/reveal.min.css">
		<link rel="stylesheet" href="qunit-1.12.0.css">

1

2.1

2.2

2.3

3.1

4.1

4.2

4.3

3.2

4.1

4.2

3.3

3.3.1

3.3.2

3.3.3

4


/*
 *  Copyright 2009,2010,2011 Reality Jockey, Ltd.
 *                 info@rjdj.me
 *                 http://rjdj.me/
 *
 *  This file is part of ZenGarden.
 *
 *  ZenGarden is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  ZenGarden is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with ZenGarden.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef _MESSAGE_EXP_H_
#define _MESSAGE_EXP_H_

#include "MessageObject.h"

/** [exp] */
class MessageExp : public MessageObject {

  public:
    static MessageObject *newObject(PdMessage *initMessage, PdGraph *graph);
    MessageExp(PdMessage *initMessage, PdGraph *graph);
    ~MessageExp();

    static const char *getObjectLabel();
    std::string toString();

  private:
    void processMessage(int inletIndex, PdMessage *message);
};

inline const char *MessageExp::getObjectLabel() {
  return "exp";
}

inline std::string MessageExp::toString() {
  return MessageExp::getObjectLabel();
}

#endif // _MESSAGE_EXP_H_


# Go support for Protocol Buffers - Google's data interchange format
#
# Copyright 2010 The Go Authors.  All rights reserved.
# https://github.com/golang/protobuf
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#     * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
#     * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

test:
	cd testdata && make test


<template>
<div>
  This is component 2
</div>
</template>

<script>
export default {
  name: 'Component2',
  data () {
    return {}
  }
}
</script>
<stlye></stlye>


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SimplyMobile.Navigation
{
    using Core;

    public abstract class Navigator : INavigationController
    {
        public virtual bool NavigateTo<T>(object sender, T model) where T : ViewModel
        {
            var type = typeof(T);
            object t;

            Func<T, bool> target;

            if (this.Delegates.TryGetValue(type, out t))
            {
                target = t as Func<T, bool>;
                if (target == null)
                {
                    this.Delegates.Remove(type);
                }
                else
                {
                    return target (model);
                }
            }

            if (this.WeakDelegates.ContainsKey(type))
            {
                var funcDelegate = this.WeakDelegates[type];

                if (!funcDelegate.IsAlive || (target = funcDelegate.Target as Func<ViewModel, bool>) == null)
                {
                    this.WeakDelegates.Remove(type);
                    return false;
                }

                return target(model);
            }

            return false;
        }

        public void SetDelegate<T>(Func<T, bool> func) where T : ViewModel
        {
            var type = typeof(T);
            this.Delegates.Remove(type);
            this.WeakDelegates.Remove(type);
            this.Delegates.Add(type, func);
        }

        public void SetWeakDelegate<T>(Func<T, bool> func) where T : ViewModel
        {
            var type = typeof(T);
            this.WeakDelegates.Remove(type);
            this.WeakDelegates.Add(type, new WeakReference(func));
        }

        public virtual bool RemoveDelegates<T>() where T : ViewModel
        {
            return this.Delegates.Remove(typeof(T)) || this.WeakDelegates.Remove(typeof(T));
        }

        //public virtual bool RemoveWeakDelegate<T>() where T : ViewModel
        //{
        //    return this.WeakDelegates.Remove(typeof(T));
        //}

        //public virtual bool RemoveWeakDelegate<T>(Func<T, bool> func) where T : ViewModel
        //{
        //    var type = typeof(T);
        //    WeakReference reference;

        //    if (!this.WeakDelegates.TryGetValue(type, out reference))
        //    {
        //        return false;
        //    }

        //    Func<T, bool> target;

        //    if (!reference.IsAlive || (target = reference.Target as Func<T, bool>) == null
        //        || target.Equals(func))
        //    {
        //        return this.WeakDelegates.Remove(type);
        //    }

        //    return false;
        //}

        protected Navigator()
        {
            this.Delegates = new Dictionary<Type, object>();
            this.WeakDelegates = new Dictionary<Type, WeakReference>();
        }

        protected Dictionary<Type, object> Delegates;

        protected Dictionary<Type, WeakReference> WeakDelegates;
    }
}


/**
 * Copyright (c) 2015-present, Horcrux.
 * All rights reserved.
 *
 * This source code is licensed under the MIT-style license found in the
 * LICENSE file in the root directory of this source tree.
 */

#import "RNSVGGroupManager.h"

@interface RNSVGMaskManager : RNSVGGroupManager

@end


<UserControl x:Class="GalaSoft.Samples.RaiseCanExecuteChanged.Page"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight"
             mc:Ignorable="d"
             DataContext="{Binding Main, Source={StaticResource Locator}}">

    <Grid Style="{StaticResource MainGridStyle}">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="70" />
        </Grid.RowDefinitions>

        <TextBlock Text="{Binding Counter}"
                   Style="{StaticResource DisplayTextBlockStyle}" />

        <Button cmd:ButtonBaseExtensions.Command="{Binding IncreaseCounterCommand}"
                Grid.Row="2"
                Style="{StaticResource IncrementButtonStyle}"
                Content="Increment" />

        <ToggleButton Margin="10,0,0,0"
                      Style="{StaticResource ToggleButtonStyle}"
                      IsChecked="{Binding CanIncrement, Mode=TwoWay}"
                      Content="Enabled"
                      Tag="Disabled" />
    </Grid>
</UserControl>


8 个出没于终端中的吓人命令
======

> 欢迎来到 Linux 令人毛骨悚然的一面。

![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/halloween_bag_bat_diy.jpg?itok=24M0lX25)

又是一年中的这个时候：天气变冷了、树叶变色了，各处的孩子都化妆成了小鬼、妖精和僵尸。（LCTT 译注：本文原发表于万圣节）但你知道吗, Unix (和 Linux) 和它们的各个分支也充满了令人毛骨悚然的东西？让我们来看一下我们所熟悉和喜爱的操作系统的一些令人毛骨悚然的一面。

### 半神（守护进程）

如果没有潜伏于系统中的各种<ruby>守护进程<rt>daemon</rt></ruby>，那么 Unix 就没什么不同。守护进程是运行在后台的进程，并为用户和操作系统本身提供有用的服务，比如 SSH、FTP、HTTP 等等。

### 僵尸（僵尸进程）

不时出现的僵尸进程是一种被杀死但是拒绝离开的进程。当它出现时，无疑你只能选择你有的工具来赶走它。僵尸进程通常表明产生它的进程出现了问题。

### 杀死（kill）

你不仅可以使用 `kill` 来干掉一个僵尸进程，你还可以用它杀死任何对你系统产生负面影响的进程。有一个使用太多 RAM 或 CPU 周期的进程？使用 `kill` 命令杀死它。

### 猫（cat）

`cat` 和猫科动物无关，但是与文件操作有关：`cat` 是 “concatenate” 的缩写。你甚至可以使用这个方便的命令来查看文件的内容。

### 尾巴（tail）

当你想要查看文件中最后 n 行时，`tail` 命令很有用。当你想要监控一个文件时，它也很棒。

### 巫师（which）

哦，不，它不是巫师（witch）的一种。而是打印传递给它的命令所在的文件位置的命令。例如，`which python` 将在你系统上打印每个版本的 Python 的位置。

### 地下室（crypt）

`crypt` 命令，以前称为 `mcrypt`，当你想要加密（encrypt）文件的内容时，它是很方便的，这样除了你之外没有人可以读取它。像大多数 Unix 命令一样，你可以单独使用 `crypt` 或在系统脚本中调用它。

### 切碎（shred）

当你不仅要删除文件还想要确保没有人能够恢复它时，`shred` 命令很方便。使用 `rm` 命令删除文件是不够的。你还需要覆盖该文件以前占用的空间。这就是 `shred` 的用武之地。

这些只是你会在 Unix 中发现的一部分令人毛骨悚然的东西。你还知道其他诡异的命令么？请随时告诉我。

万圣节快乐！（LCTT：可惜我们翻译完了，只能将恐怖的感觉延迟了 :D）

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

via: https://opensource.com/article/18/10/spookier-side-unix-linux

作者：[Patrick H.Mullins][a]
选题：[lujun9972][b]
译者：[geekpi](https://github.com/geekpi)
校对：[wxy](https://github.com/wxy)

本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出

[a]: https://opensource.com/users/pmullins
[b]: https://github.com/lujun9972


package com.mrcoder.sbredisproducerconsumer.config;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;

/**
 * @Description: Redis配置类
 */
@Configuration
@ConditionalOnClass({RedisTemplate.class})
public class RedisConfig {

    /**
     * Redis操作模板配置
     *
     * @param connectionFactory
     * @return
     */
    @Bean
    public RedisTemplate<?, ?> redisTemplate(RedisConnectionFactory connectionFactory) {
        RedisTemplate<byte[], byte[]> template = new RedisTemplate<byte[], byte[]>();
        template.setConnectionFactory(connectionFactory);
        template.setKeySerializer(new StringRedisSerializer());
        template.afterPropertiesSet();
        return template;
    }

    @Bean
    public RedisTemplate<?, ?> redisTemplate(RedisConnectionFactory connectionFactory, Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer) {
        RedisTemplate<byte[], byte[]> template = new RedisTemplate<byte[], byte[]>();
        template.setConnectionFactory(connectionFactory);
        // 设置key/hashkey序列化
        RedisSerializer<String> stringSerializer = new StringRedisSerializer();
        template.setKeySerializer(stringSerializer);
        template.setHashKeySerializer(stringSerializer);

        // 设置值序列化
        template.setValueSerializer(jackson2JsonRedisSerializer);
        template.setHashValueSerializer(jackson2JsonRedisSerializer);
        template.afterPropertiesSet();

        template.setKeySerializer(new StringRedisSerializer());
        template.afterPropertiesSet();

        return template;
    }

    /**
     * 序列化定制
     *
     * @return
     */
    @Bean
    public Jackson2JsonRedisSerializer<Object> jackson2JsonSerializer() {
        Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(
                Object.class);

        // 初始化objectmapper
        ObjectMapper mapper = new ObjectMapper();
        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
        mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
        jackson2JsonRedisSerializer.setObjectMapper(mapper);
        return jackson2JsonRedisSerializer;
    }

}


//
//  SwifterPlaces.swift
//  Swifter
//
//  Copyright (c) 2014 Matt Donnelly.
//
//  Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
//
//  The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
//

import Foundation

public extension Swifter {

    /**
     GET    geo/id/:place_id

     Returns all the information about a known place.
     */
    func getGeoID(for placeID: String,
                  success: SuccessHandler? = nil,
                  failure: FailureHandler? = nil) {
        let path = "geo/id/\(placeID).json"
        self.getJSON(path: path, baseURL: .api, parameters: [:], success: { json, _ in
            success?(json)
        }, failure: failure)
    }

    /**
     GET    geo/reverse_geocode

     Given a latitude and a longitude, searches for up to 20 places that can be used as a place_id when updating a status.

     This request is an informative call and will deliver generalized results about geography.
     */
    func getReverseGeocode(for coordinate: (lat: Double, long: Double),
                           accuracy: String? = nil,
                           granularity: String? = nil,
                           maxResults: Int? = nil,
                           success: SuccessHandler? = nil,
                           failure: FailureHandler? = nil) {
        let path = "geo/reverse_geocode.json"

        var parameters = [String: Any]()
        parameters["lat"] = coordinate.lat
        parameters["long"] = coordinate.long
        parameters["accuracy"] ??= accuracy
        parameters["granularity"] ??= granularity
        parameters["max_results"] ??= maxResults

        self.getJSON(path: path, baseURL: .api, parameters: parameters, success: { json, _ in
            success?(json)
        }, failure: failure)
    }

    /**
     GET    geo/search

     Search for places that can be attached to a statuses/update. Given a latitude and a longitude pair, an IP address, or a name, this request will return a list of all the valid places that can be used as the place_id when updating a status.

     Conceptually, a query can be made from the user's location, retrieve a list of places, have the user validate the location he or she is at, and then send the ID of this location with a call to POST statuses/update.

     This is the recommended method to use find places that can be attached to statuses/update. Unlike GET geo/reverse_geocode which provides raw data access, this endpoint can potentially re-order places with regards to the user who is authenticated. This approach is also preferred for interactive place matching with the user.
     */
    func searchGeo(coordinate: (lat: Double, long: Double)? = nil,
                   query: String? = nil,
                   ipAddress: String? = nil,
                   accuracy: String? = nil,
                   granularity: String? = nil,
                   maxResults: Int? = nil,
                   containedWithin: String? = nil,
                   attributeStreetAddress: String? = nil,
                   success: SuccessHandler? = nil,
                   failure: FailureHandler? = nil) {
        assert(coordinate != nil || query != nil || ipAddress != nil,
               "At least one of the following parameters must be provided to access this resource: coordinate, ipAddress, or query")

        let path = "geo/search.json"

        var parameters = [String: Any]()
        if let coordinate = coordinate {
            parameters["lat"] = coordinate.lat
            parameters["long"] = coordinate.long
        } else if let query = query {
            parameters["query"] = query
        } else if let ip = ipAddress {
            parameters["ip"] = ip
        }
        parameters["accuracy"] ??= accuracy
        parameters["granularity"] ??= granularity
        parameters["max_results"] ??= maxResults
        parameters["contained_within"] ??= containedWithin
        parameters["attribute:street_address"] ??= attributeStreetAddress

        self.getJSON(path: path, baseURL: .api, parameters: parameters, success: { json, _ in success?(json) }, failure: failure)
    }

    /**
     GET    geo/similar_places

     Locates places near the given coordinates which are similar in name.

     Conceptually you would use this method to get a list of known places to choose from first. Then, if the desired place doesn't exist, make a request to POST geo/place to create a new one.

     The token contained in the response is the token needed to be able to create a new place.
     */
    func getSimilarPlaces(for coordinate: (lat: Double, long: Double),
                          name: String,
                          containedWithin: String? = nil,
                          attributeStreetAddress: String? = nil,
                          success: SuccessHandler? = nil,
                          failure: FailureHandler? = nil) {
        let path = "geo/similar_places.json"

        var parameters = [String: Any]()
        parameters["lat"] = coordinate.lat
        parameters["long"] = coordinate.long
        parameters["name"] = name
        parameters["contained_within"] ??= containedWithin
        parameters["attribute:street_address"] ??= attributeStreetAddress

        self.getJSON(path: path, baseURL: .api, parameters: parameters, success: { json, _ in
            success?(json)
        }, failure: failure)
    }

}