效果图


实现

这里小编只讲编辑器的主体部分,及两个选择框以及编辑器部分。
首先是选择器,毕竟主体的编辑器需要通过选择器来改变样式以及提供语言高亮等支持

SelectBox.js

import React from 'react';
import { Select } from 'element-react';
import { Layout } from 'element-react';
import 'element-theme-default';
import valueData from '../../../jsondata/editor-data.json'class SelectBox extends React.Component{constructor(props) {super(props);this.state = {//支持的语言options: [{value: '选项1',label: 'apex',},{value: '选项2',label: 'azcli',},{value: '选项3',label: 'bat',},{value: '选项4',label: 'c'},{value: '选项5',label: 'clojure',},{value: '选项6',label: 'coffeescript',},{value: '选项7',label: 'cpp',},{value: '选项8',label: 'csharp',},{value: '选项9',label: 'csp',},{value: '选项10',label: 'css',},{value: '选项11',label: 'dockerfile',},{value: '选项12',label: 'fsharp',},{value: '选项13',label: 'go',},{value: '选项14',label: 'handlebars',},{value: '选项15',label: 'html',},{value: '选项16',label: 'ini',},{value: '选项17',label: 'java',},{value: '选项18',label: 'javascript',},{value: '选项19',label: 'json',},{value: '选项20',label: 'less',},{value: '选项21',label: 'lua',},{value: '选项22',label: 'markdown',},{value: '选项23',label: 'msdax',},{value: '选项24',label: 'mysql',},{value: '选项25',label: 'objective',},{value: '选项26',label: 'pascal',},{value: '选项27',label: 'perl',},{value: '选项28',label: 'pgsql',},{value: '选项29',label: 'php',},{value: '选项30',label: 'postiats',},{value: '选项31',label: 'powerquery',},{value: '选项32',label: 'powershell',},{value: '选项33',label: 'pug',},{value: '选项34',label: 'python',},{value: '选项35',label: 'r',},{value: '选项36',label: 'razor',},{value: '选项37',label: 'redis',},{value: '选项38',label: 'redshift',},{value: '选项39',label: 'ruby',},{value: '选项40',label: 'rust',},{value: '选项41',label: 'sb',},{value: '选项42',label: 'scheme',},{value: '选项43',label: 'scss',},{value: '选项44',label: 'shell',},{value: '选项45',label: 'sol',},{value: '选项46',label: 'sql',},{value: '选项47',label: 'st',},{value: '选项48',label: 'swift',},{value: '选项49',label: 'typescript',},{value: '选项50',label: 'vb',},{value: '选项51',label: 'xml',},{value: '选项52',label: 'yaml'}],//支持的主题theme: [{value: '选项1',label: 'Visual Studio',},{value: '选项2',label: 'Visual Studio Dark',},{value: '选项3',label: 'Hight Contrast Dark',},],value: ''};}//改变主题,通过Select的onChnage触发handleSelectTheme(event){//根据选择设置对主题的值let selectval = '';if (event === '选项1') {selectval = 'vs';} else if (event === '选项2') {selectval = 'vs-dark';} else if (event === '选项3') {selectval = 'hc-black';}//通过调用父组件的方法,修改父组件中的statethis.props.ChangeTheme(selectval);}//改变语言,通过Select的onChnage触发handleSelectLanguage(event){//通过调用父组件的方法,修改父组件中的state,修改的是语言this.props.ChangeLanguage(event);for(let i = 0;i < valueData.values.length;i++){if (valueData.values[i].language === event){//通过调用父组件的方法,修改父组件中的state//修改的是编辑框中显示的内容//这里是用的是json数据this.props.ChangeValue(valueData.values[i].value);}}}render() {return (<div><Layout.Row><Layout.Col span="12"><div className="grid-content bg-purple-light"><span>主题:</span><Select value={this.state.value} placeholder="请选择" onChange={this.handleSelectTheme.bind(this)}>{this.state.theme.map(el => {return <Select.Option  key={el.value} label={el.label} value={el.value}/>})}</Select></div></Layout.Col><Layout.Col span="12"><div className="grid-content bg-purple-light"><span>语言:</span><Select value={this.state.value} placeholder="请选择" onChange={this.handleSelectLanguage.bind(this)}>{this.state.options.map(el => {return <Select.Option  key={el.value} label={el.label} value={el.label}/>})}</Select></div></Layout.Col></Layout.Row></div>);}
}export default SelectBox;

json数据

{"values": [{"language": "apex","value": "/* Using a single database query, find all the leads in\n    the database that have the same email address as any\n    of the leads being inserted or updated. */\nfor (Lead lead : [SELECT Email FROM Lead WHERE Email IN :leadMap.KeySet()]) {\n    Lead newLead = leadMap.get(lead.Email);\n    newLead.Email.addError('A lead with this email address already exists.');\n}\n"},{"language": "azcli","value": "# Create a resource group.\naz group create --name myResourceGroup --location westeurope\n\n# Create a new virtual machine, this creates SSH keys if not present.\naz vm create --resource-group myResourceGroup --name myVM --image UbuntuLTS --generate-ssh-keys"},{"language": "bat","value": "rem *******Begin Comment**************\nrem This program starts the superapp batch program on the network,\nrem directs the output to a file, and displays the file\nrem in Notepad.\nrem *******End Comment**************\n@echo off\nif exist C:\\output.txt goto EMPTYEXISTS\nsetlocal\n\tpath=g:\\programs\\superapp;%path%\n\tcall superapp>C:\\output.txt\nendlocal\n:EMPTYEXISTS\nstart notepad c:\\output.txt"},{"language": "clojure","value": "(ns game-of-life\n  \"Conway's Game of Life, based on the work of\n  Christophe Grand (http://clj-me.cgrand.net/2011/08/19/conways-game-of-life)\n  and Laurent Petit (https://gist.github.com/1200343).\")\n\n;;; Core game of life's algorithm functions\n\n(defn neighbors\n  \"Given a cell's coordinates `[x y]`, returns the coordinates of its\n  neighbors.\"\n  [[x y]]\n  (for [dx [-1 0 1]\n        dy (if (zero? dx)\n             [-1 1]\n             [-1 0 1])]\n    [(+ dx x) (+ dy y)]))\n\n(defn step\n  \"Given a set of living `cells`, computes the new set of living cells.\"\n  [cells]\n  (set (for [[cell n] (frequencies (mapcat neighbors cells))\n             :when (or (= n 3)\n                       (and (= n 2)\n                            (cells cell)))]\n         cell)))\n\n;;; Utility methods for displaying game on a text terminal\n\n(defn print-grid\n  \"Prints a `grid` of `w` columns and `h` rows, on *out*, representing a\n  step in the game.\"\n  [grid w h]\n  (doseq [x (range (inc w))\n          y (range (inc h))]\n    (when (= y 0) (println))\n    (print (if (grid [x y])\n             \"[X]\"\n             \" . \"))))\n\n(defn print-grids\n  \"Prints a sequence of `grids` of `w` columns and `h` rows on *out*,\n  representing several steps.\"\n  [grids w h]\n  (doseq [grid grids]\n    (print-grid grid w h)\n    (println)))\n\n;;; Launches an example grid\n\n(def grid\n  \"`grid` represents the initial set of living cells\"\n  #{[2 1] [2 2] [2 3]})\n\n(print-grids (take 3 (iterate step grid)) 5 5)"},{"language": "coffeescript","value": "\"\"\"\nA CoffeeScript sample.\n\"\"\"\n\nclass Vehicle\n  constructor: (@name) =>\n  \n  drive: () =>\n    alert \"Conducting #{@name}\"\n\nclass Car extends Vehicle\n  drive: () =>\n    alert \"Driving #{@name}\"\n\nc = new Car \"Brandie\"\n\nwhile notAtDestination()\n  c.drive()\n\nraceVehicles = (new Car for i in [1..100])\n\nstartRace = (vehicles) -> [vehicle.drive() for vehicle in vehicles]\n\nfancyRegExp = ///\n\t(\\d+)\t# numbers\n\t(\\w*)\t# letters\n\t$\t\t# the end\n///\n"},{"language": "cpp","value": "#include \"pch.h\"\n#include \"Direct3DBase.h\"\n\nusing namespace Microsoft::WRL;\nusing namespace Windows::UI::Core;\nusing namespace Windows::Foundation;\n\n// Constructor.\nDirect3DBase::Direct3DBase()\n{\n}\n\n// Initialize the Direct3D resources required to run.\nvoid Direct3DBase::Initialize(CoreWindow^ window)\n{\n    m_window = window;\n    \n    CreateDeviceResources();\n    CreateWindowSizeDependentResources();\n}\n\n// These are the resources that depend on the device.\nvoid Direct3DBase::CreateDeviceResources()\n{\n    // This flag adds support for surfaces with a different color channel ordering than the API default.\n    // It is recommended usage, and is required for compatibility with Direct2D.\n    UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;\n\n#if defined(_DEBUG)\n    // If the project is in a debug build, enable debugging via SDK Layers with this flag.\n    creationFlags |= D3D11_CREATE_DEVICE_DEBUG;\n#endif\n\n    // This array defines the set of DirectX hardware feature levels this app will support.\n    // Note the ordering should be preserved.\n    // Don't forget to declare your application's minimum required feature level in its\n    // description.  All applications are assumed to support 9.1 unless otherwise stated.\n    D3D_FEATURE_LEVEL featureLevels[] = \n    {\n        D3D_FEATURE_LEVEL_11_1,\n        D3D_FEATURE_LEVEL_11_0,\n        D3D_FEATURE_LEVEL_10_1,\n        D3D_FEATURE_LEVEL_10_0,\n        D3D_FEATURE_LEVEL_9_3,\n        D3D_FEATURE_LEVEL_9_2,\n        D3D_FEATURE_LEVEL_9_1\n    };\n\n    // Create the DX11 API device object, and get a corresponding context.\n    ComPtr<ID3D11Device> device;\n    ComPtr<ID3D11DeviceContext> context;\n    DX::ThrowIfFailed(\n        D3D11CreateDevice(\n            nullptr,                    // specify null to use the default adapter\n            D3D_DRIVER_TYPE_HARDWARE,\n            nullptr,                    // leave as nullptr unless software device\n            creationFlags,              // optionally set debug and Direct2D compatibility flags\n            featureLevels,              // list of feature levels this app can support\n            ARRAYSIZE(featureLevels),   // number of entries in above list\n            D3D11_SDK_VERSION,          // always set this to D3D11_SDK_VERSION\n            &device,                    // returns the Direct3D device created\n            &m_featureLevel,            // returns feature level of device created\n            &context                    // returns the device immediate context\n            )\n        );\n\n    // Get the DirectX11.1 device by QI off the DirectX11 one.\n    DX::ThrowIfFailed(\n        device.As(&m_d3dDevice)\n        );\n\n    // And get the corresponding device context in the same way.\n    DX::ThrowIfFailed(\n        context.As(&m_d3dContext)\n        );\n}\n\n// Allocate all memory resources that change on a window SizeChanged event.\nvoid Direct3DBase::CreateWindowSizeDependentResources()\n{ \n    // Store the window bounds so the next time we get a SizeChanged event we can\n    // avoid rebuilding everything if the size is identical.\n    m_windowBounds = m_window->Bounds;\n\n    // If the swap chain already exists, resize it.\n    if(m_swapChain != nullptr)\n    {\n        DX::ThrowIfFailed(\n            m_swapChain->ResizeBuffers(2, 0, 0, DXGI_FORMAT_B8G8R8A8_UNORM, 0)\n            );\n    }\n    // Otherwise, create a new one.\n    else\n    {\n        // Create a descriptor for the swap chain.\n        DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0};\n        swapChainDesc.Width = 0;                                     // use automatic sizing\n        swapChainDesc.Height = 0;\n        swapChainDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;           // this is the most common swapchain format\n        swapChainDesc.Stereo = false; \n        swapChainDesc.SampleDesc.Count = 1;                          // don't use multi-sampling\n        swapChainDesc.SampleDesc.Quality = 0;\n        swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;\n        swapChainDesc.BufferCount = 2;                               // use two buffers to enable flip effect\n        swapChainDesc.Scaling = DXGI_SCALING_NONE;\n        swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; // we recommend using this swap effect for all applications\n        swapChainDesc.Flags = 0;\n\n        // Once the desired swap chain description is configured, it must be created on the same adapter as our D3D Device\n\n        // First, retrieve the underlying DXGI Device from the D3D Device\n        ComPtr<IDXGIDevice1>  dxgiDevice;\n        DX::ThrowIfFailed(\n            m_d3dDevice.As(&dxgiDevice)\n            );\n\n        // Identify the physical adapter (GPU or card) this device is running on.\n        ComPtr<IDXGIAdapter> dxgiAdapter;\n        DX::ThrowIfFailed(\n            dxgiDevice->GetAdapter(&dxgiAdapter)\n            );\n\n        // And obtain the factory object that created it.\n        ComPtr<IDXGIFactory2> dxgiFactory;\n        DX::ThrowIfFailed(\n            dxgiAdapter->GetParent(\n                __uuidof(IDXGIFactory2), \n                &dxgiFactory\n                )\n            );\n\n\t\tWindows::UI::Core::CoreWindow^ p = m_window.Get();\n\n        // Create a swap chain for this window from the DXGI factory.\n        DX::ThrowIfFailed(\n            dxgiFactory->CreateSwapChainForCoreWindow(\n                m_d3dDevice.Get(),\n                reinterpret_cast<IUnknown*>(p),\n                &swapChainDesc,\n                nullptr,    // allow on all displays\n                &m_swapChain\n                )\n            );\n            \n        // Ensure that DXGI does not queue more than one frame at a time. This both reduces \n        // latency and ensures that the application will only render after each VSync, minimizing \n        // power consumption.\n        DX::ThrowIfFailed(\n            dxgiDevice->SetMaximumFrameLatency(1)\n            );\n    }\n    \n    // Obtain the backbuffer for this window which will be the final 3D rendertarget.\n    ComPtr<ID3D11Texture2D> backBuffer;\n    DX::ThrowIfFailed(\n        m_swapChain->GetBuffer(\n            0,\n            __uuidof(ID3D11Texture2D),\n            &backBuffer\n            )\n        );\n\n    // Create a view interface on the rendertarget to use on bind.\n    DX::ThrowIfFailed(\n        m_d3dDevice->CreateRenderTargetView(\n            backBuffer.Get(),\n            nullptr,\n            &m_renderTargetView\n            )\n        );\n\n    // Cache the rendertarget dimensions in our helper class for convenient use.\n    D3D11_TEXTURE2D_DESC backBufferDesc;\n    backBuffer->GetDesc(&backBufferDesc);\n    m_renderTargetSize.Width  = static_cast<float>(backBufferDesc.Width);\n    m_renderTargetSize.Height = static_cast<float>(backBufferDesc.Height);\n\n    // Create a descriptor for the depth/stencil buffer.\n    CD3D11_TEXTURE2D_DESC depthStencilDesc(\n        DXGI_FORMAT_D24_UNORM_S8_UINT, \n        backBufferDesc.Width,\n        backBufferDesc.Height,\n        1,\n        1,\n        D3D11_BIND_DEPTH_STENCIL);\n\n    // Allocate a 2-D surface as the depth/stencil buffer.\n    ComPtr<ID3D11Texture2D> depthStencil;\n    DX::ThrowIfFailed(\n        m_d3dDevice->CreateTexture2D(\n            &depthStencilDesc,\n            nullptr,\n            &depthStencil\n            )\n        );\n\n    // Create a DepthStencil view on this surface to use on bind.\n    DX::ThrowIfFailed(\n        m_d3dDevice->CreateDepthStencilView(\n            depthStencil.Get(),\n            &CD3D11_DEPTH_STENCIL_VIEW_DESC(D3D11_DSV_DIMENSION_TEXTURE2D),\n            &m_depthStencilView\n            )\n        );\n\n    // Create a viewport descriptor of the full window size.\n    CD3D11_VIEWPORT viewPort(\n        0.0f,\n        0.0f,\n        static_cast<float>(backBufferDesc.Width),\n        static_cast<float>(backBufferDesc.Height)\n        );\n        \n    // Set the current viewport using the descriptor.\n    m_d3dContext->RSSetViewports(1, &viewPort);\n}\n\nvoid Direct3DBase::UpdateForWindowSizeChange()\n{\n    if (m_window->Bounds.Width  != m_windowBounds.Width ||\n        m_window->Bounds.Height != m_windowBounds.Height)\n    {\n        m_renderTargetView = nullptr;\n        m_depthStencilView = nullptr;\n        CreateWindowSizeDependentResources();\n    }\n}\n\nvoid Direct3DBase::Present()\n{\n    // The first argument instructs DXGI to block until VSync, putting the application\n    // to sleep until the next VSync. This ensures we don't waste any cycles rendering\n    // frames that will never be displayed to the screen.\n    HRESULT hr = m_swapChain->Present(1, 0);\n\n    // If the device was removed either by a disconnect or a driver upgrade, we \n    // must completely reinitialize the renderer.\n    if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)\n    {\n        Initialize(m_window.Get());\n    }\n    else\n    {\n        DX::ThrowIfFailed(hr);\n    }\n}\n"},{"language": "csharp","value": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace VS\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tProcessStartInfo si = new ProcessStartInfo();\n\t\t\tfloat load= 3.2e02f;\n\n\t\t\tsi.FileName = @\"tools\\\\node.exe\";\n\t\t\tsi.Arguments = \"tools\\\\simpleserver.js\";\n\n\t\t\tProcess.Start(si);\n\t\t}\n\t}\n}\n"},{"language": "csp","value": "Content-Security-Policy: default-src 'self'; img-src *; media-src media1.com media2.com; script-src userscripts.example.com"},{"language": "css","value": "html {\n    background-color: #e2e2e2;\n    margin: 0;\n    padding: 0;\n}\n\nbody {\n    background-color: #fff;\n    border-top: solid 10px #000;\n    color: #333;\n    font-size: .85em;\n    font-family: \"Segoe UI\",\"HelveticaNeue-Light\", sans-serif;\n    margin: 0;\n    padding: 0;\n}\n\na:link, a:visited, \na:active, a:hover {\n    color: #333;\n    outline: none;\n    padding-left: 0;\n    padding-right: 3px;\n    text-decoration: none;\n        \n}\n\n\na:hover {\n    background-color: #c7d1d6;\n}\n\n\nheader, footer, hgroup\nnav, section {\n    display: block;\n}\n\n.float-left {\n    float: left;\n}\n\n.float-right {\n    float: right;\n}\n\n.highlight {\n/*    background-color: #a6dbed;\n    padding-left: 5px;\n    padding-right: 5px;*/\n}\n\n.clear-fix:after {\n    content: \".\";\n    clear: both;\n    display: block;\n    height: 0;\n    visibility: hidden;\n}\n\nh1, h2, h3, \nh4, h5, h6 {\n    color: #000;\n    margin-bottom: 0;\n    padding-bottom: 0;\n    \n}\n\nh1 {\n    font-size: 2em; \n}\n\nh2 {\n    font-size: 1.75em;\n}\n\nh3 {\n    font-size: 1.2em;\n}\n\nh4 {\n    font-size: 1.1em;\n}\n\nh5, h6 {\n    font-size: 1em;\n}\n\n\n.tile {\n    /* 2px solid #7ac0da; */\n    border: 0;\n    \n    float: left;\n    width: 200px;\n    height: 325px;\n    \n    padding: 5px;\n    margin-right: 5px;\n    margin-bottom: 20px;\n    margin-top: 20px;\n    -webkit-perspective: 0;\n    -webkit-transform-style: preserve-3d;\n    -webkit-transition: -webkit-transform 0.2s;\n    -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.3);\n    background-position: center center;\n    background-repeat: no-repeat;\n    \n    background-color:  #fff;\n}\n\n.tile-item {\n    /* 2px solid #7ac0da; */\n    border-color: inherit;\n    float: left;\n    width: 50px;\n    height: 70px;\n    margin-right: 20px;\n    margin-bottom: 20px;\n    margin-top: 20px;\n    background-image: url('../Images/documents.png');\n    background-repeat: no-repeat;\n    \n}\n\n.tile-wrapper {\n    width: 100%;\n    font-family: \"Segoe UI\" , Tahoma, Geneva, Verdana, sans-serif;\n    line-height: 21px;\n    font-size: 14px;\n}\n\na.blue-box {\n    font-size: 28px;\n    height: 100px;\n    display: block;\n    border-style: solid;\n    border-width: 1px 1px 4px 1px;\n    border-color: #C0C0C0 #C0C0C0 #8ABAE4 #C0C0C0;\n    padding-top: 15px;\n    padding-left: 15px;\n}\n\n    a.blue-box:hover {\n    border: 4px solid #8ABAE4; \n    padding-top: 12px;\n    padding-left: 12px;\n    background-color: #FFFFFF;\n}\n    \na.green-box {\n    font-size: 28px;\n    height: 100px;\n    display: block;\n    border-style: solid;\n    border-width: 1px 1px 4px 1px;\n    border-color: #C0C0C0 #C0C0C0 #9CCF42 #C0C0C0;\n    padding-top: 15px;\n    padding-left: 15px;\n}\n\n    a.green-box:hover {\n        border: 4px solid #9CCF42; \n        padding-top: 12px;\n        padding-left: 12px;\n        background-color: #FFFFFF;\n}\n\n\na.green-box2 {\n    font-size: 14px;\n    height: 48px;\n    width: 48px;\n    display: block; /* border-color: #C0C0C0; */\n    padding-top: 6px;\n    font-weight: bold;\n    \n}\n\n    a.green-box2:hover {\n    border: solid #8ABAE4;\n    padding-top: 0px;\n    padding-left: 0px;\n    background-image: url('../Images/documents.png');\n    background-color: #EFEFEF;\n}\n\na.yellow-box {\n    font-size: 28px;\n    height: 100px;\n    display: block;\n    border-style: solid;\n    border-width: 1px 1px 4px 1px;\n    border-color: #C0C0C0 #C0C0C0 #DECF6B #C0C0C0;\n    padding-top: 15px;\n    padding-left: 15px;\n}\n\n    a.yellow-box:hover {\n        border: 4px solid #DECF6B; \n        padding-top: 12px;\n        padding-left: 12px;\n        background-color: #FFFFFF;\n}\n    \n    \na.red-box {\n    font-size: 28px;\n    height: 100px;\n    display: block;\n    border-style: solid;\n    border-width: 1px 1px 4px 1px;\n    border-color: #C0C0C0 #C0C0C0 #F79E84 #C0C0C0;\n    padding-top: 15px;\n    padding-left: 15px;\n}\n\n    a.red-box:hover {\n    border: 4px solid #F79E84; \n    padding-top: 12px;\n    padding-left: 12px;\n    background-color: #FFFFFF;\n}\n    \n/* main layout \n----------------------------------------------------------*/\n.content-wrapper {\n    margin: 0 auto;\n    max-width: 960px;\n}\n\n#body {\n    background-color: #efeeef;\n    clear: both;\n    padding-bottom: 35px;\n}\n\n    .main-content {\n        background: url(\"../images/accent.png\") no-repeat;\n        padding-left: 10px;\n        padding-top: 30px;\n    }\n\n    .featured + .main-content {\n        background: url(\"../images/heroaccent.png\") no-repeat;\n    }\n\nfooter {\n    clear: both;\n    background-color: #e2e2e2;\n    font-size: .8em;\n    height: 100px;\n}\n\n\n/* site title\n----------------------------------------------------------*/\n.site-title {\n    color: #0066CC; /* font-family: Rockwell, Consolas, \"Courier New\", Courier, monospace; */\n    font-size: 3.3em;\n    margin-top: 40px;\n    margin-bottom: 0;\n}\n\n.site-title a, .site-title a:hover, .site-title a:active  {\n    background: none;\n    color: #0066CC;\n    outline: none;\n    text-decoration: none;\n}\n\n\n/* login  \n----------------------------------------------------------*/\n#login {\n    display: block;\n    font-size: .85em;\n    margin-top: 20px;\n    text-align: right;\n}\n\n    #login a {\n        background-color: #d3dce0;\n        margin-left: 10px;\n        margin-right: 3px;\n        padding: 2px 3px;\n        text-decoration: none;\n    }\n    \n    #login a.username {\n        background: none;\n        margin-left: 0px;\n        text-decoration: underline;\n    }\n\n    #login li {\n        display: inline;\n        list-style: none;\n    }\n    \n    \n/* menu  \n----------------------------------------------------------*/\nul#menu {\n    font-size: 1.3em;\n    font-weight: 600;\n    margin: 0;\n    text-align: right;\n            text-decoration: none;\n\n}\n\n    ul#menu li {\n        display: inline;\n        list-style: none;\n        padding-left: 15px;\n    }\n\n        ul#menu li a {\n            background: none;\n            color: #999;\n            text-decoration: none;\n        }\n\n        ul#menu li a:hover {\n            color: #333;\n            text-decoration: none;\n        }\n\n\n\n/* page elements  \n----------------------------------------------------------*/\n/* featured */\n.featured {\n    background-color: #fff;\n}\n\n    .featured .content-wrapper {\n        /*background-color: #7ac0da;\n        background-image: -ms-linear-gradient(left, #7AC0DA 0%, #A4D4E6 100%);\n        background-image: -o-linear-gradient(left, #7AC0DA 0%, #A4D4E6 100%);\n        background-image: -webkit-gradient(linear, left top, right top, color-stop(0, #7AC0DA), color-stop(1, #A4D4E6));\n        background-image: -webkit-linear-gradient(left, #7AC0DA 0%, #A4D4E6 100%);\n        background-image: linear-gradient(left, #7AC0DA 0%, #A4D4E6 100%);\n        color: #3e5667;\n        */\n        padding:  0px 40px 30px 40px;\n    }\n\n        .featured hgroup.title h1, .featured hgroup.title h2 {\n            /* color: #fff;\n                */\n        }\n\n        .featured p {\n            font-size: 1.1em;\n        }\n\n/* page titles */ \nhgroup.title {\n    margin-bottom: 10px;\n}\n\nhgroup.title h1, hgroup.title h2 {\ndisplay: inline;\n}\n\nhgroup.title h2 {\n    font-weight: normal;\n}\n\n/* releases */\n.milestone {\n    color: #fff;\n    background-color: #8ABAE4;\n    font-weight:  normal;\n    padding:  10px 10px 10px 10px;\n    margin: 0 0 0 0;\n}\n    .milestone .primary {\n        font-size: 1.75em;\n    }\n\n    .milestone .secondary {\n    font-size: 1.2em;\n    font-weight: normal;\n    /* padding: 5px 5px 5px 10px;*/\n        }\n    \n/* features */\nsection.feature {\n    width: 200px;\n    float: left;\n    padding: 10px;\n}\n\n/* ordered list */\nol.round {\n    list-style-type: none;\n    padding-left: 0;\n}\n\n    ol.round li {\n        margin: 25px 0;\n        padding-left: 45px;\n    }\n    \n        ol.round li.one {\n            background: url(\"../images/orderedlistOne.png\") no-repeat;        \n        }\n    \n        ol.round li.two {\n            background: url(\"../images/orderedlistTwo.png\") no-repeat;        \n        }\n    \n        ol.round li.three {\n            background: url(\"../images/orderedlistThree.png\") no-repeat;        \n        }\n    \n/* content */  \narticle {\n    float: left;\n    width: 70%;\n}\n\naside {\n    float: right;\n    width: 25%;\n}\n\n    aside ul {\n        list-style: none;\n        padding: 0;\n    }\n    \n     aside ul li {\n        background: url(\"../images/bullet.png\") no-repeat 0 50%;\n        padding: 2px 0 2px 20px;\n     }\n     \n.label {\n    font-weight: 700;\n}\n\n/* login page */ \n#loginForm {\n    border-right: solid 2px #c8c8c8;\n    float: left;\n    width: 45%;\n}\n\n    #loginForm .validation-error {\n        display: block;\n        margin-left: 15px;\n    }\n\n#socialLoginForm {\n    margin-left: 40px;\n    float: left;\n    width: 50%;\n}\n\n/* contact */\n.contact h3 {\n    font-size: 1.2em;\n}\n\n.contact p {\n    margin: 5px 0 0 10px;\n}\n\n.contact iframe {\n    border: solid 1px #333;\n    margin: 5px 0 0 10px;\n}\n\n/* forms */\nfieldset {\n    border: none;\n    margin: 0;\n    padding: 0;\n}\n\n    fieldset legend {\n        display: none;\n    }\n    \n    fieldset ol {\n        padding: 0;\n        list-style: none;\n    }\n    \n        fieldset ol li {\n            padding-bottom: 5px;\n        }\n    \n    fieldset label {\n        display: block;\n        font-size: 1.2em;\n        font-weight: 600;\n    }\n    \n    fieldset label.checkbox {\n        display: inline;\n    }\n    \n    fieldset input[type=\"text\"], \n    fieldset input[type=\"password\"] {\n        border: 1px solid #e2e2e2;\n        color: #333;\n        font-size: 1.2em;\n        margin: 5px 0 6px 0;\n        padding: 5px;\n        width: 300px;\n    }\n    \n        fieldset input[type=\"text\"]:focus, \n        fieldset input[type=\"password\"]:focus {\n            border: 1px solid #7ac0da;\n        }\n    \n    fieldset input[type=\"submit\"] {\n        background-color: #d3dce0;\n        border: solid 1px #787878;\n        cursor: pointer;\n        font-size: 1.2em;\n        font-weight: 600;\n        padding: 7px;\n    }\n\n/* ajax login/registration dialog */\n.modal-popup {\n    font-size: 0.7em;\n}\n\n/* info and errors */  \n.message-info {\n    border: solid 1px;\n    clear: both;\n    padding: 10px 20px;\n}\n\n.message-error {\n    clear: both;\n    color: #e80c4d;\n    font-size: 1.1em;\n    font-weight: bold;\n    margin: 20px 0 10px 0;\n}\n\n.message-success {\n    color: #7ac0da;\n    font-size: 1.3em;\n    font-weight: bold;\n    margin: 20px 0 10px 0;\n}\n\n.success {\n    color: #7ac0da;\n}\n\n.error {\n    color: #e80c4d;\n}\n\n/* styles for validation helpers */\n.field-validation-error {\n    color: #e80c4d;\n    font-weight: bold;\n}\n\n.field-validation-valid {\n    display: none;\n}\n\ninput[type=\"text\"].input-validation-error,\ninput[type=\"password\"].input-validation-error {\n    border: solid 1px #e80c4d;\n}\n\n.validation-summary-errors {\n    color: #e80c4d;\n    font-weight: bold;\n    font-size: 1.1em;\n}\n\n.validation-summary-valid {\n    display: none;\n}\n\n\n/* social */\nul#social li {\n    display: inline;\n    list-style: none;\n}\n\n    ul#social li a {\n        color: #999;\n        text-decoration: none;\n    }\n        \n    a.facebook, a.twitter {\n        display: block;\n        float: left;\n        height: 24px;\n        padding-left: 17px;\n        text-indent: -9999px;\n        width: 16px;\n    }\n        \n    a.facebook {\n        background: url(\"../images/facebook.png\") no-repeat;\n    }\n        \n    a.twitter {\n        background: url(\"../images/twitter.png\") no-repeat;\n    }\n        \n        \n        \n/********************\n*   Mobile Styles   *\n********************/\n@media only screen and (max-width: 850px) {\n    \n    /* header  \n    ----------------------------------------------------------*/\n    header .float-left, \n    header .float-right {\n        float: none;\n    }\n    \n    /* logo */\n    header .site-title {\n        /*margin: 0; */\n        /*margin: 10px;*/\n        text-align: left;\n        padding-left: 0;\n    }\n\n    /* login */\n    #login {\n        font-size: .85em;\n        margin-top: 0;\n        text-align: center;\n    }\n    \n        #login ul {\n            margin: 5px 0;\n            padding: 0;\n        }\n        \n        #login li {\n            display: inline;\n            list-style: none;\n            margin: 0;\n            padding:0;\n        }\n\n        #login a {\n            background: none;\n            color: #999;\n            font-weight: 600;\n            margin: 2px;\n            padding: 0;\n        }\n        \n        #login a:hover {\n            color: #333;\n        }\n\n    /* menu */\n    nav {\n        margin-bottom: 5px;\n    }\n    \n    ul#menu {\n        margin: 0;\n        padding:0;\n        text-align: center;\n    }\n\n        ul#menu li {\n            margin: 0;\n            padding: 0;\n        }\n\n        \n    /* main layout  \n    ----------------------------------------------------------*/\n    .main-content,\n    .featured + .main-content {\n        background-position: 10px 0;\n    }\n    \n    .content-wrapper {\n        padding-right: 10px;\n        padding-left: 10px;\n    }\n\n    .featured .content-wrapper {\n        padding: 10px;\n    }\n    \n    /* page content */  \n    article, aside {\n        float: none;\n        width: 100%;\n    }\n    \n    /* ordered list */\n    ol.round {\n        list-style-type: none;\n        padding-left: 0;\n    }\n\n        ol.round li {\n            padding-left: 10px;\n            margin: 25px 0;\n        }\n    \n            ol.round li.one,\n            ol.round li.two,\n            ol.round li.three {\n                background: none;        \n            }\n     \n     /* features */\n     section.feature {\n        float: none;\n        padding: 10px;\n        width: auto;\n     }\n     \n        section.feature img {\n            color: #999;\n            content: attr(alt);\n            font-size: 1.5em;\n            font-weight: 600;\n        }\n        \n    /* forms */    \n    fieldset input[type=\"text\"], \n    fieldset input[type=\"password\"] {\n        width: 90%;\n    }\n    \n    /* login page */ \n    #loginForm {\n        border-right: none;\n        float: none;\n        width: auto;\n    }\n\n        #loginForm .validation-error {\n            display: block;\n            margin-left: 15px;\n        }\n\n    #socialLoginForm {\n        margin-left: 0;\n        float: none;\n        width: auto;\n    }\n\n    /* footer  \n    ----------------------------------------------------------*/    \n    footer .float-left,\n    footer .float-right {\n        float: none;\n    }\n    \n    footer {\n        text-align: center;\n        height: auto;\n        padding: 10px 0;\n    }\n    \n        footer p {\n            margin: 0;\n        }\n    \n        ul#social {\n            padding:0;\n            margin: 0;\n        }\n    \n         a.facebook, a.twitter {\n            background: none;\n            display: inline;\n            float: none;\n            height: auto;\n            padding-left: 0;\n            text-indent: 0;\n            width: auto;\n        }    \n}\n\n.subsite {\n\tcolor: #444;\n}\n\nh3 {\n\tfont-weight: normal;\n\tfont-size: 24px;\n\tcolor: #444;\n\tmargin-bottom: 20px;\n}\n\n.tiles {\n\tpadding-bottom: 20px;\n\tbackground-color: #e3e3e3;\n}\n\n#editor {\n\tmargin: 0 auto;\n\theight: 500px;\n\tborder: 1px solid #ccc;\n}\n\n.monaco-editor.monaco, .monaco-editor.vs, .monaco-editor.eclipse {\n\tbackground: #F9F9F9;\n}\n\n.monaco-editor.monaco .monaco-editor-background, .monaco-editor.vs .monaco-editor-background, .monaco-editor.eclipse .monaco-editor-background {\n\tbackground: #F9F9F9;\n}"},{"language": "dockerfile","value": "FROM mono:3.12\n\nENV KRE_FEED https://www.myget.org/F/aspnetvnext/api/v2\nENV KRE_USER_HOME /opt/kre\n\nRUN apt-get -qq update && apt-get -qqy install unzip \n\nONBUILD RUN curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/kvminstall.sh | sh\nONBUILD RUN bash -c \"source $KRE_USER_HOME/kvm/kvm.sh \\\n    && kvm install latest -a default \\\n    && kvm alias default | xargs -i ln -s $KRE_USER_HOME/packages/{} $KRE_USER_HOME/packages/default\"\n\n# Install libuv for Kestrel from source code (binary is not in wheezy and one in jessie is still too old)\nRUN apt-get -qqy install \\\n    autoconf \\\n    automake \\\n    build-essential \\\n    libtool \nRUN LIBUV_VERSION=1.0.0-rc2 \\\n    && curl -sSL https://github.com/joyent/libuv/archive/v${LIBUV_VERSION}.tar.gz | tar zxfv - -C /usr/local/src \\\n    && cd /usr/local/src/libuv-$LIBUV_VERSION \\\n    && sh autogen.sh && ./configure && make && make install \\\n    && rm -rf /usr/local/src/libuv-$LIBUV_VERSION \\\n    && ldconfig\n\nENV PATH $PATH:$KRE_USER_HOME/packages/default/bin\n\n# Extra things to test\nRUN echo \"string at end\"\nRUN echo must work 'some str' and some more\nRUN echo hi this is # not a comment\nRUN echo 'String with ${VAR} and another $one here'"},{"language": "fsharp","value": "(* Sample F# application *)\n[<EntryPoint>]\nlet main argv = \n    printfn \"%A\" argv\n    System.Console.WriteLine(\"Hello from F#\")\n    0 // return an integer exit code\n\n//-------------------------------------------------------- "},{"language": "go","value": "// We often need our programs to perform operations on\n// collections of data, like selecting all items that\n// satisfy a given predicate or mapping all items to a new\n// collection with a custom function.\n\n// In some languages it's idiomatic to use [generic](http://en.wikipedia.org/wiki/Generic_programming)\n// data structures and algorithms. Go does not support\n// generics; in Go it's common to provide collection\n// functions if and when they are specifically needed for\n// your program and data types.\n\n// Here are some example collection functions for slices\n// of `strings`. You can use these examples to build your\n// own functions. Note that in some cases it may be\n// clearest to just inline the collection-manipulating\n// code directly, instead of creating and calling a\n// helper function.\n\npackage main\n\nimport \"strings\"\nimport \"fmt\"\n\n// Returns the first index of the target string `t`, or\n// -1 if no match is found.\nfunc Index(vs []string, t string) int {\n    for i, v := range vs {\n        if v == t {\n            return i\n        }\n    }\n    return -1\n}\n\n// Returns `true` if the target string t is in the\n// slice.\nfunc Include(vs []string, t string) bool {\n    return Index(vs, t) >= 0\n}\n\n// Returns `true` if one of the strings in the slice\n// satisfies the predicate `f`.\nfunc Any(vs []string, f func(string) bool) bool {\n    for _, v := range vs {\n        if f(v) {\n            return true\n        }\n    }\n    return false\n}\n\n// Returns `true` if all of the strings in the slice\n// satisfy the predicate `f`.\nfunc All(vs []string, f func(string) bool) bool {\n    for _, v := range vs {\n        if !f(v) {\n            return false\n        }\n    }\n    return true\n}\n\n// Returns a new slice containing all strings in the\n// slice that satisfy the predicate `f`.\nfunc Filter(vs []string, f func(string) bool) []string {\n    vsf := make([]string, 0)\n    for _, v := range vs {\n        if f(v) {\n            vsf = append(vsf, v)\n        }\n    }\n    return vsf\n}\n\n// Returns a new slice containing the results of applying\n// the function `f` to each string in the original slice.\nfunc Map(vs []string, f func(string) string) []string {\n    vsm := make([]string, len(vs))\n    for i, v := range vs {\n        vsm[i] = f(v)\n    }"},{"language": "handlebars","value": "<div class=\"entry\">\n\t<h1>{{title}}</h1>\n\t{{#if author}}\n\t<h2>{{author.firstName}} {{author.lastName}}</h2>\n\t{{else}}\n\t<h2>Unknown Author</h2>\n\t{{/if}}\n\t{{contentBody}}\n</div>\n\n{{#unless license}}\n  <h3 class=\"warning\">WARNING: This entry does not have a license!</h3>\n{{/unless}}\n\n<div class=\"footnotes\">\n\t<ul>\n\t\t{{#each footnotes}}\n\t\t<li>{{this}}</li>\n\t\t{{/each}}\n\t</ul>\n</div>\n\n<h1>Comments</h1>\n\n<div id=\"comments\">\n\t{{#each comments}}\n\t<h2><a href=\"/posts/{{../permalink}}#{{id}}\">{{title}}</a></h2>\n\t<div>{{body}}</div>\n\t{{/each}}\n</div>\n"},{"language": "html","value": "<!DOCTYPE HTML>\n<!-- \n\tComments are overrated\n-->\n<html>\n<head>\n\t<title>HTML Sample</title>\n\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n\t<style type=\"text/css\">\n\t\th1 {\n\t\t\tcolor: #CCA3A3;\n\t\t}\n\t</style>\n\t<script type=\"text/javascript\">\n\t\twindow.alert(\"I am a sample...\");\n\t</script>\n</head>\n<body>\n\t<h1>Heading No.1</h1>\n\t<input disabled type=\"button\" value=\"Click me\" />\n</body>\n</html>"},{"language": "ini","value": "# Example of a .gitconfig file\n\n[core]\n\trepositoryformatversion = 0\n\tfilemode = false\n\tbare = false\n\tlogallrefupdates = true\n\tsymlinks = false\n\tignorecase = true\n\thideDotFiles = dotGitOnly\n\n# Defines the master branch\n[branch \"master\"]\n\tremote = origin\n\tmerge = refs/heads/master\n"},{"language": "java","value": "import java.util.ArrayList;\nimport org.junit.Test;\n\npublic class Example {\n    @Test \n    public void method() {\n       org.junit.Assert.assertTrue( \"isEmpty\", new ArrayList<Integer>().isEmpty());\n    }\n\t\n   @Test(timeout=100) public void infinity() {\n       while(true);\n    }\n }\n "},{"language": "javascript","value": "/*\n  © Microsoft. All rights reserved.\n\n  This library is supported for use in Windows Tailored Apps only.\n\n  Build: 6.2.8100.0 \n  Version: 0.5 \n*/\n\n(function (global, undefined) {\n\t\"use strict\";\n\tundefinedVariable = {};\n\tundefinedVariable.prop = 5;\n\n\tfunction initializeProperties(target, members) {\n\t\tvar keys = Object.keys(members);\n\t\tvar properties;\n\t\tvar i, len;\n\t\tfor (i = 0, len = keys.length; i < len; i++) {\n\t\t\tvar key = keys[i];\n\t\t\tvar enumerable = key.charCodeAt(0) !== /*_*/95;\n\t\t\tvar member = members[key];\n\t\t\tif (member && typeof member === 'object') {\n\t\t\t\tif (member.value !== undefined || typeof member.get === 'function' || typeof member.set === 'function') {\n\t\t\t\t\tif (member.enumerable === undefined) {\n\t\t\t\t\t\tmember.enumerable = enumerable;\n\t\t\t\t\t}\n\t\t\t\t\tproperties = properties || {};\n\t\t\t\t\tproperties[key] = member;\n\t\t\t\t\tcontinue;\n\t\t\t\t} \n\t\t\t}\n\t\t\tif (!enumerable) {\n\t\t\t\tproperties = properties || {};\n\t\t\t\tproperties[key] = { value: member, enumerable: enumerable, configurable: true, writable: true }\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttarget[key] = member;\n\t\t}\n\t\tif (properties) {\n\t\t\tObject.defineProperties(target, properties);\n\t\t}\n\t}\n\n\t(function (rootNamespace) {\n\n\t\t// Create the rootNamespace in the global namespace\n\t\tif (!global[rootNamespace]) {\n\t\t\tglobal[rootNamespace] = Object.create(Object.prototype);\n\t\t}\n\n\t\t// Cache the rootNamespace we just created in a local variable\n\t\tvar _rootNamespace = global[rootNamespace];\n\t\tif (!_rootNamespace.Namespace) {\n\t\t\t_rootNamespace.Namespace = Object.create(Object.prototype);\n\t\t}\n\n\t\tfunction defineWithParent(parentNamespace, name, members) {\n\t\t\t/// <summary locid=\"1\">\n\t\t\t/// Defines a new namespace with the specified name, under the specified parent namespace.\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"parentNamespace\" type=\"Object\" locid=\"2\">\n\t\t\t/// The parent namespace which will contain the new namespace.\n\t\t\t/// </param>\n\t\t\t/// <param name=\"name\" type=\"String\" locid=\"3\">\n\t\t\t/// Name of the new namespace.\n\t\t\t/// </param>\n\t\t\t/// <param name=\"members\" type=\"Object\" locid=\"4\">\n\t\t\t/// Members in the new namespace.\n\t\t\t/// </param>\n\t\t\t/// <returns locid=\"5\">\n\t\t\t/// The newly defined namespace.\n\t\t\t/// </returns>\n\t\t\tvar currentNamespace = parentNamespace,\n\t\t\t\tnamespaceFragments = name.split(\".\");\n\n\t\t\tfor (var i = 0, len = namespaceFragments.length; i < len; i++) {\n\t\t\t\tvar namespaceName = namespaceFragments[i];\n\t\t\t\tif (!currentNamespace[namespaceName]) {\n\t\t\t\t\tObject.defineProperty(currentNamespace, namespaceName, \n\t\t\t\t\t\t{ value: {}, writable: false, enumerable: true, configurable: true }\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tcurrentNamespace = currentNamespace[namespaceName];\n\t\t\t}\n\n\t\t\tif (members) {\n\t\t\t\tinitializeProperties(currentNamespace, members);\n\t\t\t}\n\n\t\t\treturn currentNamespace;\n\t\t}\n\n\t\tfunction define(name, members) {\n\t\t\t/// <summary locid=\"6\">\n\t\t\t/// Defines a new namespace with the specified name.\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"name\" type=\"String\" locid=\"7\">\n\t\t\t/// Name of the namespace.  This could be a dot-separated nested name.\n\t\t\t/// </param>\n\t\t\t/// <param name=\"members\" type=\"Object\" locid=\"4\">\n\t\t\t/// Members in the new namespace.\n\t\t\t/// </param>\n\t\t\t/// <returns locid=\"5\">\n\t\t\t/// The newly defined namespace.\n\t\t\t/// </returns>\n\t\t\treturn defineWithParent(global, name, members);\n\t\t}\n\n\t\t// Establish members of the \"WinJS.Namespace\" namespace\n\t\tObject.defineProperties(_rootNamespace.Namespace, {\n\n\t\t\tdefineWithParent: { value: defineWithParent, writable: true, enumerable: true },\n\n\t\t\tdefine: { value: define, writable: true, enumerable: true }\n\n\t\t});\n\n\t})(\"WinJS\");\n\n\t(function (WinJS) {\n\n\t\tfunction define(constructor, instanceMembers, staticMembers) {\n\t\t\t/// <summary locid=\"8\">\n\t\t\t/// Defines a class using the given constructor and with the specified instance members.\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"constructor\" type=\"Function\" locid=\"9\">\n\t\t\t/// A constructor function that will be used to instantiate this class.\n\t\t\t/// </param>\n\t\t\t/// <param name=\"instanceMembers\" type=\"Object\" locid=\"10\">\n\t\t\t/// The set of instance fields, properties and methods to be made available on the class.\n\t\t\t/// </param>\n\t\t\t/// <param name=\"staticMembers\" type=\"Object\" locid=\"11\">\n\t\t\t/// The set of static fields, properties and methods to be made available on the class.\n\t\t\t/// </param>\n\t\t\t/// <returns type=\"Function\" locid=\"12\">\n\t\t\t/// The newly defined class.\n\t\t\t/// </returns>\n\t\t\tconstructor = constructor || function () { };\n\t\t\tif (instanceMembers) {\n\t\t\t\tinitializeProperties(constructor.prototype, instanceMembers);\n\t\t\t}\n\t\t\tif (staticMembers) {\n\t\t\t\tinitializeProperties(constructor, staticMembers);\n\t\t\t}\n\t\t\treturn constructor;\n\t\t}\n\n\t\tfunction derive(baseClass, constructor, instanceMembers, staticMembers) {\n\t\t\t/// <summary locid=\"13\">\n\t\t\t/// Uses prototypal inheritance to create a sub-class based on the supplied baseClass parameter.\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"baseClass\" type=\"Function\" locid=\"14\">\n\t\t\t/// The class to inherit from.\n\t\t\t/// </param>\n\t\t\t/// <param name=\"constructor\" type=\"Function\" locid=\"9\">\n\t\t\t/// A constructor function that will be used to instantiate this class.\n\t\t\t/// </param>\n\t\t\t/// <param name=\"instanceMembers\" type=\"Object\" locid=\"10\">\n\t\t\t/// The set of instance fields, properties and methods to be made available on the class.\n\t\t\t/// </param>\n\t\t\t/// <param name=\"staticMembers\" type=\"Object\" locid=\"11\">\n\t\t\t/// The set of static fields, properties and methods to be made available on the class.\n\t\t\t/// </param>\n\t\t\t/// <returns type=\"Function\" locid=\"12\">\n\t\t\t/// The newly defined class.\n\t\t\t/// </returns>\n\t\t\tif (baseClass) {\n\t\t\t\tconstructor = constructor || function () { };\n\t\t\t\tvar basePrototype = baseClass.prototype;\n\t\t\t\tconstructor.prototype = Object.create(basePrototype);\n\t\t\t\tObject.defineProperty(constructor.prototype, \"_super\", { value: basePrototype });\n\t\t\t\tObject.defineProperty(constructor.prototype, \"constructor\", { value: constructor });\n\t\t\t\tif (instanceMembers) {\n\t\t\t\t\tinitializeProperties(constructor.prototype, instanceMembers);\n\t\t\t\t}\n\t\t\t\tif (staticMembers) {\n\t\t\t\t\tinitializeProperties(constructor, staticMembers);\n\t\t\t\t}\n\t\t\t\treturn constructor;\n\t\t\t} else {\n\t\t\t\treturn define(constructor, instanceMembers, staticMembers);\n\t\t\t}\n\t\t}\n\n\t\tfunction mix(constructor) {\n\t\t\t/// <summary locid=\"15\">\n\t\t\t/// Defines a class using the given constructor and the union of the set of instance members\n\t\t\t/// specified by all the mixin objects.  The mixin parameter list can be of variable length.\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"constructor\" locid=\"9\">\n\t\t\t/// A constructor function that will be used to instantiate this class.\n\t\t\t/// </param>\n\t\t\t/// <returns locid=\"12\">\n\t\t\t/// The newly defined class.\n\t\t\t/// </returns>\n\t\t\tconstructor = constructor || function () { };\n\t\t\tvar i, len;\n\t\t\tfor (i = 0, len = arguments.length; i < len; i++) {\n\t\t\t\tinitializeProperties(constructor.prototype, arguments[i]);\n\t\t\t}\n\t\t\treturn constructor;\n\t\t}\n\n\t\t// Establish members of \"WinJS.Class\" namespace\n\t\tWinJS.Namespace.define(\"WinJS.Class\", {\n\t\t\tdefine: define,\n\t\t\tderive: derive,\n\t\t\tmix: mix\n\t\t});\n\n\t})(WinJS);\n\n})(this);"},{"language": "json","value": "{\n\t\"type\": \"team\",\n\t\"test\": {\n\t\t\"testPage\": \"tools/testing/run-tests.htm\",\n\t\t\"enabled\": true\n\t},\n    \"search\": {\n        \"excludeFolders\": [\n\t\t\t\".git\",\n\t\t\t\"node_modules\",\n\t\t\t\"tools/bin\",\n\t\t\t\"tools/counts\",\n\t\t\t\"tools/policheck\",\n\t\t\t\"tools/tfs_build_extensions\",\n\t\t\t\"tools/testing/jscoverage\",\n\t\t\t\"tools/testing/qunit\",\n\t\t\t\"tools/testing/chutzpah\",\n\t\t\t\"server.net\"\n        ]\n    },\n\t\"languages\": {\n\t\t\"vs.languages.typescript\": {\n\t\t\t\"validationSettings\": [{\n\t\t\t\t\"scope\":\"/\",\n\t\t\t\t\"noImplicitAny\":true,\n\t\t\t\t\"noLib\":false,\n\t\t\t\t\"extraLibs\":[],\n\t\t\t\t\"semanticValidation\":true,\n\t\t\t\t\"syntaxValidation\":true,\n\t\t\t\t\"codeGenTarget\":\"ES5\",\n\t\t\t\t\"moduleGenTarget\":\"\",\n\t\t\t\t\"lint\": {\n                    \"emptyBlocksWithoutComment\": \"warning\",\n                    \"curlyBracketsMustNotBeOmitted\": \"warning\",\n                    \"comparisonOperatorsNotStrict\": \"warning\",\n                    \"missingSemicolon\": \"warning\",\n                    \"unknownTypeOfResults\": \"warning\",\n                    \"semicolonsInsteadOfBlocks\": \"warning\",\n                    \"functionsInsideLoops\": \"warning\",\n                    \"functionsWithoutReturnType\": \"warning\",\n                    \"tripleSlashReferenceAlike\": \"warning\",\n                    \"unusedImports\": \"warning\",\n                    \"unusedVariables\": \"warning\",\n                    \"unusedFunctions\": \"warning\",\n                    \"unusedMembers\": \"warning\"\n                }\n\t\t\t}, \n\t\t\t{\n\t\t\t\t\"scope\":\"/client\",\n\t\t\t\t\"baseUrl\":\"/client\",\n\t\t\t\t\"moduleGenTarget\":\"amd\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"scope\":\"/server\",\n\t\t\t\t\"moduleGenTarget\":\"commonjs\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"scope\":\"/build\",\n\t\t\t\t\"moduleGenTarget\":\"commonjs\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"scope\":\"/node_modules/nake\",\n\t\t\t\t\"moduleGenTarget\":\"commonjs\"\n\t\t\t}],\n\t\t\t\"allowMultipleWorkers\": true\n\t\t}\n\t}\n}"},{"language": "less","value": "@base: #f938ab;\n\n.box-shadow(@style, @c) when (iscolor(@c)) {\n\tborder-radius: @style @c;\n}\n\n.box-shadow(@style, @alpha: 50%) when (isnumber(@alpha)) {\n\t.box-shadow(@style, rgba(0, 0, 0, @alpha));\n}\n\n.box { \n\tcolor: saturate(@base, 5%);\n\tborder-color: lighten(@base, 30%);\n\t\n\tdiv {\n\t\t.box-shadow((0 0 5px), 30%);\n\t}\n}\n\n#header {\n\th1 {\n\t\tfont-size: 26px;\n\t\tfont-weight: bold;\n\t}\n\t\n\tp { font-size: 12px;\n\t\ta { text-decoration: none;\n\t\t\t&:hover { border-width: 1px }\n\t\t}\n\t}\n}\n\n@the-border: 1px;\n@base-color: #111;\n@red:        #842210;\n\n#header {\n\tcolor: (@base-color * 3);\n\tborder-left: @the-border;\n\tborder-right: (@the-border * 2);\n}\n\n#footer {\n\tcolor: (@base-color + #003300);\n\tborder-color: desaturate(@red, 10%);\n}\n"},{"language": "lua","value": "    -- defines a factorial function\n    function fact (n)\n      if n == 0 then\n        return 1\n      else\n        return n * fact(n-1)\n      end\n    end\n    \n    print(\"enter a number:\")\n    a = io.read(\"*number\")        -- read a number\n    print(fact(a))"},{"language": "markdown","value": "# Header 1 #\n## Header 2 ##\n### Header 3 ###             (Hashes on right are optional)\n## Markdown plus h2 with a custom ID ##   {#id-goes-here}\n[Link back to H2](#id-goes-here)\n\n<!-- html madness -->\n<div class=\"custom-class\" markdown=\"1\">\n  <div>\n    nested div\n  </div>\n  <script type='text/x-koka'>\n    function( x: int ) { return x*x; }\n  </script>\n  This is a div _with_ underscores\n  and a & <b class=\"bold\">bold</b> element.\n  <style>\n    body { font: \"Consolas\" }\n  </style>\n</div>\n\n* Bullet lists are easy too\n- Another one\n+ Another one\n\nThis is a paragraph, which is text surrounded by \nwhitespace. Paragraphs can be on one \nline (or many), and can drone on for hours.  \n\nNow some inline markup like _italics_,  **bold**, \nand `code()`. Note that underscores \nin_words_are ignored.\n\n````application/json\n  { value: [\"or with a mime type\"] }\n````\n\n> Blockquotes are like quoted text in email replies\n>> And, they can be nested\n\n1. A numbered list\n2. Which is numbered\n3. With periods and a space\n\nAnd now some code:\n\n    // Code is just text indented a bit\n    which(is_easy) to_remember();\n\nAnd a block\n\n~~~\n// Markdown extra adds un-indented code blocks too\n\nif (this_is_more_code == true && !indented) {\n    // tild wrapped code blocks, also not indented\n}\n~~~\n\nText with  \ntwo trailing spaces  \n(on the right)  \ncan be used  \nfor things like poems  \n\n### Horizontal rules\n\n* * * *\n****\n--------------------------\n\n![picture alt](/images/photo.jpeg \"Title is optional\")     \n\n## Markdown plus tables ##\n\n| Header | Header | Right  |\n| ------ | ------ | -----: |\n|  Cell  |  Cell  |   $10  |\n|  Cell  |  Cell  |   $20  |\n\n* Outer pipes on tables are optional\n* Colon used for alignment (right versus left)\n\n## Markdown plus definition lists ##\n\nBottled water\n: $ 1.25\n: $ 1.55 (Large)\n\nMilk\nPop\n: $ 1.75\n\n* Multiple definitions and terms are possible\n* Definitions can include multiple paragraphs too\n\n*[ABBR]: Markdown plus abbreviations (produces an <abbr> tag)"},{"language": "msdax","value": " = CALCULATE(SUM(Sales[SalesAmount]), PREVIOUSQUARTER(Calendar[DateKey]))"},{"language": "mysql","value": "CREATE TABLE shop (\n    article INT(4) UNSIGNED ZEROFILL DEFAULT '0000' NOT NULL,\n    dealer  CHAR(20)                 DEFAULT ''     NOT NULL,\n    price   DOUBLE(16,2)             DEFAULT '0.00' NOT NULL,\n    PRIMARY KEY(article, dealer));\nINSERT INTO shop VALUES\n    (1,'A',3.45),(1,'B',3.99),(2,'A',10.99),(3,'B',1.45),\n    (3,'C',1.69),(3,'D',1.25),(4,'D',19.95);"},{"language": "objective","value": "//\n//  Copyright (c) Microsoft Corporation. All rights reserved.\n//\n\n#import \"UseQuotes.h\"\n#import <Use/GTLT.h> \n\n/*\n\tMulti \n\tLine\n\tComments \n*/\n@implementation Test\n\n- (void) applicationWillFinishLaunching:(NSNotification *)notification\n{\n}\n\n- (IBAction)onSelectInput:(id)sender\n{\n    NSString* defaultDir = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true)[0];\n    \n    NSOpenPanel* panel = [NSOpenPanel openPanel];\n    [panel setAllowedFileTypes:[[NSArray alloc] initWithObjects:@\"ipa\", @\"xcarchive\", @\"app\", nil]];\n    \n    [panel beginWithCompletionHandler:^(NSInteger result)\n     {\n         if (result == NSFileHandlingPanelOKButton)\n             [self.inputTextField setStringValue:[panel.URL path]];\n     }];\n     return YES;\n\n     int hex = 0xFEF1F0F;\n\t float ing = 3.14;\n\t ing = 3.14e0;\n\t ing = 31.4e-2;\n}\n\n-(id) initWithParams:(id<anObject>) aHandler withDeviceStateManager:(id<anotherObject>) deviceStateManager\n{\n    // add a tap gesture recognizer\n    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];\n    NSMutableArray *gestureRecognizers = [NSMutableArray array];\n    [gestureRecognizers addObject:tapGesture];\n    [gestureRecognizers addObjectsFromArray:scnView.gestureRecognizers];\n    scnView.gestureRecognizers = gestureRecognizers;\n\n\treturn tapGesture;\n\treturn nil;\n}\n\n@end\n"},{"language": "perl","value": "#!/usr/bin/perl\nuse strict;\nuse warnings;\n\nuse Path::Tiny;\n\nmy $dir = path('foo','bar'); # foo/bar\n\n# Iterate over the content of foo/bar\nmy $iter = $dir->iterator;\nwhile (my $file = $iter->()) {\n\n    # See if it is a directory and skip\n    next if $file->is_dir();\n\n    # Print out the file name and path\n    print \"$file\\n\";\n}"},{"language": "pgsql","value": "BEGIN\n    SELECT * INTO STRICT myrec FROM emp WHERE empname = myname;\n    EXCEPTION\n        WHEN NO_DATA_FOUND THEN\n            RAISE EXCEPTION 'employee % not found', myname;\n        WHEN TOO_MANY_ROWS THEN\n            RAISE EXCEPTION 'employee % not unique', myname;\nEND;"},{"language": "php","value": "<?php\n// The next line contains a syntax error:\nif () {\n\treturn \"The parser recovers from this type of syntax error\";\n}\n?>\n<html>\n<head>\n\t<title>Example page</title>\n</head>\n\n<body>\n\n<script type=\"text/javascript\">\n\t// Some PHP embedded inside JS\n\t// Generated <?=date('l, F jS, Y')?>\n\t\n\tvar server_token = <?=rand(5, 10000)?>\n\tif (typeof server_token === 'number') {\n\t\talert('token: ' + server_token);\n\t}\n</script>\n\n<div>\nHello\n<? if (isset($user)) { ?>\n\t<b><?=$user?></b>\n<? } else { ?>\n\t<i>guest</i>\n<? } ?>\n!\n</div>\n\n<?php\n\n\t/* Example PHP file\n\tmultiline comment\n\t*/\n\n\t$cards = array(\"ah\", \"ac\", \"ad\", \"as\",\n\t\t\"2h\", \"2c\", \"2d\", \"2s\",\n\t\t\"3h\", \"3c\", \"3d\", \"3s\",\n\t\t\"4h\", \"4c\", \"4d\", \"4s\",\n\t\t\"5h\", \"5c\", \"5d\", \"5s\",\n\t\t\"6h\", \"6c\", \"6d\", \"6s\",\n\t\t\"7h\", \"7c\", \"7d\", \"7s\",\n\t\t\"8h\", \"8c\", \"8d\", \"8s\",\n\t\t\"9h\", \"9c\", \"9d\", \"9s\",\n\t\t\"th\", \"tc\", \"td\", \"ts\",\n\t\t\"jh\", \"jc\", \"jd\", \"js\",\n\t\t\"qh\", \"qc\", \"qd\", \"qs\",\n\t\t\"kh\", \"kc\", \"kd\", \"ks\");\n\n\tsrand(time());\n\n\tfor($i = 0; $i < 52; $i++) {\n\t\t$count = count($cards);\n\t\t$random = (rand()%$count);\n\n\t\tif($cards[$random] == \"\") {\n\t\t\t$i--;\n\t\t} else {\n\t\t\t$deck[] = $cards[$random];\n\t\t\t$cards[$random] = \"\";\n\t\t}\n\t}\n\n\tsrand(time());\n\t$starting_point = (rand()%51);\n\tprint(\"Starting point for cut cards is: $starting_point<p>\");\n\n\t// display shuffled cards (EXAMPLE ONLY)\n\tfor ($index = 0; $index < 52; $index++) {\n\t\tif ($starting_point == 52) { $starting_point = 0; }\n\t\tprint(\"Uncut Point: <strong>$deck[$index]</strong> \");\n\t\tprint(\"Starting Point: <strong>$deck[$starting_point]</strong><br>\");\n\t\t$starting_point++;\n\t}\n?>\n\n</body>\n</html>"},{"language": "postiats","value": "// http://www.ats-lang.org/\n(* Say Hello! once *)\nval () = print\"Hello!\\n\"\n//\n(* Say Hello! 3 times *)\nval () = 3*delay(print\"Hello!\")\nval () = print_newline((*void*))\n//\n\n//\n(* Build a list of 3 *)\nval xs = $list{int}(0, 1, 2)\n//\nval x0 = xs[0] // legal\nval x1 = xs[1] // legal\nval x2 = xs[2] // legal\nval x3 = xs[3] // illegal\n//\n\n//\nextern\nfun{} f0 (): int\nextern\nfun{} f1 (int): int\nextern\nfun{} repeat_f0f1 (int): int\n//\nimplement\n{}(*tmp*)\nrepeat_f0f1(n) =\n  if n = 0\n    then f0()\n    else f1(repeat_f0f1(n-1))\n  // end of [if]\n//\nfun\ntimes (\n  m:int, n:int\n) : int = // m*n\n  repeat_f0f1 (m) where\n{\n  implement f0<> () = 0\n  implement f1<> (x) = x + n\n}\n//\nfun\npower (\n  m:int, n:int\n) : int = // m^n\n  repeat_f0f1 (n) where\n{\n  implement f0<> () = 1\n  implement f1<> (x) = m * x\n}\n//\nval () =\nprintln! (\"5*5 = \", times(5,5))\nval () =\nprintln! (\"5^2 = \", power(5,2))\nval () =\nprintln! (\"2^10 = \", power(2,10))\nval () =\nprintln! (\"3^10 = \", power(3,10))\n//\n"},{"language": "powerquery","value": "let\n    Source = Excel.CurrentWorkbook(){[Name=\"Table1\"]}[Content],\n    SplitColumnDelimiter = Table.SplitColumn(Source,\"Input\",Splitter.SplitTextByDelimiter(\",\"),13),\n    Unpivot = Table.Unpivot(SplitColumnDelimiter,{\"Input.1\", \"Input.2\", \"Input.3\", \"Input.4\",\n    \"Input.5\", \"Input.6\",    \"Input.7\", \"Input.8\", \"Input.9\", \"Input.10\", \"Input.11\", \"Input.12\"\n    ,  \"Input.13\"},\"Attribute\",\"Value\"),\n    RemovedColumns = Table.RemoveColumns(Unpivot,{\"Attribute\"}),\n    DuplicatesRemoved = Table.Distinct(RemovedColumns),\n    GroupedRows = Table.Group(DuplicatesRemoved, {\"RowID\"}, {{\"Count of Distinct Values\"\n    , each Table.RowCount(_), type number}})\nin\n    GroupedRows"},{"language": "powershell","value": "$SelectedObjectNames=@();\n$XenCenterNodeSelected = 0;\n#the object info array contains hashmaps, each of which represent a parameter set and describe a target in the XenCenter resource list\nforeach($parameterSet in $ObjInfoArray)\n{\n\tif ($parameterSet[\"class\"] -eq \"blank\")\n\t{\n\t\t#When the XenCenter node is selected a parameter set is created for each of your connected servers with the class and objUuid keys marked as blank\n\t\tif ($XenCenterNodeSelected)\n\t\t{\n\t\t\tcontinue\n\t\t}\n\t\t$XenCenterNodeSelected = 1;\n\t\t$SelectedObjectNames += \"XenCenter\"\n\t}\n\telseif ($parameterSet[\"sessionRef\"] -eq \"null\")\n\t{\n\t\t#When a disconnected server is selected there is no session information, we get null for everything except class\n\t}\n\t\t$SelectedObjectNames += \"a disconnected server\"\n\telse\n\t{\n\t\tConnect-XenServer -url $parameterSet[\"url\"] -opaqueref $parameterSet[\"sessionRef\"]\n\t\t#Use $class to determine which server objects to get\n\t\t#-properties allows us to filter the results to just include the selected object\n\t\t$exp = \"Get-XenServer:{0} -properties @{{uuid='{1}'}}\" -f $parameterSet[\"class\"], $parameterSet[\"objUuid\"]\n\t\t$obj = Invoke-Expression $exp\n\t\t$SelectedObjectNames += $obj.name_label;\n\t} \n}"},{"language": "pug","value": "doctype 5\nhtml(lang=\"en\")\n    head\n        title= pageTitle\n        script(type='text/javascript')\n            if (foo) {\n                bar()\n            }\n    body\n        // Disclaimer: You will need to turn insertSpaces to true in order for the\n            syntax highlighting to kick in properly (especially for comments)\n            Enjoy :)\n        h1 Pug - node template engine\n        #container\n            if youAreUsingPug\n                p You are amazing\n            else\n                p Get on it!"},{"language": "python","value": "import banana\n\n\nclass Monkey:\n    # Bananas the monkey can eat.\n    capacity = 10\n    def eat(self, n):\n        \"\"\"Make the monkey eat n bananas!\"\"\"\n        self.capacity -= n * banana.size\n\n    def feeding_frenzy(self):\n        self.eat(9.25)\n        return (\"Yum yum\")"},{"language": "r","value": "# © Microsoft. All rights reserved.\n\n#' Add together two numbers.\n#' \n#' @param x A number.\n#' @param y A number.\n#' @return The sum of \\code{x} and \\code{y}.\n#' @examples\n#' add(1, 1)\n#' add(10, 1)\nadd <- function(x, y) {\n  x + y\n}\n\nadd(1, 2)\nadd(1.0, 2.0)\nadd(-1, -2)\nadd(-1.0, -2.0)\nadd(1.0e10, 2.0e10)\n\n\n#' Concatenate together two strings.\n#' \n#' @param x A string.\n#' @param y A string.\n#' @return The concatenated string built of \\code{x} and \\code{y}.\n#' @examples\n#' strcat(\"one\", \"two\")\nstrcat <- function(x, y) {\n  paste(x, y)\n}\n\npaste(\"one\", \"two\")\npaste('one', 'two')\npaste(NULL, NULL)\npaste(NA, NA)\n\npaste(\"multi-\n      line\",\n      'multi-\n      line')\n"},{"language": "razor","value": "@{\n    var total = 0;\n    var totalMessage = \"\";\n    @* a multiline\n      razor comment embedded in csharp *@\n    if (IsPost) {\n\n        // Retrieve the numbers that the user entered.\n        var num1 = Request[\"text1\"];\n        var num2 = Request[\"text2\"];\n\n        // Convert the entered strings into integers numbers and add.\n        total = num1.AsInt() + num2.AsInt();\n\t\t<italic><bold>totalMessage = \"Total = \" + total;</bold></italic>\n    }\n}\n\n<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Add Numbers</title>\n    <meta charset=\"utf-8\" />\n  </head>\n<body>\n  <p>Enter two whole numbers and then click <strong>Add</strong>.</p>\n  <form action=\"\" method=\"post\">\n    <p><label for=\"text1\">First Number:</label>\n      <input type=\"text\" name=\"text1\" />\n    </p>\n    <p><label for=\"text2\">Second Number:</label>\n      <input type=\"text\" name=\"text2\" />\n    </p>\n    <p><input type=\"submit\" value=\"Add\" /></p>\n  </form>\n\n\t@* now we call the totalMessage method \n\t   (a multi line razor comment outside code) *@\n\n  <p>@totalMessage</p>\n  \n  <p>@(totalMessage+\"!\")</p>\n  \n  An email address (with escaped at character): name@@domain.com\n \n</body>\n</html>\n"},{"language": "redis","value": "EXISTS mykey\nAPPEND mykey \"Hello\"\nAPPEND mykey \" World\"\nGET mykey"},{"language": "redshift","value": "create view tables_vw as\nselect distinct(id) table_id\n,trim(datname)   db_name\n,trim(nspname)   schema_name\n,trim(relname)   table_name\nfrom stv_tbl_perm\njoin pg_class on pg_class.oid = stv_tbl_perm.id\njoin pg_namespace on pg_namespace.oid = relnamespace\njoin pg_database on pg_database.oid = stv_tbl_perm.db_id;\n"},{"language": "ruby","value": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft. All rights reserved.\n#--------------------------------------------------------------------------\n\nmodule Azure\n  module Blob\n    class Blob\n      \n      def initialize\n        @properties = {}\n        @metadata = {}\n        yield self if block_given?\n      end\n\n      attr_accessor :name\n      attr_accessor :snapshot\n      attr_accessor :properties\n      attr_accessor :metadata\n    end\n  end\nend"},{"language": "rust","value": "fn main() {\n    let greetings = [\"Hello\", \"Hola\", \"Bonjour\",\n                     \"Ciao\", \"こんにちは\", \"안녕하세요\",\n                     \"Cześć\", \"Olá\", \"Здравствуйте\",\n                     \"Chào bạn\", \"您好\", \"Hallo\",\n                     \"Hej\", \"Ahoj\", \"سلام\"];\n\n    for (num, greeting) in greetings.iter().enumerate() {\n        print!(\"{} : \", greeting);\n        match num {\n            0 =>  println!(\"This code is editable and runnable!\"),\n            1 =>  println!(\"¡Este código es editable y ejecutable!\"),\n            2 =>  println!(\"Ce code est modifiable et exécutable !\"),\n            3 =>  println!(\"Questo codice è modificabile ed eseguibile!\"),\n            4 =>  println!(\"このコードは編集して実行出来ます!\"),\n            5 =>  println!(\"여기에서 코드를 수정하고 실행할 수 있습니다!\"),\n            6 =>  println!(\"Ten kod można edytować oraz uruchomić!\"),\n            7 =>  println!(\"Este código é editável e executável!\"),\n            8 =>  println!(\"Этот код можно отредактировать и запустить!\"),\n            9 =>  println!(\"Bạn có thể edit và run code trực tiếp!\"),\n            10 => println!(\"这段代码是可以编辑并且能够运行的!\"),\n            11 => println!(\"Dieser Code kann bearbeitet und ausgeführt werden!\"),\n            12 => println!(\"Den här koden kan redigeras och köras!\"),\n            13 => println!(\"Tento kód můžete upravit a spustit\"),\n            14 => println!(\"این کد قابلیت ویرایش و اجرا دارد!\"),\n            _ =>  {},\n        }\n    }\n}\n"},{"language": "sb","value": "begin:\nTextWindow.Write(\"Enter a number: \")\nnum = TextWindow.ReadNumber()\nremainder = Math.Remainder(num, 2)\nIf (remainder = 0) Then\n TextWindow.WriteLine(\"The number is Even\")\nElse\n TextWindow.WriteLine(\"The number is Odd\")\nEndIf\nGoto begin"},{"language": "scheme","value": ";;; make-matrix creates a matrix (a vector of vectors).\n(define make-matrix\n  (lambda (rows columns)\n    (do ((m (make-vector rows))\n         (i 0 (+ i 1)))\n        ((= i rows) m)\n        (vector-set! m i (make-vector columns)))))\n\n;;; matrix? checks to see if its argument is a matrix.\n;;; It isn't foolproof, but it's generally good enough.\n(define matrix?\n  (lambda (x)\n    (and (vector? x)\n         (> (vector-length x) 0)\n         (vector? (vector-ref x 0)))))\n\n;; matrix-rows returns the number of rows in a matrix.\n(define matrix-rows\n   (lambda (x)\n      (vector-length x)))\n\n;; matrix-columns returns the number of columns in a matrix.\n(define matrix-columns\n   (lambda (x)\n      (vector-length (vector-ref x 0))))\n\n;;; matrix-ref returns the jth element of the ith row.\n(define matrix-ref\n  (lambda (m i j)\n    (vector-ref (vector-ref m i) j)))\n\n;;; matrix-set! changes the jth element of the ith row.\n(define matrix-set!\n  (lambda (m i j x)\n    (vector-set! (vector-ref m i) j x)))\n\n;;; mul is the generic matrix/scalar multiplication procedure\n(define mul\n  (lambda (x y)\n    ;; mat-sca-mul multiplies a matrix by a scalar.\n    (define mat-sca-mul\n       (lambda (m x)\n          (let* ((nr (matrix-rows m))\n                 (nc (matrix-columns m))\n                 (r  (make-matrix nr nc)))\n             (do ((i 0 (+ i 1)))\n                 ((= i nr) r)\n                 (do ((j 0 (+ j 1)))\n                     ((= j nc))\n                     (matrix-set! r i j\n                        (* x (matrix-ref m i j))))))))\n\n    ;; mat-mat-mul multiplies one matrix by another, after verifying\n    ;; that the first matrix has as many columns as the second\n    ;; matrix has rows.\n    (define mat-mat-mul\n       (lambda (m1 m2)\n          (let* ((nr1 (matrix-rows m1))\n                 (nr2 (matrix-rows m2))\n                 (nc2 (matrix-columns m2))\n                 (r   (make-matrix nr1 nc2)))\n             (if (not (= (matrix-columns m1) nr2))\n                 (match-error m1 m2))\n             (do ((i 0 (+ i 1)))\n                 ((= i nr1) r)\n                 (do ((j 0 (+ j 1)))\n                     ((= j nc2))\n                     (do ((k 0 (+ k 1))\n                          (a 0\n                             (+ a\n                                (* (matrix-ref m1 i k)\n                                   (matrix-ref m2 k j)))))\n                         ((= k nr2)\n                          (matrix-set! r i j a))))))))\n\n   ;; type-error is called to complain when mul receives an invalid\n   ;; type of argument.\n    (define type-error\n       (lambda (what)\n          (error 'mul\n             \"~s is not a number or matrix\"\n             what)))\n\n    ;; match-error is called to complain when mul receives a pair of\n    ;; incompatible arguments.\n    (define match-error\n       (lambda (what1 what2)\n          (error 'mul\n             \"~s and ~s are incompatible operands\"\n             what1\n             what2)))\n\n    ;; body of mul; dispatch based on input types\n    (cond\n      ((number? x)\n       (cond\n         ((number? y) (* x y))\n         ((matrix? y) (mat-sca-mul y x))\n         (else (type-error y))))\n      ((matrix? x)\n       (cond\n         ((number? y) (mat-sca-mul x y))\n         ((matrix? y) (mat-mat-mul x y))\n         (else (type-error y))))\n      (else (type-error x)))))"},{"language": "scss","value": "$baseFontSizeInPixels: 14;\n\n@function px2em ($font_size, $base_font_size: $baseFontSizeInPixels) {  \n  @return ($font_size / $base_font_size) + em; \n}\n\nh1 {\n  font-size: px2em(36, $baseFontSizeInPixels);\n}\nh2  {\n  font-size: px2em(28, $baseFontSizeInPixels);\n}\n.class {\n  font-size: px2em(14, $baseFontSizeInPixels);\n}\n\nnav {\n  ul {\n    margin: 0;\n    padding: 0;\n    list-style: none;\n  }\n\n  li { display: inline-block; }\n\n  a {\n    display: block;\n    padding: 6px 12px;\n    text-decoration: none;\n  }\n  \n  @each $animal in puma, sea-slug, egret, salamander {\n    .#{$animal}-icon {\n      background-image: url('/images/#{$animal}.png');\n    }\n  }\n}"},{"language": "shell","value": "#!/bin/bash\n# Simple line count example, using bash\n#\n# Bash tutorial: http://linuxconfig.org/Bash_scripting_Tutorial#8-2-read-file-into-bash-array\n# My scripting link: http://www.macs.hw.ac.uk/~hwloidl/docs/index.html#scripting\n#\n# Usage: ./line_count.sh file\n# -----------------------------------------------------------------------------\n\n# Link filedescriptor 10 with stdin\nexec 10<&0\n# stdin replaced with a file supplied as a first argument\nexec < $1\n# remember the name of the input file\nin=$1\n\n# init\nfile=\"current_line.txt\"\nlet count=0\n\n# this while loop iterates over all lines of the file\nwhile read LINE\ndo\n    # increase line counter\n    ((count++))\n    # write current line to a tmp file with name $file (not needed for counting)\n    echo $LINE > $file\n    # this checks the return code of echo (not needed for writing; just for demo)\n    if [ $? -ne 0 ]\n     then echo \"Error in writing to file ${file}; check its permissions!\"\n    fi\ndone\n\necho \"Number of lines: $count\"\necho \"The last line of the file is: `cat ${file}`\"\n\n# Note: You can achieve the same by just using the tool wc like this\necho \"Expected number of lines: `wc -l $in`\"\n\n# restore stdin from filedescriptor 10\n# and close filedescriptor 10\nexec 0<&10 10<&-"},{"language": "sol","value": "pragma solidity ^0.4.11;\n\n/// @title Voting with delegation.\ncontract Ballot {\n    // This declares a new complex type which will\n    // be used for variables later.\n    // It will represent a single voter.\n    struct Voter {\n        uint weight; // weight is accumulated by delegation\n        bool voted;  // if true, that person already voted\n        address delegate; // person delegated to\n        uint vote;   // index of the voted proposal\n    }\n\n    // This is a type for a single proposal.\n    struct Proposal {\n        bytes32 name;   // short name (up to 32 bytes)\n        uint voteCount; // number of accumulated votes\n    }\n\n    address public chairperson;\n\n    // This declares a state variable that\n    // stores a `Voter` struct for each possible address.\n    mapping(address => Voter) public voters;\n\n    // A dynamically-sized array of `Proposal` structs.\n    Proposal[] public proposals;\n\n    /// Create a new ballot to choose one of `proposalNames`.\n    function Ballot(bytes32[] proposalNames) {\n        chairperson = msg.sender;\n        voters[chairperson].weight = 1;\n\n        // For each of the provided proposal names,\n        // create a new proposal object and add it\n        // to the end of the array.\n        for (uint i = 0; i < proposalNames.length; i++) {\n            // `Proposal({...})` creates a temporary\n            // Proposal object and `proposals.push(...)`\n            // appends it to the end of `proposals`.\n            proposals.push(Proposal({\n                name: proposalNames[i],\n                voteCount: 0\n            }));\n        }\n    }\n\n    // Give `voter` the right to vote on this ballot.\n    // May only be called by `chairperson`.\n    function giveRightToVote(address voter) {\n        // If the argument of `require` evaluates to `false`,\n        // it terminates and reverts all changes to\n        // the state and to Ether balances. It is often\n        // a good idea to use this if functions are\n        // called incorrectly. But watch out, this\n        // will currently also consume all provided gas\n        // (this is planned to change in the future).\n        require((msg.sender == chairperson) && !voters[voter].voted && (voters[voter].weight == 0));\n        voters[voter].weight = 1;\n    }\n\n    /// Delegate your vote to the voter `to`.\n    function delegate(address to) {\n        // assigns reference\n        Voter sender = voters[msg.sender];\n        require(!sender.voted);\n\n        // Self-delegation is not allowed.\n        require(to != msg.sender);\n\n        // Forward the delegation as long as\n        // `to` also delegated.\n        // In general, such loops are very dangerous,\n        // because if they run too long, they might\n        // need more gas than is available in a block.\n        // In this case, the delegation will not be executed,\n        // but in other situations, such loops might\n        // cause a contract to get \"stuck\" completely.\n        while (voters[to].delegate != address(0)) {\n            to = voters[to].delegate;\n\n            // We found a loop in the delegation, not allowed.\n            require(to != msg.sender);\n        }\n\n        // Since `sender` is a reference, this\n        // modifies `voters[msg.sender].voted`\n        sender.voted = true;\n        sender.delegate = to;\n        Voter delegate = voters[to];\n        if (delegate.voted) {\n            // If the delegate already voted,\n            // directly add to the number of votes\n            proposals[delegate.vote].voteCount += sender.weight;\n        } else {\n            // If the delegate did not vote yet,\n            // add to her weight.\n            delegate.weight += sender.weight;\n        }\n    }\n\n    /// Give your vote (including votes delegated to you)\n    /// to proposal `proposals[proposal].name`.\n    function vote(uint proposal) {\n        Voter sender = voters[msg.sender];\n        require(!sender.voted);\n        sender.voted = true;\n        sender.vote = proposal;\n\n        // If `proposal` is out of the range of the array,\n        // this will throw automatically and revert all\n        // changes.\n        proposals[proposal].voteCount += sender.weight;\n    }\n\n    /// @dev Computes the winning proposal taking all\n    /// previous votes into account.\n    function winningProposal() constant\n            returns (uint winningProposal)\n    {\n        uint winningVoteCount = 0;\n        for (uint p = 0; p < proposals.length; p++) {\n            if (proposals[p].voteCount > winningVoteCount) {\n                winningVoteCount = proposals[p].voteCount;\n                winningProposal = p;\n            }\n        }\n    }\n\n    // Calls winningProposal() function to get the index\n    // of the winner contained in the proposals array and then\n    // returns the name of the winner\n    function winnerName() constant\n            returns (bytes32 winnerName)\n    {\n        winnerName = proposals[winningProposal()].name;\n    }\n}"},{"language": "sql","value": "CREATE TABLE dbo.EmployeePhoto\n(\n    EmployeeId INT NOT NULL PRIMARY KEY,\n    Photo VARBINARY(MAX) FILESTREAM NULL,\n    MyRowGuidColumn UNIQUEIDENTIFIER NOT NULL ROWGUIDCOL\n                    UNIQUE DEFAULT NEWID()\n);\n\nGO\n\n/*\ntext_of_comment\n/* nested comment */\n*/\n\n-- line comment\n\nCREATE NONCLUSTERED INDEX IX_WorkOrder_ProductID\n    ON Production.WorkOrder(ProductID)\n    WITH (FILLFACTOR = 80,\n        PAD_INDEX = ON,\n        DROP_EXISTING = ON);\nGO\n\nWHILE (SELECT AVG(ListPrice) FROM Production.Product) < $300\nBEGIN\n   UPDATE Production.Product\n      SET ListPrice = ListPrice * 2\n   SELECT MAX(ListPrice) FROM Production.Product\n   IF (SELECT MAX(ListPrice) FROM Production.Product) > $500\n      BREAK\n   ELSE\n      CONTINUE\nEND\nPRINT 'Too much for the market to bear';\n\nMERGE INTO Sales.SalesReason AS [Target]\nUSING (VALUES ('Recommendation','Other'), ('Review', 'Marketing'), ('Internet', 'Promotion'))\n       AS [Source] ([NewName], NewReasonType)\nON [Target].[Name] = [Source].[NewName]\nWHEN MATCHED\nTHEN UPDATE SET ReasonType = [Source].NewReasonType\nWHEN NOT MATCHED BY TARGET\nTHEN INSERT ([Name], ReasonType) VALUES ([NewName], NewReasonType)\nOUTPUT $action INTO @SummaryOfChanges;\n\nSELECT ProductID, OrderQty, SUM(LineTotal) AS Total\nFROM Sales.SalesOrderDetail\nWHERE UnitPrice < $5.00\nGROUP BY ProductID, OrderQty\nORDER BY ProductID, OrderQty\nOPTION (HASH GROUP, FAST 10);\n"},{"language": "st","value": "CONFIGURATION DefaultCfg\n    VAR_GLOBAL\n        Start_Stop AT %IX0.0: BOOL; (* This is a comment *)\n    END_VAR\n    TASK NewTask  (INTERVAL := T#20ms);\n    PROGRAM Main WITH NewTask : PLC_PRG;\nEND_CONFIGURATION\n\nPROGRAM demo\n    VAR_EXTERNAL\n        Start_Stop: BOOL;\n    END_VAR\n    VAR\n        a : REAL; // Another comment\n        todTest: TIME_OF_DAY := TOD#12:55;\n    END_VAR\n    a := csq(12.5);\n    TON1(IN := TRUE, PT := T#2s);\n    16#FAC0 2#1001_0110\n    IF TON1.Q AND a > REAL#100 THEN\n        Start_Stop := TRUE;\n    END_IF\nEND_PROGRAM;\n\n/* Get a square of the circle */\nFUNCTION csq : REAL\n    VAR_INPUT\n        r: REAL;\n    END_VAR\n    VAR CONSTANT\n        c_pi: REAL := 3.14;\n    END_VAR\n    csq := ABS(c_pi * (r * 2));\nEND_FUNCTION"},{"language": "swift","value": "import Foundation\n\nprotocol APIControllerProtocol {\n    func didReceiveAPIResults(results: NSArray)\n}\n\nclass APIController {\n    var delegate: APIControllerProtocol\n\n    init(delegate: APIControllerProtocol) {\n        self.delegate = delegate\n    }\n\n    func get(path: String) {\n        let url = NSURL(string: path)\n        let session = NSURLSession.sharedSession()\n        let task = session.dataTaskWithURL(url!, completionHandler: {data, response, error -> Void in\n            println(\"Task completed\")\n            if(error != nil) {\n                // If there is an error in the web request, print it to the console\n                println(error.localizedDescription)\n            }\n            var err: NSError?\n            if let jsonResult = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.MutableContainers, error: &err) as? NSDictionary {\n                if(err != nil) {\n                    // If there is an error parsing JSON, print it to the console\n                    println(\"JSON Error \\(err!.localizedDescription)\")\n                }\n                if let results: NSArray = jsonResult[\"results\"] as? NSArray {\n                    self.delegate.didReceiveAPIResults(results)\n                }\n            }\n        })\n\n        // The task is just an object with all these properties set\n        // In order to actually make the web request, we need to \"resume\"\n        task.resume()\n    }\n\n    func searchItunesFor(searchTerm: String) {\n        // The iTunes API wants multiple terms separated by + symbols, so replace spaces with + signs\n        let itunesSearchTerm = searchTerm.stringByReplacingOccurrencesOfString(\" \", withString: \"+\", options: NSStringCompareOptions.CaseInsensitiveSearch, range: nil)\n\n        // Now escape anything else that isn't URL-friendly\n        if let escapedSearchTerm = itunesSearchTerm.stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding) {\n            let urlPath = \"https://itunes.apple.com/search?term=\\(escapedSearchTerm)&media=music&entity=album\"\n        }\n    }\n\n}"},{"language": "typescript","value": "/* Game of Life\n * Implemented in TypeScript\n * To learn more about TypeScript, please visit http://www.typescriptlang.org/\n */\n \nmodule Conway {\n\n\texport class Cell {\n\t\tpublic row: number;\n\t\tpublic col: number;\n\t\tpublic live: boolean;\n\t\t\n\t\tconstructor(row: number, col: number, live: boolean) {\n\t\t\tthis.row = row;\n\t\t\tthis.col = col;\n\t\t\tthis.live = live\n\t\t}\n\t}\n\t\n\texport class GameOfLife {\n\t\tprivate gridSize: number;\n\t\tprivate canvasSize: number;\n\t\tprivate lineColor: string;\n\t\tprivate liveColor: string;\n\t\tprivate deadColor: string;\n\t\tprivate initialLifeProbability: number;\n\t\tprivate animationRate: number;\n\t\tprivate cellSize: number;\n\t\tprivate context: CanvasRenderingContext2D;\n\t\tprivate world;\n\t\t\n\t\t\n\t\tconstructor() {\n\t\t\tthis.gridSize = 50;\n\t\t\tthis.canvasSize = 600;\n\t\t\tthis.lineColor = '#cdcdcd';\n\t\t\tthis.liveColor = '#666';\n\t\t\tthis.deadColor = '#eee';\n\t\t\tthis.initialLifeProbability = 0.5;\n\t\t\tthis.animationRate = 60;\n\t\t\tthis.cellSize = 0;\n\t\t\tthis.world = this.createWorld();\n\t\t\tthis.circleOfLife();\n\t\t}\n\t\n\t\tpublic createWorld() {\n\t\t\treturn this.travelWorld( (cell : Cell) =>  {\n\t\t\t\tcell.live = Math.random() < this.initialLifeProbability;\n\t\t\t\treturn cell;\n\t\t\t});\n\t\t}\n\t\t\n\t\tpublic circleOfLife() : void {\n\t\t\tthis.world = this.travelWorld( (cell: Cell) => {\n\t\t\t\tcell = this.world[cell.row][cell.col];\n\t\t\t\tthis.draw(cell);\n\t\t\t\treturn this.resolveNextGeneration(cell);\n\t\t\t});\n\t\t\tsetTimeout( () => {this.circleOfLife()}, this.animationRate);\n\t\t} \n\t\n\t\tpublic resolveNextGeneration(cell : Cell) {\n\t\t\tvar count = this.countNeighbors(cell);\n\t\t\tvar newCell = new Cell(cell.row, cell.col, cell.live);\n\t\t\tif(count < 2 || count > 3) newCell.live = false;\n\t\t\telse if(count == 3) newCell.live = true;\n\t\t\treturn newCell;\n\t\t}\n\t\n\t\tpublic countNeighbors(cell : Cell) {\n\t\t\tvar neighbors = 0;\n\t\t\tfor(var row = -1; row <=1; row++) {\n\t\t\t\tfor(var col = -1; col <= 1; col++) {\n\t\t\t\t\tif(row == 0 && col == 0) continue;\n\t\t\t\t\tif(this.isAlive(cell.row + row, cell.col + col)) {\n\t\t\t\t\t\tneighbors++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn neighbors;\n\t\t}\n\t\n\t\tpublic isAlive(row : number, col : number) {\n\t\t\tif(row < 0 || col < 0 || row >= this.gridSize || col >= this.gridSize) return false;\n\t\t\treturn this.world[row][col].live;\n\t\t}\n\t\n\t\tpublic travelWorld(callback) {\n\t\t\tvar result = [];\n\t\t\tfor(var row = 0; row < this.gridSize; row++) {\n\t\t\t\tvar rowData = [];\n\t\t\t\tfor(var col = 0; col < this.gridSize; col++) {\n\t\t\t\t\trowData.push(callback(new Cell(row, col, false)));\n\t\t\t\t}\n\t\t\t\tresult.push(rowData);\n\t\t\t}  \n\t\t\treturn result;\n\t\t}\n\t\n\t\tpublic draw(cell : Cell) {\n\t\t\tif(this.context == null) this.context = this.createDrawingContext();\n\t\t\tif(this.cellSize == 0) this.cellSize = this.canvasSize/this.gridSize;\n\t\n\t\t\tthis.context.strokeStyle = this.lineColor;\n\t\t\tthis.context.strokeRect(cell.row * this.cellSize, cell.col*this.cellSize, this.cellSize, this.cellSize);\n\t\t\tthis.context.fillStyle = cell.live ? this.liveColor : this.deadColor;\n\t\t\tthis.context.fillRect(cell.row * this.cellSize, cell.col*this.cellSize, this.cellSize, this.cellSize);\n\t\t}    \n\t\t\n\t\tpublic createDrawingContext() {\n\t\t\tvar canvas = <HTMLCanvasElement> document.getElementById('conway-canvas');\n\t\t\tif(canvas == null) {\n\t\t\t\t\tcanvas = document.createElement('canvas');\n\t\t\t\t\tcanvas.id = 'conway-canvas';\n\t\t\t\t\tcanvas.width = this.canvasSize;\n\t\t\t\t\tcanvas.height = this.canvasSize;\n\t\t\t\t\tdocument.body.appendChild(canvas);\n\t\t\t}\n\t\t\treturn canvas.getContext('2d');\n\t\t}\n\t}\n}\n\nvar game = new Conway.GameOfLife();\n"},{"language": "vb","value": "Imports System\nImports System.Collections.Generic\n\nModule Module1\n\n    Sub Main()\n        Dim a As New M8Ball\n\n        Do While True\n\n            Dim q As String = \"\"\n            Console.Write(\"ask me about the future... \")\n            q = Console.ReadLine()\n\n            If q.Trim <> \"\" Then\n                Console.WriteLine(\"the answer is... {0}\", a.getAnswer(q))\n            Else\n                Exit Do\n            End If\n        Loop\n\n    End Sub\n\nEnd Module\n\nClass M8Ball\n\n    Public Answers As System.Collections.Generic.Dictionary(Of Integer, String)\n\n    Public Sub New()\n        Answers = New System.Collections.Generic.Dictionary(Of Integer, String)\n        Answers.Add(0, \"It is certain\")\n        Answers.Add(1, \"It is decidedly so\")\n        Answers.Add(2, \"Without a doubt\")\n        Answers.Add(3, \"Yes, definitely\")\n        Answers.Add(4, \"You may rely on \")\n        Answers.Add(5, \"As I see it, yes\")\n        Answers.Add(6, \"Most likely\")\n        Answers.Add(7, \"Outlook good\")\n        Answers.Add(8, \"Signs point to yes\")\n        Answers.Add(9, \"Yes\")\n        Answers.Add(10, \"Reply hazy, try again\")\n        Answers.Add(11, \"Ask again later\")\n        Answers.Add(12, \"Better not tell you now\")\n        Answers.Add(13, \"Cannot predict now\")\n        Answers.Add(14, \"Concentrate and ask again\")\n        Answers.Add(15, \"Don't count on it\")\n        Answers.Add(16, \"My reply is no\")\n        Answers.Add(17, \"My sources say no\")\n        Answers.Add(18, \"Outlook not so\")\n        Answers.Add(19, \"Very doubtful\")\n    End Sub\n\n    Public Function getAnswer(theQuestion As String) As String\n        Dim r As New Random\n        Return Answers(r.Next(0, 19))\n    End Function\n\nEnd Class\n"},{"language": "xml","value": "<?xml version=\"1.0\"?>\n<configuration xmlns:xdt=\"http://schemas.microsoft.com/XML-Document-Transform\">\n  <connectionStrings>\n    <add name=\"MyDB\" \n      connectionString=\"value for the deployed Web.config file\" \n      xdt:Transform=\"SetAttributes\" xdt:Locator=\"Match(name)\"/>\n  </connectionStrings>\n  <system.web>\n    <customErrors defaultRedirect=\"GenericError.htm\"\n      mode=\"RemoteOnly\" xdt:Transform=\"Replace\">\n      <error statusCode=\"500\" redirect=\"InternalError.htm\"/>\n    </customErrors>\n  </system.web>\n</configuration>"},{"language": "yaml","value": "%TAG ! tag:clarkevans.com,2002:\n--- !shape\n  # Use the ! handle for presenting\n  # tag:clarkevans.com,2002:circle\n- !circle\n  center: &ORIGIN {x: 73, y: 129}\n  radius: 7\n- !line\n  start: *ORIGIN\n  finish: { x: 89, y: 102 }\n- !label\n  start: *ORIGIN\n  color: 0xFFEEBB\n  text: Pretty vector drawing.\n"},{"language": "c","value": "// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full\n// license information.\n\n/*\n *\tCOMMAND LINE: -Ox -Gz -YX -UPROTOTYPES_REQUIRED\n */\n\n#pragma warning(disable : 4532)\n#pragma warning(disable : 4702)\n\n#if defined(_WIN32)\n\n#if defined(_M_SH)\n#define WIN_CE\n#endif\n\n#if defined(_M_AMD64)\n#define NEST_IN_FINALLY /* allow when __try nested in __finally OK */\n#endif\n\n#define NTSTATUS LONG\n#define EXCEPTION_NESTED_CALL 0x10\n#define RtlRaiseStatus(x) RaiseException((x), 0, 0, NULL)\n#define RtlRaiseException(x)                                                   \\\n  RaiseException((x)->ExceptionCode, (x)->ExceptionFlags,                      \\\n                 (x)->NumberParameters, (x)->ExceptionInformation)\n#define IN\n#define OUT\n#if !(defined(_M_IA64) || defined(_M_ALPHA) || defined(_M_PPC) ||              \\\n      defined(_M_AMD64) || defined(_M_ARM) || defined(_M_ARM64))\n#define i386 1\n#endif\n#define try __try\n#define except __except\n#define finally __finally\n#define leave __leave\n\n#endif\n\n#define WIN32_LEAN_AND_MEAN\n\n#include \"stdio.h\"\n#if defined(_M_IA64) || defined(_M_ALPHA) || defined(_M_PPC) ||                \\\n    defined(_M_AMD64) || defined(_M_ARM) || defined(_M_ARM64)\n#include \"setjmpex.h\"\n#else\n#include \"setjmp.h\"\n#endif\n#include \"float.h\"\n#include \"windows.h\"\n#include \"math.h\"\n\n#if !defined(STATUS_SUCCESS)\n#define STATUS_SUCCESS 0\n#endif\n#if !defined(STATUS_UNSUCCESSFUL)\n#define STATUS_UNSUCCESSFUL ((NTSTATUS)0xC0000001L)\n#endif\n\n//\n// Define switch constants.\n//\n\n#define BLUE 0\n#define RED 1\n\n//\n// Define function prototypes.\n//\n\nVOID addtwo(IN LONG First, IN LONG Second, IN PLONG Place);\n\nVOID bar1(IN NTSTATUS Status, IN PLONG Counter);\n\nVOID bar2(IN PLONG BlackHole, IN PLONG BadAddress, IN PLONG Counter);\n\nVOID dojump(IN jmp_buf JumpBuffer, IN PLONG Counter);\n\nLONG Echo(IN LONG Value);\n\n#if !defined(WIN_CE) // return through finally not allowed on WinCE\nVOID eret(IN NTSTATUS Status, IN PLONG Counter);\n#endif\n\nVOID except1(IN PLONG Counter);\n\nULONG\nexcept2(IN PEXCEPTION_POINTERS ExceptionPointers, IN PLONG Counter);\n\nULONG\nexcept3(IN PEXCEPTION_POINTERS ExceptionPointers, IN PLONG Counter);\n\nVOID foo1(IN NTSTATUS Status);\n\nVOID foo2(IN PLONG BlackHole, IN PLONG BadAddress);\n\n#if !defined(WIN_CE) // return from finally not allowed on WinCE\nVOID fret(IN PLONG Counter);\n#endif\n\nBOOLEAN\nTkm(VOID);\n\nVOID Test61Part2(IN OUT PULONG Counter);\n\ndouble SquareDouble(IN double op);\n\nDECLSPEC_NOINLINE\nULONG\nPgFilter(VOID)\n\n{\n\n  printf(\"filter entered...\");\n  return EXCEPTION_EXECUTE_HANDLER;\n}\n\n#pragma warning(push)\n#pragma warning(disable : 4532)\n\nVOID PgTest69(IN PLONG State, IN PLONG Fault)\n\n{\n\n  try {\n    try {\n      *Fault += 1;\n    }\n    finally {\n      if (AbnormalTermination()) {\n        if (*State == 1) {\n          *State += 1;\n\n        } else {\n          *Fault += 1;\n        }\n      }\n    }\n  }\n  except(((*State += 1) == 1) ? PgFilter() : EXCEPTION_CONTINUE_SEARCH) {\n    if (*State != 2) {\n      *Fault += 1;\n    }\n  }\n\n  return;\n}\n\nVOID PgTest70(IN PLONG State, IN PLONG Fault)\n\n{\n\n  try {\n    try {\n      *Fault += 1;\n    }\n    finally {\n      if (AbnormalTermination()) {\n        if (*State == 2) {\n          PgFilter();\n          return;\n\n        } else {\n          *Fault += 1;\n        }\n      }\n    }\n  }\n  except(((*State += 2) == 2) ? EXCEPTION_EXECUTE_HANDLER\n                              : EXCEPTION_CONTINUE_SEARCH) {\n    *Fault += 1;\n  }\n\n  return;\n}\n\nVOID PgTest71(IN PLONG State, IN PLONG Fault)\n\n{\n\n  try {\n    try {\n      try {\n        *Fault += 1;\n      }\n      finally {\n        if (AbnormalTermination()) {\n          if (*State == 3) {\n            *State += 3;\n            return;\n\n          } else {\n            *Fault += 1;\n          }\n        }\n      }\n    }\n    finally {\n      if (AbnormalTermination()) {\n        if (*State == 6) {\n          *State += 3;\n\n        } else {\n          *Fault += 1;\n        }\n      }\n    }\n  }\n  except(((*State += 3) == 3) ? PgFilter() : EXCEPTION_CONTINUE_SEARCH) {\n    *Fault += 1;\n  }\n\n  return;\n}\n\nVOID PgTest72(IN PLONG State, IN PLONG Fault)\n\n{\n\n  try {\n    try {\n      try {\n        *Fault += 1;\n      }\n      finally {\n        if (AbnormalTermination()) {\n          if (*State == 4) {\n            *State += 4;\n            return;\n\n          } else {\n            *Fault += 1;\n          }\n        }\n      }\n    }\n    finally {\n      if (AbnormalTermination()) {\n        if (*State == 8) {\n          *State += 4;\n          PgFilter();\n\n        } else {\n          *Fault += 1;\n        }\n      }\n    }\n  }\n  except(((*State += 4) == 4) ? EXCEPTION_EXECUTE_HANDLER\n                              : EXCEPTION_CONTINUE_SEARCH) {\n    *Fault += 1;\n  }\n\n  return;\n}\n\nVOID PgTest73(IN PLONG State, IN PLONG Fault)\n\n{\n\n  try {\n    try {\n      try {\n        *Fault += 1;\n      }\n      finally {\n        if (AbnormalTermination()) {\n          if (*State == 5) {\n            *State += 5;\n\n          } else {\n            *Fault += 1;\n          }\n        }\n      }\n    }\n    finally {\n      if (AbnormalTermination()) {\n        if (*State == 10) {\n          *State += 5;\n          return;\n\n        } else {\n          *Fault += 1;\n        }\n      }\n    }\n  }\n  except(((*State += 5) == 5) ? PgFilter() : EXCEPTION_CONTINUE_SEARCH) {\n    *Fault += 1;\n  }\n\n  return;\n}\n\nVOID PgTest74(IN PLONG State, IN PLONG Fault)\n\n{\n\n  try {\n    try {\n      try {\n        *Fault += 1;\n      }\n      finally {\n        if (AbnormalTermination()) {\n          if (*State == 6) {\n            *State += 6;\n\n          } else {\n            *Fault += 1;\n          }\n        }\n      }\n    }\n    finally {\n      if (AbnormalTermination()) {\n        if (*State == 12) {\n          *State += 6;\n          PgFilter();\n          return;\n\n        } else {\n          *Fault += 1;\n        }\n      }\n    }\n  }\n  except(((*State += 6) == 6) ? EXCEPTION_EXECUTE_HANDLER\n                              : EXCEPTION_CONTINUE_SEARCH) {\n    *Fault += 1;\n  }\n\n  return;\n}\n\nVOID PgTest75(IN PLONG State, IN PLONG Fault)\n\n{\n\n  try {\n    try {\n      try {\n        try {\n          *Fault += 1;\n        }\n        finally {\n          if (AbnormalTermination()) {\n            if (*State == 7) {\n              *State += 7;\n              *Fault += 1;\n\n            } else {\n              *State += 10;\n            }\n          }\n        }\n      }\n      except(((*State += 7) == 7) ? EXCEPTION_EXECUTE_HANDLER\n                                  : EXCEPTION_CONTINUE_SEARCH) {\n        *Fault += 1;\n      }\n    }\n    finally {\n      if (AbnormalTermination()) {\n        if (*State == 28) {\n          *State += 7;\n          return;\n\n        } else {\n          *Fault += 1;\n        }\n      }\n    }\n  }\n  except(((*State += 7) == 28) ? PgFilter() : EXCEPTION_CONTINUE_SEARCH) {\n    *Fault += 1;\n  }\n\n  return;\n}\n\nVOID PgTest76(IN PLONG State, IN PLONG Fault)\n\n{\n\n  try {\n    try {\n      try {\n        try {\n          *Fault += 1;\n        }\n        finally {\n          if (AbnormalTermination()) {\n            if (*State == 8) {\n              *State += 8;\n              *Fault += 1;\n\n            } else {\n              *State += 10;\n            }\n          }\n        }\n      }\n      except(((*State += 8) == 8) ? EXCEPTION_EXECUTE_HANDLER\n                                  : EXCEPTION_CONTINUE_SEARCH) {\n        *Fault += 1;\n      }\n    }\n    finally {\n      if (AbnormalTermination()) {\n        if (*State == 32) {\n          *State += 8;\n          PgFilter();\n          return;\n\n        } else {\n          *Fault += 1;\n        }\n      }\n    }\n  }\n  except(((*State += 8) == 32) ? EXCEPTION_EXECUTE_HANDLER\n                               : EXCEPTION_CONTINUE_SEARCH) {\n    *Fault += 1;\n  }\n\n  return;\n}\n\nVOID PgTest77(IN PLONG State, IN PLONG Fault)\n\n{\n\n  try {\n    try {\n      try {\n        try {\n          *Fault += 1;\n        }\n        finally {\n          if (AbnormalTermination()) {\n            if (*State == 9) {\n              *State += 9;\n              *Fault += 1;\n\n            } else {\n              *State += 10;\n            }\n          }\n        }\n      }\n      except(((*State += 9) == 9) ? PgFilter() : EXCEPTION_CONTINUE_SEARCH) {\n        *Fault += 1;\n      }\n    }\n    finally {\n      if (AbnormalTermination()) {\n        if (*State == 36) {\n          *State += 9;\n          return;\n\n        } else {\n          *Fault += 1;\n        }\n      }\n    }\n  }\n  except(((*State += 9) == 36) ? EXCEPTION_EXECUTE_HANDLER\n                               : EXCEPTION_CONTINUE_SEARCH) {\n    *Fault += 1;\n  }\n\n  return;\n}\n\nVOID PgTest78(IN PLONG State, IN PLONG Fault)\n\n{\n\n  try {\n    try {\n      try {\n        try {\n          *Fault += 1;\n        }\n        finally {\n          if (AbnormalTermination()) {\n            if (*State == 10) {\n              *State += 10;\n              PgFilter();\n              *Fault += 1;\n\n            } else {\n              *State += 10;\n            }\n          }\n        }\n      }\n      except(((*State += 10) == 10) ? EXCEPTION_EXECUTE_HANDLER\n                                    : EXCEPTION_CONTINUE_SEARCH) {\n        *Fault += 1;\n      }\n    }\n    finally {\n      if (AbnormalTermination()) {\n        if (*State == 40) {\n          *State += 10;\n          return;\n\n        } else {\n          *Fault += 1;\n        }\n      }\n    }\n  }\n  except(((*State += 10) == 40) ? EXCEPTION_EXECUTE_HANDLER\n                                : EXCEPTION_CONTINUE_SEARCH) {\n    *Fault += 1;\n  }\n\n  return;\n}\n\n#pragma warning(pop)\n\nVOID Test79(PLONG Counter, PLONG Fault)\n\n{\n\n  try {\n    try {\n      try {\n        *Fault += 1;\n      }\n      finally {\n        printf(\"finally 1...\");\n        *Fault += 1;\n      }\n    }\n    finally { printf(\"finally 2...\"); }\n  }\n  except(*Counter += 1, printf(\"filter 1...\"), EXCEPTION_CONTINUE_SEARCH) {}\n\n  return;\n}\n\nULONG G;\n\nULONG\nTest80(VOID)\n\n{\n\n  G = 1;\n  try {\n    while (G) {\n      try {\n        if (G == 10) {\n          return 1;\n        }\n\n        if (G == 1) {\n          continue;\n        }\n      }\n      finally { G = 0; }\n    }\n  }\n  finally { G = 10; }\n\n  return 0;\n}\n\nvoid Test81(int *pCounter) {\n  volatile char *AvPtr = NULL;\n\n  __try {\n    __try { *AvPtr = '\\0'; }\n    __except(EXCEPTION_EXECUTE_HANDLER) { __leave; }\n  }\n  __finally {\n    printf(\"in finally \");\n    *pCounter += 1;\n  }\n  return;\n}\n\nDECLSPEC_NOINLINE\nVOID Test82Foo(VOID)\n\n{\n  *(volatile int *)0 = 0;\n}\n\nVOID Test82(__inout PLONG Counter)\n\n{\n\n  int retval = 1;\n\n  __try {\n    __try { Test82Foo(); }\n    __finally {\n      switch (*Counter) {\n      case 0:\n        printf(\"something failed!\\n\");\n        retval = 6;\n        break;\n\n      case 1:\n        retval = 0;\n        break;\n\n      case 2:\n        printf(\"how did you get here?\\n\");\n        retval = 2;\n        break;\n\n      case 3:\n        printf(\"what?!?\\n\");\n        retval = 3;\n        break;\n\n      case 4:\n        printf(\"not correct\\n\");\n        retval = 4;\n        break;\n\n      case 5:\n        printf(\"error!\\n\");\n        retval = 5;\n        break;\n      }\n    }\n  }\n  __except(1){}\n\n  *Counter = retval;\n  return;\n}\n\nLONG Test83(VOID)\n\n{\n\n  G = 1;\n  try {\n    try {\n      while (G) {\n        try {\n          if (G == 10) {\n            return 1;\n          }\n\n          if (G == 1) {\n            continue;\n          }\n        }\n        finally { G = 0; }\n      }\n    }\n    except(EXCEPTION_EXECUTE_HANDLER) { leave; }\n  }\n  finally { G = 10; }\n\n  return 0;\n}\n\nDECLSPEC_NOINLINE\nVOID Test84(_Inout_ PLONG Counter)\n\n{\n  volatile int *Fault = 0;\n\n  try {\n    try {\n      *Fault += 1;\n    }\n    except(EXCEPTION_EXECUTE_HANDLER) {\n      try {\n        return;\n      }\n      finally { *Counter += 1; }\n    }\n  }\n  finally {\n\n    if (AbnormalTermination()) {\n      *Counter += 1;\n    }\n  }\n\n  return;\n}\n\nDECLSPEC_NOINLINE\nLONG Test85(_Inout_ PLONG Counter)\n\n{\n  volatile int *Fault = 0;\n\n  G = 1;\n  try {\n    try {\n      try {\n        while (G) {\n          try {\n            try {\n              if (G == 10) {\n                return 1;\n              }\n              try {\n                *Counter += 1;\n              }\n              except(EXCEPTION_EXECUTE_HANDLER) {}\n\n              if (G == 1) {\n                continue;\n              }\n            }\n            finally {\n              G = 0;\n              *Counter += 1;\n              *Fault += 1;\n            }\n          }\n          except(EXCEPTION_EXECUTE_HANDLER) {\n            *Counter += 1;\n            leave;\n          }\n        }\n      }\n      finally {\n        G = 10;\n        *Counter += 1;\n        *Fault += 1;\n      }\n    }\n    except(EXCEPTION_EXECUTE_HANDLER) { *Counter += 1; }\n    *Counter += 1;\n  }\n  finally { *Counter += 1; }\n  return 1;\n}\n\nDECLSPEC_NOINLINE\nVOID Test86(_Inout_ PLONG Counter)\n\n{\n  volatile int *Fault = 0;\n\n  try {\n    try {\n      try {\n        try {\n          try {\n            try {\n              *Fault += 1;\n            }\n            except(printf(\"Filter1 %d..\", *Counter),\n                   EXCEPTION_EXECUTE_HANDLER) {\n              try {\n                printf(\"Handler1 %d..\", *Counter);\n                return;\n              }\n              finally {\n                printf(\"Finally1 %d..\", *Counter);\n                *Counter += 1;\n              }\n            }\n          }\n          finally {\n            printf(\"Finally2 %d..\", *Counter);\n            *Counter += 1;\n          }\n        }\n        except(EXCEPTION_EXECUTE_HANDLER) { leave; }\n      }\n      finally { *Counter += 1; }\n    }\n    except(EXCEPTION_EXECUTE_HANDLER) { leave; }\n  }\n  finally { *Counter += 1; }\n\n  return;\n}\n\nVOID Test87(_Inout_ PLONG Counter)\n\n/*++\n\nRoutine Description:\n\n    This function verifies the behavior of nested exception dispatching.\n\nArguments:\n\n    Counter - Supplies a pointer to the state counter.\n\nReturn Value:\n    None.\n\n--*/\n\n{\n  volatile int *Fault = 0;\n\n//\n// N.B.  Disabled on x86 due to failing test case with handling of returns\n//       in nested termination handlers on x86.\n//\n//       Disabled on ARM due to failing test case with handling of abutting\n//       termination handlers within an except handler.\n//\n//       Disabled on AMD64 due to failing test case with handling of\n//       abutting termination handlers within an except handler when a\n//       non-local goto is involved.\n//\n\n#if !defined(_X86_)\n  try {\n    try {\n      try {\n        try {\n          try {\n            *Fault += 1;\n\n            try {\n            }\n            finally {\n              if (AbnormalTermination()) {\n                *Fault += 1;\n              }\n            }\n          }\n          finally {\n\n            if (AbnormalTermination()) {\n              if ((*Counter += 13) == 26) {\n                return;\n\n              } else {\n                *Fault += 1;\n              }\n            }\n          }\n        }\n        finally {\n          if (AbnormalTermination()) {\n            *Counter += 13;\n            *Fault += 1;\n          }\n        }\n      }\n      except(((*Counter += 13) == 13) ? EXCEPTION_EXECUTE_HANDLER\n                                      : EXCEPTION_CONTINUE_SEARCH) {\n        *Fault += 1;\n      }\n    }\n    except(((*Counter += 13) == 65) ? EXCEPTION_EXECUTE_HANDLER\n                                    : EXCEPTION_CONTINUE_SEARCH) {\n      try {\n        *Counter += 13;\n        return;\n      }\n      finally {\n        if (AbnormalTermination()) {\n          *Counter += 13;\n          goto Finish;\n        }\n      }\n    }\n  }\n  finally {\n\n    if (AbnormalTermination()) {\n      if ((*Counter += 13) == 104) {\n        goto Finish;\n      }\n    }\n  }\n\nFinish:\n#else\n  *Counter = 104;\n#endif\n\n  return;\n}\n\nVOID Test88(_Inout_ PLONG Counter)\n\n{\n  volatile int *Fault = 0;\n\n  try {\n    try {\n      try {\n        try {\n          try {\n            try {\n              try {\n                try {\n                  *Fault += 1;\n                }\n                except(((*Counter += 1) == 1) ? *Fault\n                                              : EXCEPTION_CONTINUE_SEARCH) {}\n              }\n              except(*Counter += 1, EXCEPTION_EXECUTE_HANDLER) { *Fault += 2; }\n            }\n            except(*Counter += 1, EXCEPTION_CONTINUE_SEARCH) { leave; }\n          }\n          except(*Counter += 1, EXCEPTION_CONTINUE_SEARCH) { leave; }\n        }\n        except(EXCEPTION_EXECUTE_HANDLER) {}\n      }\n      except(EXCEPTION_EXECUTE_HANDLER) {}\n    }\n    except(EXCEPTION_EXECUTE_HANDLER) { leave; }\n  }\n  finally { *Counter += 1; }\n}\n\nint main(int argc, char *argv[])\n\n{\n\n  PLONG BadAddress;\n  PCHAR BadByte;\n  PLONG BlackHole;\n  ULONG Index1;\n  ULONG Index2 = RED;\n  jmp_buf JumpBuffer;\n  LONG Counter;\n  EXCEPTION_RECORD ExceptionRecord;\n  double doubleresult;\n\n  //\n  // Announce start of exception test.\n  //\n\n  printf(\"Start of exception test\\n\");\n\n  //\n  // Initialize exception record.\n  //\n\n  ExceptionRecord.ExceptionCode = STATUS_INTEGER_OVERFLOW;\n  ExceptionRecord.ExceptionFlags = 0;\n  ExceptionRecord.ExceptionRecord = NULL;\n  ExceptionRecord.NumberParameters = 0;\n\n  //\n  // Initialize pointers.\n  //\n\n  BadAddress = (PLONG)NULL;\n  BadByte = (PCHAR)NULL;\n  BadByte += 1;\n  BlackHole = &Counter;\n\n  //\n  // Simply try statement with a finally clause that is entered sequentially.\n  //\n\n  printf(\"    test1...\");\n  Counter = 0;\n  try {\n    Counter += 1;\n  }\n  finally {\n    if (abnormal_termination() == FALSE) {\n      Counter += 1;\n    }\n  }\n\n  if (Counter != 2) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Simple try statement with an exception clause that is never executed\n  // because there is no exception raised in the try clause.\n  //\n\n  printf(\"    test2...\");\n  Counter = 0;\n  try {\n    Counter += 1;\n  }\n  except(Counter) { Counter += 1; }\n\n  if (Counter != 1) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Simple try statement with an exception handler that is never executed\n  // because the exception expression continues execution.\n  //\n\n  printf(\"    test3...\");\n  Counter = 0;\n  try {\n    Counter -= 1;\n    RtlRaiseException(&ExceptionRecord);\n  }\n  except(Counter) { Counter -= 1; }\n\n  if (Counter != -1) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Simple try statement with an exception clause that is always executed.\n  //\n\n  printf(\"    test4...\");\n  Counter = 0;\n  try {\n    Counter += 1;\n    RtlRaiseStatus(STATUS_INTEGER_OVERFLOW);\n  }\n  except(Counter) { Counter += 1; }\n\n  if (Counter != 2) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Simple try statement with an exception clause that is always executed.\n  //\n\n  printf(\"    test5...\");\n  Counter = 0;\n  try {\n    Counter += 1;\n    *BlackHole += *BadAddress;\n  }\n  except(Counter) { Counter += 1; }\n\n  if (Counter != 2) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Simply try statement with a finally clause that is entered as the\n  // result of an exception.\n  //\n\n  printf(\"    test6...\");\n  Counter = 0;\n  try {\n    try {\n      Counter += 1;\n      RtlRaiseException(&ExceptionRecord);\n    }\n    finally {\n      if (abnormal_termination() != FALSE) {\n        Counter += 1;\n      }\n    }\n  }\n  except(Counter) {\n    if (Counter == 2) {\n      Counter += 1;\n    }\n  }\n\n  if (Counter != 3) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Simply try statement with a finally clause that is entered as the\n  // result of an exception.\n  //\n\n  printf(\"    test7...\");\n  Counter = 0;\n  try {\n    try {\n      Counter += 1;\n      *BlackHole += *BadAddress;\n    }\n    finally {\n      if (abnormal_termination() != FALSE) {\n        Counter += 1;\n      }\n    }\n  }\n  except(Counter) {\n    if (Counter == 2) {\n      Counter += 1;\n    }\n  }\n\n  if (Counter != 3) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Simple try that calls a function which raises an exception.\n  //\n\n  printf(\"    test8...\");\n  Counter = 0;\n  try {\n    Counter += 1;\n    foo1(STATUS_ACCESS_VIOLATION);\n  }\n  except((GetExceptionCode() == STATUS_ACCESS_VIOLATION)\n             ? EXCEPTION_EXECUTE_HANDLER\n             : EXCEPTION_CONTINUE_SEARCH) {\n    Counter += 1;\n  }\n\n  if (Counter != 2) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Simple try that calls a function which raises an exception.\n  //\n\n  printf(\"    test9...\");\n  Counter = 0;\n  try {\n    Counter += 1;\n    foo2(BlackHole, BadAddress);\n  }\n  except((GetExceptionCode() == STATUS_ACCESS_VIOLATION)\n             ? EXCEPTION_EXECUTE_HANDLER\n             : EXCEPTION_CONTINUE_SEARCH) {\n    Counter += 1;\n  }\n\n  if (Counter != 2) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Simple try that calls a function which calls a function that\n  // raises an exception. The first function has a finally clause\n  // that must be executed for this test to work.\n  //\n\n  printf(\"    test10...\");\n  Counter = 0;\n  try {\n    bar1(STATUS_ACCESS_VIOLATION, &Counter);\n  }\n  except((GetExceptionCode() == STATUS_ACCESS_VIOLATION)\n             ? EXCEPTION_EXECUTE_HANDLER\n             : EXCEPTION_CONTINUE_SEARCH) {\n    Counter -= 1;\n  }\n\n  if (Counter != 98) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Simple try that calls a function which calls a function that\n  // raises an exception. The first function has a finally clause\n  // that must be executed for this test to work.\n  //\n\n  printf(\"    test11...\");\n  Counter = 0;\n  try {\n    bar2(BlackHole, BadAddress, &Counter);\n  }\n  except((GetExceptionCode() == STATUS_ACCESS_VIOLATION)\n             ? EXCEPTION_EXECUTE_HANDLER\n             : EXCEPTION_CONTINUE_SEARCH) {\n    Counter -= 1;\n  }\n\n  if (Counter != 98) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // A try within an except\n  //\n\n  printf(\"    test12...\");\n  Counter = 0;\n  try {\n    foo1(STATUS_ACCESS_VIOLATION);\n  }\n  except((GetExceptionCode() == STATUS_ACCESS_VIOLATION)\n             ? EXCEPTION_EXECUTE_HANDLER\n             : EXCEPTION_CONTINUE_SEARCH) {\n    Counter += 1;\n    try {\n      foo1(STATUS_SUCCESS);\n    }\n    except((GetExceptionCode() == STATUS_SUCCESS) ? EXCEPTION_EXECUTE_HANDLER\n                                                  : EXCEPTION_CONTINUE_SEARCH) {\n      if (Counter != 1) {\n        printf(\"failed, count = %d\\n\", Counter);\n\n      } else {\n        printf(\"succeeded...\");\n      }\n\n      Counter += 1;\n    }\n  }\n\n  if (Counter != 2) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // A try within an except\n  //\n\n  printf(\"    test13...\");\n  Counter = 0;\n  try {\n    foo2(BlackHole, BadAddress);\n  }\n  except((GetExceptionCode() == STATUS_ACCESS_VIOLATION)\n             ? EXCEPTION_EXECUTE_HANDLER\n             : EXCEPTION_CONTINUE_SEARCH) {\n    Counter += 1;\n    try {\n      foo1(STATUS_SUCCESS);\n    }\n    except((GetExceptionCode() == STATUS_SUCCESS) ? EXCEPTION_EXECUTE_HANDLER\n                                                  : EXCEPTION_CONTINUE_SEARCH) {\n      if (Counter != 1) {\n        printf(\"failed, count = %d\\n\", Counter);\n\n      } else {\n        printf(\"succeeded...\");\n      }\n\n      Counter += 1;\n    }\n  }\n\n  if (Counter != 2) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n#if !defined(WIN_CE) // gotos from except/finally not allowed on WinCE\n  //\n  // A goto from an exception clause that needs to pass\n  // through a finally\n  //\n\n  printf(\"    test14...\");\n  Counter = 0;\n  try {\n    try {\n      foo1(STATUS_ACCESS_VIOLATION);\n    }\n    except((GetExceptionCode() == STATUS_ACCESS_VIOLATION)\n               ? EXCEPTION_EXECUTE_HANDLER\n               : EXCEPTION_CONTINUE_SEARCH) {\n      Counter += 1;\n      goto t9;\n    }\n  }\n  finally { Counter += 1; }\n\nt9:\n  ;\n  if (Counter != 2) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // A goto from an finally clause that needs to pass\n  // through a finally\n  //\n\n  printf(\"    test15...\");\n  Counter = 0;\n  try {\n    try {\n      Counter += 1;\n    }\n    finally {\n      Counter += 1;\n      goto t10;\n    }\n  }\n  finally { Counter += 1; }\n\nt10:\n  ;\n  if (Counter != 3) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // A goto from an exception clause that needs to pass\n  // through a finally into the outer finally clause.\n  //\n\n  printf(\"    test16...\");\n  Counter = 0;\n  try {\n    try {\n      try {\n        Counter += 1;\n        foo1(STATUS_INTEGER_OVERFLOW);\n      }\n      except(EXCEPTION_EXECUTE_HANDLER) {\n        Counter += 1;\n        goto t11;\n      }\n    }\n    finally { Counter += 1; }\n  t11:\n    ;\n  }\n  finally { Counter += 1; }\n\n  if (Counter != 4) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // A goto from an finally clause that needs to pass\n  // through a finally into the outer finally clause.\n  //\n\n  printf(\"    test17...\");\n  Counter = 0;\n  try {\n    try {\n      Counter += 1;\n    }\n    finally {\n      Counter += 1;\n      goto t12;\n    }\n  t12:\n    ;\n  }\n  finally { Counter += 1; }\n\n  if (Counter != 3) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // A return from an except clause\n  //\n\n  printf(\"    test18...\");\n  Counter = 0;\n  try {\n    Counter += 1;\n    eret(STATUS_ACCESS_VIOLATION, &Counter);\n  }\n  finally { Counter += 1; }\n\n  if (Counter != 4) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // A return from a finally clause\n  //\n\n  printf(\"    test19...\");\n  Counter = 0;\n  try {\n    Counter += 1;\n    fret(&Counter);\n  }\n  finally { Counter += 1; }\n\n  if (Counter != 5) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n#endif\n\n  //\n  // A simple set jump followed by a long jump.\n  //\n\n  printf(\"    test20...\");\n  Counter = 0;\n  if (setjmp(JumpBuffer) == 0) {\n    Counter += 1;\n    longjmp(JumpBuffer, 1);\n\n  } else {\n    Counter += 1;\n  }\n\n  if (Counter != 2) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // A set jump followed by a long jump out of a finally clause that is\n  // sequentially executed.\n  //\n\n  printf(\"    test21...\");\n  Counter = 0;\n  if (setjmp(JumpBuffer) == 0) {\n    try {\n      Counter += 1;\n    }\n    finally {\n      Counter += 1;\n      longjmp(JumpBuffer, 1);\n    }\n\n  } else {\n    Counter += 1;\n  }\n\n  if (Counter != 3) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // A set jump within a try clause followed by a long jump out of a\n  // finally clause that is sequentially executed.\n  //\n\n  printf(\"    test22...\");\n  Counter = 0;\n  try {\n    if (setjmp(JumpBuffer) == 0) {\n      Counter += 1;\n\n    } else {\n      Counter += 1;\n    }\n  }\n  finally {\n    Counter += 1;\n    if (Counter == 2) {\n      Counter += 1;\n      longjmp(JumpBuffer, 1);\n    }\n  }\n\n  if (Counter != 5) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // A set jump followed by a try/except, followed by a try/finally where\n  // the try body of the try/finally raises an exception that is handled\n  // by the try/excecpt which causes the try/finally to do a long jump out\n  // of a finally clause. This will create a collided unwind.\n  //\n\n  printf(\"    test23...\");\n  Counter = 0;\n  if (setjmp(JumpBuffer) == 0) {\n    try {\n      try {\n        Counter += 1;\n        RtlRaiseStatus(STATUS_INTEGER_OVERFLOW);\n      }\n      finally {\n        Counter += 1;\n        longjmp(JumpBuffer, 1);\n      }\n    }\n    except(EXCEPTION_EXECUTE_HANDLER) { Counter += 1; }\n\n  } else {\n    Counter += 1;\n  }\n\n  if (Counter != 3) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // A set jump followed by a try/except, followed by a several nested\n  // try/finally's where the inner try body of the try/finally raises an\n  // exception that is handled by the try/except which causes the\n  // try/finally to do a long jump out of a finally clause. This will\n  // create a collided unwind.\n  //\n\n  printf(\"    test24...\");\n  Counter = 0;\n  if (setjmp(JumpBuffer) == 0) {\n    try {\n      try {\n        try {\n          try {\n            Counter += 1;\n            RtlRaiseStatus(STATUS_INTEGER_OVERFLOW);\n          }\n          finally { Counter += 1; }\n        }\n        finally {\n          Counter += 1;\n          longjmp(JumpBuffer, 1);\n        }\n      }\n      finally { Counter += 1; }\n    }\n    except(EXCEPTION_EXECUTE_HANDLER) { Counter += 1; }\n\n  } else {\n    Counter += 1;\n  }\n\n  if (Counter != 5) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // A set jump followed by a try/except, followed by a try/finally which\n  // calls a subroutine which contains a try finally that raises an\n  // exception that is handled to the try/except.\n  //\n\n  printf(\"    test25...\");\n  Counter = 0;\n  if (setjmp(JumpBuffer) == 0) {\n    try {\n      try {\n        try {\n          Counter += 1;\n          dojump(JumpBuffer, &Counter);\n        }\n        finally { Counter += 1; }\n      }\n      finally { Counter += 1; }\n    }\n    except(EXCEPTION_EXECUTE_HANDLER) { Counter += 1; }\n\n  } else {\n    Counter += 1;\n  }\n\n  if (Counter != 7) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // A set jump followed by a try/except, followed by a try/finally which\n  // calls a subroutine which contains a try finally that raises an\n  // exception that is handled to the try/except.\n  //\n\n  printf(\"    test26...\");\n  Counter = 0;\n  if (setjmp(JumpBuffer) == 0) {\n    try {\n      try {\n        try {\n          try {\n            Counter += 1;\n            dojump(JumpBuffer, &Counter);\n          }\n          finally { Counter += 1; }\n        }\n        finally {\n          Counter += 1;\n          longjmp(JumpBuffer, 1);\n        }\n      }\n      finally { Counter += 1; }\n    }\n    except(EXCEPTION_EXECUTE_HANDLER) { Counter += 1; }\n\n  } else {\n    Counter += 1;\n  }\n\n  if (Counter != 8) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Test nested exceptions.\n  //\n\n  printf(\"    test27...\");\n  Counter = 0;\n  try {\n    try {\n      Counter += 1;\n      except1(&Counter);\n    }\n    except(except2(GetExceptionInformation(), &Counter)) { Counter += 2; }\n  }\n  except(EXCEPTION_EXECUTE_HANDLER) { Counter += 3; }\n\n  if (Counter != 55) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Simple try that causes an integer overflow exception.\n  //\n\n  printf(\"    test28...\");\n  Counter = 0;\n  try {\n    Counter += 1;\n    addtwo(0x7fff0000, 0x10000, &Counter);\n  }\n  except((GetExceptionCode() == STATUS_INTEGER_OVERFLOW)\n             ? EXCEPTION_EXECUTE_HANDLER\n             : EXCEPTION_CONTINUE_SEARCH) {\n    Counter += 1;\n  }\n\n  if (Counter != 2) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n//\n// Simple try that raises an misaligned data exception.\n//\n#if !defined(i386) && !defined(_M_IA64) && !defined(_M_AMD64) &&               \\\n    !defined(_M_ARM) && !defined(_M_ARM64)\n  printf(\"    test29...\");\n  Counter = 0;\n  try {\n    Counter += 1;\n    foo2(BlackHole, (PLONG)BadByte);\n  }\n  except((GetExceptionCode() == STATUS_DATATYPE_MISALIGNMENT)\n             ? EXCEPTION_EXECUTE_HANDLER\n             : EXCEPTION_CONTINUE_SEARCH) {\n    Counter += 1;\n  }\n\n  if (Counter != 2) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n#endif\n  //\n  // Continue from a try body with an exception clause in a loop.\n  //\n\n  printf(\"    test30...\");\n  Counter = 0;\n  for (Index1 = 0; Index1 < 10; Index1 += 1) {\n    try {\n      if ((Index1 & 0x1) == 0) {\n        continue;\n\n      } else {\n        Counter += 1;\n      }\n    }\n    except(EXCEPTION_EXECUTE_HANDLER) { Counter += 40; }\n\n    Counter += 2;\n  }\n\n  if (Counter != 15) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n#if !defined(WIN_CE) // gotos from try/finally not allowed on WinCE\n  //\n  // Continue from a try body with an finally clause in a loop.\n  //\n\n  printf(\"    test31...\");\n  Counter = 0;\n  for (Index1 = 0; Index1 < 10; Index1 += 1) {\n    try {\n      if ((Index1 & 0x1) == 0) {\n        continue;\n\n      } else {\n        Counter += 1;\n      }\n    }\n    finally { Counter += 2; }\n\n    Counter += 3;\n  }\n\n  if (Counter != 40) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n#endif\n\n  //\n  // Continue from doubly nested try body with an exception clause in a\n  // loop.\n  //\n\n  printf(\"    test32...\");\n  Counter = 0;\n  for (Index1 = 0; Index1 < 10; Index1 += 1) {\n    try {\n      try {\n        if ((Index1 & 0x1) == 0) {\n          continue;\n\n        } else {\n          Counter += 1;\n        }\n      }\n      except(EXCEPTION_EXECUTE_HANDLER) { Counter += 10; }\n\n      Counter += 2;\n    }\n    except(EXCEPTION_EXECUTE_HANDLER) { Counter += 20; }\n\n    Counter += 3;\n  }\n\n  if (Counter != 30) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n#if !defined(WIN_CE) // gotos from try/finally not allowed on WinCE\n  //\n  // Continue from doubly nested try body with an finally clause in a loop.\n  //\n\n  printf(\"    test33...\");\n  Counter = 0;\n  for (Index1 = 0; Index1 < 10; Index1 += 1) {\n    try {\n      try {\n        if ((Index1 & 0x1) == 0) {\n          continue;\n\n        } else {\n          Counter += 1;\n        }\n      }\n      finally { Counter += 2; }\n\n      Counter += 3;\n    }\n    finally { Counter += 4; }\n\n    Counter += 5;\n  }\n\n  if (Counter != 105) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Continue from a finally clause in a loop.\n  //\n\n  printf(\"    test34...\");\n  Counter = 0;\n  for (Index1 = 0; Index1 < 10; Index1 += 1) {\n    try {\n      if ((Index1 & 0x1) == 0) {\n        Counter += 1;\n      }\n    }\n    finally {\n      Counter += 2;\n      continue;\n    }\n\n    Counter += 4;\n  }\n\n  if (Counter != 25) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Continue from a doubly nested finally clause in a loop.\n  //\n\n  printf(\"    test35...\");\n  Counter = 0;\n  for (Index1 = 0; Index1 < 10; Index1 += 1) {\n    try {\n      try {\n        if ((Index1 & 0x1) == 0) {\n          Counter += 1;\n        }\n      }\n      finally {\n        Counter += 2;\n        continue;\n      }\n\n      Counter += 4;\n    }\n    finally { Counter += 5; }\n\n    Counter += 6;\n  }\n\n  if (Counter != 75) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Continue from a doubly nested finally clause in a loop.\n  //\n\n  printf(\"    test36...\");\n  Counter = 0;\n  for (Index1 = 0; Index1 < 10; Index1 += 1) {\n    try {\n      try {\n        if ((Index1 & 0x1) == 0) {\n          Counter += 1;\n        }\n      }\n      finally { Counter += 2; }\n\n      Counter += 4;\n    }\n    finally {\n      Counter += 5;\n      continue;\n    }\n\n    Counter += 6;\n  }\n\n  if (Counter != 115) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n#endif\n\n  //\n  // Break from a try body with an exception clause in a loop.\n  //\n\n  printf(\"    test37...\");\n  Counter = 0;\n  for (Index1 = 0; Index1 < 10; Index1 += 1) {\n    try {\n      if ((Index1 & 0x1) == 1) {\n        break;\n\n      } else {\n        Counter += 1;\n      }\n    }\n    except(EXCEPTION_EXECUTE_HANDLER) { Counter += 40; }\n\n    Counter += 2;\n  }\n\n  if (Counter != 3) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n#if !defined(WIN_CE) // gotos from try/finally not allowed on WinCE\n  //\n  // Break from a try body with an finally clause in a loop.\n  //\n\n  printf(\"    test38...\");\n  Counter = 0;\n  for (Index1 = 0; Index1 < 10; Index1 += 1) {\n    try {\n      if ((Index1 & 0x1) == 1) {\n        break;\n\n      } else {\n        Counter += 1;\n      }\n    }\n    finally { Counter += 2; }\n\n    Counter += 3;\n  }\n\n  if (Counter != 8) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n#endif\n\n  //\n  // Break from doubly nested try body with an exception clause in a\n  // loop.\n  //\n\n  printf(\"    test39...\");\n  Counter = 0;\n  for (Index1 = 0; Index1 < 10; Index1 += 1) {\n    try {\n      try {\n        if ((Index1 & 0x1) == 1) {\n          break;\n\n        } else {\n          Counter += 1;\n        }\n      }\n      except(EXCEPTION_EXECUTE_HANDLER) { Counter += 10; }\n\n      Counter += 2;\n    }\n    except(EXCEPTION_EXECUTE_HANDLER) { Counter += 20; }\n\n    Counter += 3;\n  }\n\n  if (Counter != 6) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n#if !defined(WIN_CE) // gotos from try/finally not allowed on WinCE\n  //\n  // Break from doubly nested try body with an finally clause in a loop.\n  //\n\n  printf(\"    test40...\");\n  Counter = 0;\n  for (Index1 = 0; Index1 < 10; Index1 += 1) {\n    try {\n      try {\n        if ((Index1 & 0x1) == 1) {\n          break;\n\n        } else {\n          Counter += 1;\n        }\n      }\n      finally { Counter += 2; }\n\n      Counter += 3;\n    }\n    finally { Counter += 4; }\n\n    Counter += 5;\n  }\n\n  if (Counter != 21) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Break from a finally clause in a loop.\n  //\n\n  printf(\"    test41...\");\n  Counter = 0;\n  for (Index1 = 0; Index1 < 10; Index1 += 1) {\n    try {\n      if ((Index1 & 0x1) == 1) {\n        Counter += 1;\n      }\n    }\n    finally {\n      Counter += 2;\n      break;\n    }\n\n    Counter += 4;\n  }\n\n  if (Counter != 2) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Break from a doubly nested finally clause in a loop.\n  //\n\n  printf(\"    test42...\");\n  Counter = 0;\n  for (Index1 = 0; Index1 < 10; Index1 += 1) {\n    try {\n      try {\n        if ((Index1 & 0x1) == 1) {\n          Counter += 1;\n        }\n      }\n      finally {\n        Counter += 2;\n        break;\n      }\n\n      Counter += 4;\n    }\n    finally { Counter += 5; }\n\n    Counter += 6;\n  }\n\n  if (Counter != 7) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Break from a doubly nested finally clause in a loop.\n  //\n\n  printf(\"    test43...\");\n  Counter = 0;\n  for (Index1 = 0; Index1 < 10; Index1 += 1) {\n    try {\n      try {\n        if ((Index1 & 0x1) == 1) {\n          Counter += 1;\n        }\n      }\n      finally { Counter += 2; }\n\n      Counter += 4;\n    }\n    finally {\n      Counter += 5;\n      break;\n    }\n\n    Counter += 6;\n  }\n\n  if (Counter != 11) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n#endif\n\n  //\n  // Break from a try body with an exception clause in a switch.\n  //\n\n  printf(\"    test44...\");\n  Counter = 0;\n  Index1 = 1;\n  switch (Index2) {\n  case BLUE:\n    Counter += 100;\n    break;\n\n  case RED:\n    try {\n      if ((Index1 & 0x1) == 1) {\n        break;\n\n      } else {\n        Counter += 1;\n      }\n    }\n    except(EXCEPTION_EXECUTE_HANDLER) { Counter += 40; }\n\n    Counter += 2;\n    break;\n  }\n\n  if (Counter != 0) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n#if !defined(WIN_CE) // gotos from try/finally not allowed on WinCE\n  //\n  // Break from a try body with an finally clause in a switch.\n  //\n\n  printf(\"    test45...\");\n  Counter = 0;\n  Index1 = 1;\n  switch (Index2) {\n  case BLUE:\n    Counter += 100;\n    break;\n\n  case RED:\n    try {\n      if ((Index1 & 0x1) == 1) {\n        break;\n\n      } else {\n        Counter += 1;\n      }\n    }\n    finally { Counter += 2; }\n\n    Counter += 3;\n  }\n\n  if (Counter != 2) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n#endif\n\n  //\n  // Break from doubly nested try body with an exception clause in a\n  // switch.\n  //\n\n  printf(\"    test46...\");\n  Counter = 0;\n  Index1 = 1;\n  switch (Index2) {\n  case BLUE:\n    Counter += 100;\n    break;\n\n  case RED:\n    try {\n      try {\n        if ((Index1 & 0x1) == 1) {\n          break;\n\n        } else {\n          Counter += 1;\n        }\n      }\n      except(EXCEPTION_EXECUTE_HANDLER) { Counter += 10; }\n\n      Counter += 2;\n    }\n    except(EXCEPTION_EXECUTE_HANDLER) { Counter += 20; }\n\n    Counter += 3;\n  }\n\n  if (Counter != 0) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n#if !defined(WIN_CE) // gotos from try/finally not allowed on WinCE\n  //\n  // Break from doubly nested try body with an finally clause in a switch.\n  //\n\n  printf(\"    test47...\");\n  Counter = 0;\n  Index1 = 1;\n  switch (Index2) {\n  case BLUE:\n    Counter += 100;\n    break;\n\n  case RED:\n    try {\n      try {\n        if ((Index1 & 0x1) == 1) {\n          break;\n\n        } else {\n          Counter += 1;\n        }\n      }\n      finally { Counter += 2; }\n\n      Counter += 3;\n    }\n    finally { Counter += 4; }\n\n    Counter += 5;\n  }\n\n  if (Counter != 6) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Break from a finally clause in a switch.\n  //\n\n  printf(\"    test48...\");\n  Counter = 0;\n  Index1 = 1;\n  switch (Index2) {\n  case BLUE:\n    Counter += 100;\n    break;\n\n  case RED:\n    try {\n      if ((Index1 & 0x1) == 1) {\n        Counter += 1;\n      }\n    }\n    finally {\n      Counter += 2;\n      break;\n    }\n\n    Counter += 4;\n  }\n\n  if (Counter != 3) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Break from a doubly nested finally clause in a switch.\n  //\n\n  printf(\"    test49...\");\n  Counter = 0;\n  Index1 = 1;\n  switch (Index2) {\n  case BLUE:\n    Counter += 100;\n    break;\n\n  case RED:\n    try {\n      try {\n        if ((Index1 & 0x1) == 1) {\n          Counter += 1;\n        }\n      }\n      finally {\n        Counter += 2;\n        break;\n      }\n\n      Counter += 4;\n    }\n    finally { Counter += 5; }\n\n    Counter += 6;\n  }\n\n  if (Counter != 8) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Break from a doubly nested finally clause in a switch.\n  //\n\n  printf(\"    test50...\");\n  Counter = 0;\n  Index1 = 1;\n  switch (Index2) {\n  case BLUE:\n    Counter += 100;\n    break;\n\n  case RED:\n    try {\n      try {\n        if ((Index1 & 0x1) == 1) {\n          Counter += 1;\n        }\n      }\n      finally { Counter += 2; }\n\n      Counter += 4;\n    }\n    finally {\n      Counter += 5;\n      break;\n    }\n\n    Counter += 6;\n  }\n\n  if (Counter != 12) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n#endif\n\n  //\n  // Leave from an if in a simple try/finally.\n  //\n\n  printf(\"    test51...\");\n  Counter = 0;\n  try {\n    if (Echo(Counter) == Counter) {\n      Counter += 3;\n      leave;\n\n    } else {\n      Counter += 100;\n    }\n  }\n  finally {\n    if (abnormal_termination() == FALSE) {\n      Counter += 5;\n    }\n  }\n\n  if (Counter != 8) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Leave from a loop in a simple try/finally.\n  //\n\n  printf(\"    test52...\");\n  Counter = 0;\n  try {\n    for (Index1 = 0; Index1 < 10; Index1 += 1) {\n      if (Echo(Index1) == Index1) {\n        Counter += 3;\n        leave;\n      }\n\n      Counter += 100;\n    }\n  }\n  finally {\n    if (abnormal_termination() == FALSE) {\n      Counter += 5;\n    }\n  }\n\n  if (Counter != 8) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Leave from a switch in a simple try/finally.\n  //\n\n  printf(\"    test53...\");\n  Counter = 0;\n  try {\n    switch (Index2) {\n    case BLUE:\n      break;\n\n    case RED:\n      Counter += 3;\n      leave;\n    }\n\n    Counter += 100;\n  }\n  finally {\n    if (abnormal_termination() == FALSE) {\n      Counter += 5;\n    }\n  }\n\n  if (Counter != 8) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Leave from an if in doubly nested try/finally followed by a leave\n  // from an if in the outer try/finally.\n  //\n\n  printf(\"    test54...\");\n  Counter = 0;\n  try {\n    try {\n      if (Echo(Counter) == Counter) {\n        Counter += 3;\n        leave;\n\n      } else {\n        Counter += 100;\n      }\n    }\n    finally {\n      if (abnormal_termination() == FALSE) {\n        Counter += 5;\n      }\n    }\n\n    if (Echo(Counter) == Counter) {\n      Counter += 3;\n      leave;\n\n    } else {\n      Counter += 100;\n    }\n  }\n  finally {\n    if (abnormal_termination() == FALSE) {\n      Counter += 5;\n    }\n  }\n\n  if (Counter != 16) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n#if !defined(WIN_CE) // leave from finally not allowed on WinCE\n  //\n  // Leave from an if in doubly nested try/finally followed by a leave\n  // from the finally of the outer try/finally.\n  //\n\n  printf(\"    test55...\");\n  Counter = 0;\n  try {\n    try {\n      if (Echo(Counter) == Counter) {\n        Counter += 3;\n        leave;\n\n      } else {\n        Counter += 100;\n      }\n    }\n    finally {\n      if (abnormal_termination() == FALSE) {\n        Counter += 5;\n        leave;\n      }\n    }\n\n    Counter += 100;\n  }\n  finally {\n    if (abnormal_termination() == FALSE) {\n      Counter += 5;\n    }\n  }\n\n  if (Counter != 13) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n#endif\n\n  //\n  // Try/finally within the except clause of a try/except that is always\n  // executed.\n  //\n\n  printf(\"    test56...\");\n  Counter = 0;\n  try {\n    Counter += 1;\n    RtlRaiseStatus(STATUS_INTEGER_OVERFLOW);\n  }\n  except(Counter) {\n    try {\n      Counter += 3;\n    }\n    finally {\n      if (abnormal_termination() == FALSE) {\n        Counter += 5;\n      }\n    }\n  }\n\n  if (Counter != 9) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Try/finally within the finally clause of a try/finally.\n  //\n\n  printf(\"    test57...\");\n  Counter = 0;\n  try {\n    Counter += 1;\n  }\n  finally {\n    if (abnormal_termination() == FALSE) {\n      try {\n        Counter += 3;\n      }\n      finally {\n        if (abnormal_termination() == FALSE) {\n          Counter += 5;\n        }\n      }\n    }\n  }\n\n  if (Counter != 9) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Try/except within the finally clause of a try/finally.\n  //\n\n  printf(\"    test58...\");\n#if !defined(NEST_IN_FINALLY)\n  printf(\"skipped\\n\");\n#else\n  Counter = 0;\n  try {\n    Counter -= 1;\n  }\n  finally {\n    try {\n      Counter += 2;\n      RtlRaiseStatus(STATUS_INTEGER_OVERFLOW);\n    }\n    except(Counter) {\n      try {\n        Counter += 3;\n      }\n      finally {\n        if (abnormal_termination() == FALSE) {\n          Counter += 5;\n        }\n      }\n    }\n  }\n\n  if (Counter != 9) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n#endif /* def(NEST_IN_FINALLY) */\n\n  //\n  // Try/except within the except clause of a try/except that is always\n  // executed.\n  //\n\n  printf(\"    test59...\");\n  Counter = 0;\n  try {\n    Counter += 1;\n    RtlRaiseStatus(STATUS_INTEGER_OVERFLOW);\n  }\n  except(Counter) {\n    try {\n      Counter += 3;\n      RtlRaiseStatus(STATUS_INTEGER_OVERFLOW);\n    }\n    except(Counter - 3) { Counter += 5; }\n  }\n\n  if (Counter != 9) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Try with a Try which exits the scope with a goto\n  //\n\n  printf(\"    test60...\");\n  Counter = 0;\n  try {\n    try {\n      goto outside;\n    }\n    except(1) { Counter += 1; }\n\n  outside:\n    RtlRaiseStatus(STATUS_INTEGER_OVERFLOW);\n  }\n  except(1) { Counter += 3; }\n\n  if (Counter != 3) {\n    printf(\"failed, count = %d\\n\", Counter);\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Try/except which gets an exception from a subfunction within\n  // a try/finally which has a try/except in the finally clause\n  //\n\n  printf(\"    test61...\");\n#if !defined(NEST_IN_FINALLY)\n  printf(\"skipped\\n\");\n#else\n  Counter = 0;\n  try {\n    Test61Part2(&Counter);\n  }\n  except(EXCEPTION_EXECUTE_HANDLER) { Counter += 11; }\n\n  if (Counter != 24) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n#endif /* def(NEST_IN_FINALLY) */\n\n  //\n  // Check for precision of exception on floating point\n  //\n\n  printf(\"    test62...\");\n\n#if defined(i386) || defined(_M_IA64) || defined(_M_ALPHA) || defined(_M_AMD64)\n\n/* enable floating point overflow */\n#if defined(i386)\n  _control87(_control87(0, 0) & ~EM_OVERFLOW, _MCW_EM);\n#else\n  //\n  // use portable version of _control87\n  //\n  _controlfp(_controlfp(0, 0) & ~EM_OVERFLOW, _MCW_EM);\n#endif\n\n  Counter = 0;\n  try {\n    doubleresult = SquareDouble(1.7e300);\n\n    try {\n      doubleresult = SquareDouble(1.0);\n    }\n    except(1) { Counter += 3; }\n  }\n  except(1) { Counter += 1; }\n\n  if (Counter != 1) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n/* clear up pending unmasked exceptions and restore FP control registers */\n#if defined(i386)\n  _clear87();\n  _control87(_control87(0, 0) | EM_OVERFLOW, 0xfffff);\n#else\n  _clearfp();\n  _controlfp(_controlfp(0, 0) | EM_OVERFLOW, 0xfffff);\n#endif\n\n#else\n  printf(\"skipped\\n\");\n#endif\n\n  //\n  // A try/finally inside a try/except where an exception is raised in the\n  // try/finally.\n  //\n\n  printf(\"    test63...\");\n  Counter = 0;\n  try {\n    try {\n      Counter += 1;\n    }\n    finally {\n      Counter += 3;\n      RtlRaiseStatus(STATUS_INTEGER_OVERFLOW);\n    }\n  }\n  except(1) { Counter += 6; }\n\n  if (Counter != 10) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // A try/finally inside a try/except where an exception is raised in the\n  // in the try/except and the try/finally.\n  //\n\n  printf(\"    test64...\");\n  Counter = 0;\n  try {\n    try {\n      Counter += 1;\n      RtlRaiseStatus(STATUS_INTEGER_OVERFLOW);\n    }\n    finally {\n      Counter += 3;\n      RtlRaiseStatus(STATUS_INTEGER_OVERFLOW);\n    }\n  }\n  except(1) { Counter += 6; }\n\n  if (Counter != 10) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // A try/finally inside a try/except where an exception is raised in the\n  // try/finally.\n  //\n\n  printf(\"    test65...\");\n  Counter = 0;\n  try {\n    try {\n      Counter += 1;\n    }\n    finally {\n      Counter += 3;\n      *BlackHole += *BadAddress;\n      Counter += 13;\n    }\n  }\n  except(1) { Counter += 6; }\n\n  if (Counter != 10) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // A try/finally inside a try/except where an exception is raised in the\n  // in the try/except and the try/finally.\n  //\n\n  printf(\"    test66...\");\n  Counter = 0;\n  try {\n    try {\n      Counter += 1;\n      *BlackHole += *BadAddress;\n      Counter += 13;\n    }\n    finally {\n      Counter += 3;\n      *BlackHole += *BadAddress;\n      Counter += 13;\n    }\n  }\n  except(1) { Counter += 6; }\n\n  if (Counter != 10) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // A try/finally inside a try/finally inside a try/except where an\n  // exception is raised in the in the try/except and in try/finally.\n  //\n\n  printf(\"    test67...\");\n  try {\n    try {\n      *BlackHole += *BadAddress;\n    }\n    finally {\n      try {\n        Counter = 0;\n      }\n      finally {\n        if (Counter != 0) {\n          Counter += 1;\n        }\n      }\n\n      Counter += 1;\n      *BlackHole += *BadAddress;\n    }\n  }\n  except(1) { Counter += 1; }\n\n  if (Counter != 2) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // A try/finally inside a try/finally inside a try/except where an\n  // exception is raised in the in the try/except and in try/finally.\n  //\n\n  printf(\"    test68...\");\n  try {\n    try {\n      RtlRaiseStatus(STATUS_INTEGER_OVERFLOW);\n    }\n    finally {\n      try {\n        Counter = 0;\n      }\n      finally {\n        if (Counter != 0) {\n          Counter += 1;\n        }\n      }\n\n      Counter += 1;\n      RtlRaiseStatus(STATUS_INTEGER_OVERFLOW);\n    }\n  }\n  except(1) { Counter += 1; }\n\n  if (Counter != 2) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n//\n// Patch guard test 69.\n//\n\n#if defined(_AMD64_) || defined(_X86_)\n\n  printf(\"    test69...\");\n  Counter = 0;\n  try {\n    PgTest69(&Counter, BadAddress);\n  }\n  except(EXCEPTION_EXECUTE_HANDLER) { printf(\"unexpected exception...\"); }\n\n  if (Counter != 2) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  printf(\"    test70...\");\n  Counter = 0;\n  try {\n    PgTest70(&Counter, BadAddress);\n  }\n  except(EXCEPTION_EXECUTE_HANDLER) { printf(\"unexpected exception...\"); }\n\n  if (Counter != 2) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  printf(\"    test71...\");\n  Counter = 0;\n  try {\n    PgTest71(&Counter, BadAddress);\n  }\n  except(EXCEPTION_EXECUTE_HANDLER) { printf(\"unexpected exception...\"); }\n\n  if (Counter != 9) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  printf(\"    test72...\");\n  Counter = 0;\n  try {\n    PgTest72(&Counter, BadAddress);\n  }\n  except(EXCEPTION_EXECUTE_HANDLER) { printf(\"unexpected exception...\"); }\n\n  if (Counter != 12) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  printf(\"    test73...\");\n  Counter = 0;\n  try {\n    PgTest73(&Counter, BadAddress);\n  }\n  except(EXCEPTION_EXECUTE_HANDLER) { printf(\"unexpected exception...\"); }\n\n  if (Counter != 15) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  printf(\"    test74...\");\n  Counter = 0;\n  try {\n    PgTest74(&Counter, BadAddress);\n  }\n  except(EXCEPTION_EXECUTE_HANDLER) { printf(\"unexpected exception...\"); }\n\n  if (Counter != 18) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  printf(\"    test75...\");\n  Counter = 0;\n  try {\n    PgTest75(&Counter, BadAddress);\n  }\n  except(EXCEPTION_EXECUTE_HANDLER) { printf(\"unexpected exception...\"); }\n\n  if (Counter != 35) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  printf(\"    test76...\");\n  Counter = 0;\n  try {\n    PgTest76(&Counter, BadAddress);\n  }\n  except(EXCEPTION_EXECUTE_HANDLER) { printf(\"unexpected exception...\"); }\n\n  if (Counter != 40) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  printf(\"    test77...\");\n  Counter = 0;\n  try {\n    PgTest77(&Counter, BadAddress);\n  }\n  except(EXCEPTION_EXECUTE_HANDLER) { printf(\"unexpected exception...\"); }\n\n  if (Counter != 45) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  printf(\"    test78...\");\n  Counter = 0;\n  try {\n    PgTest78(&Counter, BadAddress);\n  }\n  except(EXCEPTION_EXECUTE_HANDLER) { printf(\"unexpected exception...\"); }\n\n  if (Counter != 50) {\n    printf(\"failed, count = %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n#else\n  printf(\"    test69...filter entered...succeeded\\n\");\n  printf(\"    test70...filter entered...succeeded\\n\");\n  printf(\"    test71...filter entered...succeeded\\n\");\n  printf(\"    test72...filter entered...succeeded\\n\");\n  printf(\"    test73...filter entered...succeeded\\n\");\n  printf(\"    test74...filter entered...succeeded\\n\");\n  printf(\"    test75...filter entered...succeeded\\n\");\n  printf(\"    test76...filter entered...succeeded\\n\");\n  printf(\"    test77...filter entered...succeeded\\n\");\n  printf(\"    test78...filter entered...succeeded\\n\");\n#endif\n\n  if (LOBYTE(LOWORD(GetVersion())) < 6) {\n    printf(\"    test79...\");\n    printf(\"filter 1...filter 2...finally 1...filter 1...filter 2...finally \"\n           \"2...passed\\n\");\n  } else {\n\n    printf(\"    test79...\");\n    Counter = 0;\n    try {\n      Test79(&Counter, BadAddress);\n    }\n    except(printf(\"filter 2...\"), EXCEPTION_EXECUTE_HANDLER) { Counter += 1; }\n\n    if (Counter == 3) {\n      printf(\"passed\\n\");\n\n    } else {\n      printf(\"failed  %d \\n\", Counter);\n    }\n  }\n\n  printf(\"    test80...\");\n  if (Test80() != 0) {\n    printf(\"failed\\n\");\n\n  } else {\n    printf(\"passed\\n\");\n  }\n\n  printf(\"    test81...\");\n  Counter = 0;\n  Test81(&Counter);\n  if (Counter != 1) {\n    printf(\"failed  %d \\n\", Counter);\n\n  } else {\n    printf(\"passed\\n\");\n  }\n\n  printf(\"    test82...\");\n  Counter = 1;\n  Test82(&Counter);\n  if (Counter != 0) {\n    printf(\"failed\\n\");\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  printf(\"    test83...\");\n  if (Test83() != 0) {\n    printf(\"failed\\n\");\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  printf(\"    test84...\");\n  Counter = 0;\n  Test84(&Counter);\n  if (Counter != 2) {\n    printf(\"failed\\n\");\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  printf(\"    test85...\");\n  Counter = 0;\n  Test85(&Counter);\n  if (Counter != 7) {\n    printf(\"failed\\n\");\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  printf(\"    test86...\");\n  Counter = 0;\n  Test86(&Counter);\n  if (Counter != 4) {\n    printf(\"failed %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  printf(\"    test87...\");\n  Counter = 0;\n  Test87(&Counter);\n  if (Counter != 104) {\n    printf(\"failed %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  printf(\"    test88...\");\n  Counter = 0;\n  Test88(&Counter);\n  if (Counter != 6) {\n    printf(\"failed %d\\n\", Counter);\n\n  } else {\n    printf(\"succeeded\\n\");\n  }\n\n  //\n  // Announce end of exception test.\n  //\n\n  printf(\"End of exception test\\n\");\n  return;\n}\n\n#pragma optimize(\"a\", off)\nVOID addtwo(long First, long Second, long *Place)\n\n{\n\n  RtlRaiseStatus(STATUS_INTEGER_OVERFLOW);\n  *Place = First + Second;\n  return;\n}\n#pragma optimize(\"\", on)\n\nVOID bar1(IN NTSTATUS Status, IN PLONG Counter) {\n\n  try {\n    foo1(Status);\n  }\n  finally {\n    if (abnormal_termination() != FALSE) {\n      *Counter = 99;\n\n    } else {\n      *Counter = 100;\n    }\n  }\n\n  return;\n}\n\nVOID bar2(IN PLONG BlackHole, IN PLONG BadAddress, IN PLONG Counter) {\n\n  try {\n    foo2(BlackHole, BadAddress);\n  }\n  finally {\n    if (abnormal_termination() != FALSE) {\n      *Counter = 99;\n\n    } else {\n      *Counter = 100;\n    }\n  }\n\n  return;\n}\n\nVOID dojump(IN jmp_buf JumpBuffer, IN PLONG Counter)\n\n{\n\n  try {\n    try {\n      *Counter += 1;\n      RtlRaiseStatus(STATUS_INTEGER_OVERFLOW);\n    }\n    finally { *Counter += 1; }\n  }\n  finally {\n    *Counter += 1;\n    longjmp(JumpBuffer, 1);\n  }\n}\n\n#if !defined(WIN_CE) // return through finally not allowed on WinCE\nVOID eret(IN NTSTATUS Status, IN PLONG Counter)\n\n{\n\n  try {\n    try {\n      foo1(Status);\n    }\n    except((GetExceptionCode() == Status) ? EXCEPTION_EXECUTE_HANDLER\n                                          : EXCEPTION_CONTINUE_SEARCH) {\n      *Counter += 1;\n      return;\n    }\n  }\n  finally { *Counter += 1; }\n\n  return;\n}\n#endif\n\nVOID except1(IN PLONG Counter)\n\n{\n\n  try {\n    *Counter += 5;\n    RtlRaiseStatus(STATUS_INTEGER_OVERFLOW);\n  }\n  except(except3(GetExceptionInformation(), Counter)) { *Counter += 7; }\n\n  *Counter += 9;\n  return;\n}\n\nULONG\nexcept2(IN PEXCEPTION_POINTERS ExceptionPointers, IN PLONG Counter)\n\n{\n\n  PEXCEPTION_RECORD ExceptionRecord;\n\n  ExceptionRecord = ExceptionPointers->ExceptionRecord;\n  if ((ExceptionRecord->ExceptionCode == STATUS_UNSUCCESSFUL) &&\n      ((ExceptionRecord->ExceptionFlags & EXCEPTION_NESTED_CALL) == 0)) {\n    *Counter += 11;\n    return EXCEPTION_EXECUTE_HANDLER;\n\n  } else {\n    *Counter += 13;\n    return EXCEPTION_CONTINUE_SEARCH;\n  }\n}\n\nULONG\nexcept3(IN PEXCEPTION_POINTERS ExceptionPointers, IN PLONG Counter)\n\n{\n\n  PEXCEPTION_RECORD ExceptionRecord;\n\n  ExceptionRecord = ExceptionPointers->ExceptionRecord;\n  if ((ExceptionRecord->ExceptionCode == STATUS_INTEGER_OVERFLOW) &&\n      ((ExceptionRecord->ExceptionFlags & EXCEPTION_NESTED_CALL) == 0)) {\n    *Counter += 17;\n    RtlRaiseStatus(STATUS_UNSUCCESSFUL);\n\n  } else if ((ExceptionRecord->ExceptionCode == STATUS_UNSUCCESSFUL) &&\n             ((ExceptionRecord->ExceptionFlags & EXCEPTION_NESTED_CALL) != 0)) {\n    *Counter += 19;\n    return EXCEPTION_CONTINUE_SEARCH;\n  }\n\n  *Counter += 23;\n  return EXCEPTION_EXECUTE_HANDLER;\n}\n\nVOID foo1(IN NTSTATUS Status)\n\n{\n\n  //\n  // Raise exception.\n  //\n\n  RtlRaiseStatus(Status);\n  return;\n}\n\nVOID foo2(IN PLONG BlackHole, IN PLONG BadAddress)\n\n{\n\n  //\n  // Raise exception.\n  //\n\n  *BlackHole += *BadAddress;\n  return;\n}\n\n#if !defined(WIN_CE) // return from finally not allowed on WinCE\nVOID fret(IN PLONG Counter)\n\n{\n\n  try {\n    try {\n      *Counter += 1;\n    }\n    finally {\n      *Counter += 1;\n      return;\n    }\n  }\n  finally { *Counter += 1; }\n\n  return;\n}\n#endif\n\nLONG Echo(IN LONG Value)\n\n{\n  return Value;\n}\n\n#if defined(NEST_IN_FINALLY)\nVOID Test61Part2(IN OUT PULONG Counter) {\n  try {\n    *Counter -= 1;\n    RtlRaiseStatus(STATUS_INTEGER_OVERFLOW);\n  }\n  finally {\n    try {\n      *Counter += 2;\n      RtlRaiseStatus(STATUS_INTEGER_OVERFLOW);\n    }\n    except(EXCEPTION_EXECUTE_HANDLER) { *Counter += 5; }\n    *Counter += 7;\n  }\n}\n#endif /* def(NEST_IN_FINALLY) */\n\ndouble SquareDouble(IN double op) {\n  return exp(2.0 * log(op));\n}\n"},{"language": "pascal","value": "program GreetingsNumberOfTimes;\n\n{$APPTYPE CONSOLE}\n\n{$R *.res}\n\nuses\n  System.SysUtils;\n\nvar\n  greetingsMessage: string;\n  numberOfTimes, i: integer;\n\nbegin\n  try\n    { TODO -oUser -cConsole Main : Insert code here }\n    greetingsMessage := 'Hello World!';\n    numberOfTimes := 10;\n\n    for i := 1 to numberOfTimes do\n    begin\n      Writeln(greetingsMessage);\n    end;\n  except\n    on E: Exception do\n      Writeln(E.ClassName, ': ', E.Message);\n  end;\nend."}]
}

Index.js

通过父组件来接收值的更改

import React from 'react'
import EditorBody from './components/Editor-Body'
import SelectBox from './components/SelectBox'class Editor extends React.Component{constructor (props) {super(props);this.state = {language: '',theme: '',value: '',}}//通过子组件调用改变主题ChangeTheme(theme) {this.setState({theme: theme,});}//通过子组件调用改变语言ChangeLanguage(language){this.setState({language: language,});}//通过子组件调用改变显示内容ChangeValue(value){this.setState({value: value,});}render() {return(<div><SelectBoxChangeTheme={this.ChangeTheme.bind(this)}ChangeLanguage={this.ChangeLanguage.bind(this)}ChangeValue={this.ChangeValue.bind(this)}/><EditorBodyTheme={this.state.theme}Language={this.state.language}Value={this.state.value}/></div>)}
}export default Editor;

EditorBody.js

通过父组件将值传入 编辑器主题

import React from 'react';
import * as monaco from 'monaco-editor/esm/vs/editor/editor.main.js';
import 'monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution';
import 'monaco-editor/esm/vs/editor/contrib/find/findController.js';
import 'monaco-editor/esm/vs/editor/editor.worker.js'
import 'monaco-editor/esm/vs/language/typescript/ts.worker'
import './editor.css'class EditorBody extends React.Component {//输入创建编辑器需要的元素,语言,主题,编辑器的显示值Language;Theme;Value;constructor (props) {super(props);this.state = {monacoInstance: '',language: '',}}//创建编辑器componentDidMount() {const monacoInstance=monaco.editor.create(document.getElementById("monaco"),{value: this.props.Value,language: this.props.Language,theme: this.props.Theme,});this.setState({monacoInstance: monacoInstance,//记住当期语言language: this.props.Language,})}componentDidUpdate(prevProps, prevState, snapshot) {//monaco自带的接口,更改主题样式monaco.editor.setTheme(this.props.Theme);//判断语言是否改变if(this.state.language !== this.props.Language){//如果改变,销毁编辑器并重新创建新的编辑器this.state.monacoInstance.dispose();const newmonacoInstance=monaco.editor.create(document.getElementById("monaco"),{value: this.props.Value,language: this.props.Language,theme: this.props.Theme,});this.setState({monacoInstance: newmonacoInstance,language: this.props.Language,})}}//组件销毁前销毁编辑器componentWillUnmount() {this.state.monacoInstance.dispose();}render() {return (<div id="monaco" className="editor-body"></div>)}
}export default EditorBody;

总结

到这里就可以完成效果图的主体部分,如果还需要Monaco的其它功能的话,如代码提示功能

可以通过monaco-editor-webpack-plugin进行添加,Github网址,如基本的代码提示在webpack.config.js中添加

const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');

并在plugins下添加

new MonacoWebpackPlugin({languages:['apex', 'azcli', 'bat', 'clojure', 'coffee', 'cpp', 'csharp', 'csp', 'css', 'dockerfile', 'fsharp','go', 'handlebars', 'html', 'ini', 'java', 'javascript', 'json', 'less', 'lua', 'markdown', 'msdax', 'mysql','objective', 'perl', 'pgsql', 'php', 'postiats', 'powerquery', 'powershell', 'pug', 'python', 'r', 'razor','redis', 'redshift', 'ruby', 'rust', 'sb', 'scheme', 'scss', 'shell', 'solidity', 'sql', 'st', 'swift','typescript', 'vb', 'xml', 'yaml'],features:["coreCommands","find"]}),

这样就可以实现基本的代码提示功能,其他的功能可以查看官方API文档配合monaco-editor-webpack-plugin的Github网址进行尝试开发。通过官方的API接口你可以自定义编辑器的主题,monaco未实现语言的代码高亮支持。因为当前monaco只支持html、css、js、json的代码补全,所以官方也提供了接口让你可以自定义对其他语言的代码补全支持。

Reac16+Monaco打造代码编辑器(前端部分)相关推荐

  1. Vue3中使用Monaco Editor代码编辑器记录~持续更新

    Vue3中使用Monaco Editor代码编辑器记录-持续更新 因为毕设需要用到代码编辑器,根据调研,我选择使用monaco-editor代码编辑器 前端框架使用Vue3 + elementUI m ...

  2. android前端代码编辑器,前端程序员福利,6款轻量级富文本编辑器

    原标题:前端程序员福利,6款轻量级富文本编辑器 1.国产富文本编辑wangEditor 基于java和css开发的 Web富文本编辑器, 轻量.简洁.易用.开源免费,样式可自定义,菜单栏可以自定义配置 ...

  3. Vue中使用Monaco Editor代码编辑器

    一.安装依赖 npm install editor@1.0.0 npm install monaco-editor@0.19.3 npm install monaco-editor-webpack-p ...

  4. 前端程序员最爱用的8款代码编辑器,你用哪款?

    今天给大家分享8款前端程序员最爱用的代码编辑器,来看看你用哪款? 学编程从模仿开始,照书上一个字符一个字符的把代码敲进编辑器,编译,运行,输出"Hello word!".Fine, ...

  5. php什么设置前端代码,代码编辑器与PHPSTUDY的安装与配置过程(前端第一课)

    前端第一课:编辑器与PHPSTUDY的安装与配置过程 编辑器安装过程 1.Visual Studio Code 官网下载软件,解压下载文件,打开安装程序安装至你的计算机. 2.安装"Chin ...

  6. htmlplay前端编辑器下载_2019年最好用的代码编辑器推荐

    对于经常需要编写代码的程序员来说,拥有一款自己的编辑器是非常重要的事情,一款好用的代码编辑器往往能够让代码的编辑更加流畅,今天我们为大家带来最流行的代码编辑器 Sublime Text Sublime ...

  7. java在线编辑器_微软开源在线代码编辑器——Monaco Editor

    介绍 Monaco Editor是为VS Code提供支持的代码编辑器,运行在浏览器环境中.编辑器提供代码提示,智能建议等功能.供开发人员远程更方便的编写代码.移动浏览器或移动Web框架不支持Mona ...

  8. [转载] 用Tkinter打造GUI开发工具(45)用Tkinter做自己的中文代码编辑器

    参考链接: Python | 使用Tkinter的简单注册表格 用Tkinter打造GUI开发工具(45)用Tkinter做自己的中文代码编辑器 前面我们给了Tkinter接管Python输入和输出的 ...

  9. Ace,CodeMirror 和 Monaco:Web 代码编辑器的对比

    原文链接 Replit - Ace, CodeMirror, and Monaco: A Comparison of the Code Editors You Use in the Browser 我 ...

最新文章

  1. 写自己的CSS框架 Part2:跨越浏览器的reset
  2. 基于用户投票的排名算法Reddit
  3. 算法导论——贪心算法:哈夫曼编码(霍夫曼编码)
  4. Maven基础了解及配置信息
  5. 美国正面临“人才泡沫”破裂危机?
  6. python input函数无法输入字符串_Python手把手教程之用户输入input函数
  7. 如何将IntelliJ项目添加到GitHub
  8. group by rollup
  9. mysql-8.0.14zip怎么使用_mysql 8.0.14 安装配置方法图文教程(通用)
  10. 什么是TensorBoard?
  11. 阿里云智能基础产品事业部招聘高性能计算云产品研发与优化专家/高级专家
  12. Dagger2入门到放弃
  13. 在集体奋斗中实现自己的价值
  14. 【微信小程序】一文读懂页面导航
  15. Android字符设备驱动开发基于高通msm8916【原创 】
  16. 中国的美女为什么这样少的原因
  17. python如何画函数图像
  18. QQ开放平台QQ登录PHP代码
  19. 计算机类高水平文章,作为本科生的我,如何成功发表高水平会议论文
  20. android 组件透明,万能小组件透明小组件-万能小组件透明背景设置v1.0.0 安卓版_永辉资源网...

热门文章

  1. 基于PHP+MySQL汽车查询系统的设计与实现
  2. python数据处理用什么软件_数据分析都会用到哪些工具?
  3. 在 Windows 下用 GCC 编译器练习 C/C++ 的简单教程
  4. 越来越大的人使用计算机的原因,为什么越来越多的人喜欢用WPS这款电脑软件?这几点是关键原因...
  5. Excel PivotTable 使用心得手顺分享(一)
  6. Android10的WIFI 名称读取为空解决
  7. 如何利用Python编程批量处理Excel来提高日常工作效率!
  8. 小虎电商浏览器:拼多多蓝海词数据分析该怎么分析
  9. Jenkins RestAPI调用出现Error 403 No valid crumb was included in the request [亲测有用]
  10. Jenkins使用时,报No valid crumb was included in the request的解决方法