text:
from weixin import WeiXinClient

if __name__ == '__main__':
    wc = WeiXinClient('your_appid', 'your_secret', fc = True, path='/tmp')
    #"https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET"
    wc.request_access_token()

    data = '{"touser":"obMnLt3bf7t65jyEsa7vOtXphdu4", "msgtype":"text", "text":{ "content":"hello!"}}'
    #data = '{"touser":"obMnLt9Qx5ZfPdElO3DQblM7ksl0", "msgtype":"image", ' \
    #    '"image":{ "media_id":"OaPSe4DP-HF4s_ABWHEVDgMKOPCUoViID8x-yPUvwCfqTEA0whZOza4hGODiHs93"}}'
    key = '{"button":[{"type":"click","name":"test","key":"V1001_TEST"}]}'
    #"https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN"
    print wc.message.custom.send.post(body=data)
    #"https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN"
    print wc.user.info._get(openid='obMnLt43lgfeeC8Ljn4-cLixEW6Q', lang='zh_CN')
    #"https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN"
    print wc.message.custom.send.post(body=data)
    #"https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID"
    print wc.user.get._get(next_openid=None)
    #"http://file.api.weixin.qq.com/cgi-bin/media/upload?access_token=ACCESS_TOKEN&type=TYPE"
    print wc.media.upload.file(type='image', pic = open('./test.jpg', 'rb'))
    #"https://api.weixin.qq.com/cgi-bin/groups/create?access_token=ACCESS_TOKEN"
    print wc.groups.create.post(body='{"group":{"name":"test_group_01"}}')
    #"https://api.weixin.qq.com/cgi-bin/groups/update?access_token=ACCESS_TOKEN"
    print wc.groups.update.post(body='{"group":{"id":100,"name":"test"}}')
    #"https://api.weixin.qq.com/cgi-bin/groups/members/update?access_token=ACCESS_TOKEN"
    print wc.groups.members.update.post(body='{"openid":"obMnLt9Qx5ZfPdElO3DQblM7ksl0","to_groupid":100}')
    #"https://api.weixin.qq.com/cgi-bin/groups/getid?access_token=ACCESS_TOKEN"
    print wc.groups.getid.post(body='{"openid":"obMnLt9Qx5ZfPdElO3DQblM7ksl0"}')
    #"https://api.weixin.qq.com/cgi-bin/groups/get?access_token=ACCESS_TOKEN"
    print wc.groups.get._get()
    #"https://api.weixin.qq.com/cgi-bin/menu/create?access_token=ACCESS_TOKEN"
    print wc.menu.create.post(body=key)
    #"https://api.weixin.qq.com/cgi-bin/menu/get?access_token=ACCESS_TOKEN"
    print wc.menu.get._get()
    #"http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID"
    print wc.media.get.file(media_id='OaPSe4DP-HF4s_ABWHEVDgMKOPCUoViID8x-yPUvwCfqTEA0whZOza4hGODiHs93', base_path='/home/ubuntu/Pictures')

redpajama_set_name: RedPajamaGithub


text:
//
//  Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
//
//  Distributed under the Boost Software License, Version 1.0. (See
//  accompanying file LICENSE_1_0.txt or copy at
//  http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef NOWIDE_UTF_HPP_INCLUDED
#define NOWIDE_UTF_HPP_INCLUDED

#include <nowide/config.hpp>

#ifndef NOWIDE_MSVC
namespace nowide  {
namespace utf {
    typedef unsigned uint32_t;
    typedef unsigned short uint16_t;
    typedef unsigned char uint8_t;
}
}
#else
#include <stdint.h>
#endif

namespace nowide {
///
/// \brief Namespace that holds basic operations on UTF encoded sequences
///
/// All functions defined in this namespace do not require linking with Boost.Locale library
///
namespace utf {
    /// \cond INTERNAL
    #ifdef __GNUC__
    #   define NOWIDE_LIKELY(x)   __builtin_expect((x),1)
    #   define NOWIDE_UNLIKELY(x) __builtin_expect((x),0)
    #else
    #   define NOWIDE_LIKELY(x)   (x)
    #   define NOWIDE_UNLIKELY(x) (x)
    #endif
    /// \endcond

    ///
    /// \brief The integral type type that can hold a Unicode code point
    ///
    typedef uint32_t code_point;

    ///
    /// \brief Special constant that defines illegal code point
    ///
    static const code_point illegal = 0xFFFFFFFFu;

    ///
    /// \brief Special constant that defines incomplete code point
    ///
    static const code_point incomplete = 0xFFFFFFFEu;

    ///
    /// \brief the function checks if \a v is a valid code point
    ///
    inline bool is_valid_codepoint(code_point v)
    {
        if(v>0x10FFFF)
            return false;
        if(0xD800 <=v && v<= 0xDFFF) // surragates
            return false;
        return true;
    }

    #ifdef NOWIDE_DOXYGEN
    ///
    /// \brief UTF Traits class - functions to convert UTF sequences to and from Unicode code points
    ///
    template<typename CharType,int size=sizeof(CharType)>
    struct utf_traits {
        ///
        /// The type of the character
        ///
        typedef CharType char_type;
        ///
        /// Read one code point from the range [p,e) and return it.
        ///
        /// - If the sequence that was read is incomplete sequence returns \ref incomplete,
        /// - If illegal sequence detected returns \ref illegal
        ///
        /// Requirements
        ///
        /// - Iterator is valid input iterator
        ///
        /// Postconditions
        ///
        /// - p points to the last consumed character
        ///
        template<typename Iterator>
        static code_point decode(Iterator &p,Iterator e);

        ///
        /// Maximal width of valid sequence in the code units:
        ///
        /// - UTF-8  - 4
        /// - UTF-16 - 2
        /// - UTF-32 - 1
        ///
        static const int max_width;
        ///
        /// The width of specific code point in the code units.
        ///
        /// Requirement: value is a valid Unicode code point
        /// Returns value in range [1..max_width]
        ///
        static int width(code_point value);

        ///
        /// Get the size of the trail part of variable length encoded sequence.
        ///
        /// Returns -1 if C is not valid lead character
        ///
        static int trail_length(char_type c);
        ///
        /// Returns true if c is trail code unit, always false for UTF-32
        ///
        static bool is_trail(char_type c);
        ///
        /// Returns true if c is lead code unit, always true of UTF-32
        ///
        static bool is_lead(char_type c);

        ///
        /// Convert valid Unicode code point \a value to the UTF sequence.
        ///
        /// Requirements:
        ///
        /// - \a value is valid code point
        /// - \a out is an output iterator should be able to accept at least width(value) units
        ///
        /// Returns the iterator past the last written code unit.
        ///
        template<typename Iterator>
        static Iterator encode(code_point value,Iterator out);
        ///
        /// Decodes valid UTF sequence that is pointed by p into code point.
        ///
        /// If the sequence is invalid or points to end the behavior is undefined
        ///
        template<typename Iterator>
        static code_point decode_valid(Iterator &p);
    };

    #else

    template<typename CharType,int size=sizeof(CharType)>
    struct utf_traits;

    template<typename CharType>
    struct utf_traits<CharType,1> {

        typedef CharType char_type;

        static int trail_length(char_type ci)
        {
            unsigned char c = ci;
            if(c < 128)
                return 0;
            if(NOWIDE_UNLIKELY(c < 194))
                return -1;
            if(c < 224)
                return 1;
            if(c < 240)
                return 2;
            if(NOWIDE_LIKELY(c <=244))
                return 3;
            return -1;
        }

        static const int max_width = 4;

        static int width(code_point value)
        {
            if(value <=0x7F) {
                return 1;
            }
            else if(value <=0x7FF) {
                return 2;
            }
            else if(NOWIDE_LIKELY(value <=0xFFFF)) {
                return 3;
            }
            else {
                return 4;
            }
        }

        static bool is_trail(char_type ci)
        {
            unsigned char c=ci;
            return (c & 0xC0)==0x80;
        }

        static bool is_lead(char_type ci)
        {
            return !is_trail(ci);
        }

        template<typename Iterator>
        static code_point decode(Iterator &p,Iterator e)
        {
            if(NOWIDE_UNLIKELY(p==e))
                return incomplete;

            unsigned char lead = *p++;

            // First byte is fully validated here
            int trail_size = trail_length(lead);

            if(NOWIDE_UNLIKELY(trail_size < 0))
                return illegal;

            //
            // Ok as only ASCII may be of size = 0
            // also optimize for ASCII text
            //
            if(trail_size == 0)
                return lead;

            code_point c = lead & ((1<<(6-trail_size))-1);

            // Read the rest
            unsigned char tmp;
            switch(trail_size) {
            case 3:
                if(NOWIDE_UNLIKELY(p==e))
                    return incomplete;
                tmp = *p++;
                c = (c << 6) | ( tmp & 0x3F);
            case 2:
                if(NOWIDE_UNLIKELY(p==e))
                    return incomplete;
                tmp = *p++;
                c = (c << 6) | ( tmp & 0x3F);
            case 1:
                if(NOWIDE_UNLIKELY(p==e))
                    return incomplete;
                tmp = *p++;
                c = (c << 6) | ( tmp & 0x3F);
            }

            // Check code point validity: no surrogates and
            // valid range
            if(NOWIDE_UNLIKELY(!is_valid_codepoint(c)))
                return illegal;

            // make sure it is the most compact representation
            if(NOWIDE_UNLIKELY(width(c)!=trail_size + 1))
                return illegal;

            return c;

        }

        template<typename Iterator>
        static code_point decode_valid(Iterator &p)
        {
            unsigned char lead = *p++;
            if(lead < 192)
                return lead;

            int trail_size;

            if(lead < 224)
                trail_size = 1;
            else if(NOWIDE_LIKELY(lead < 240)) // non-BMP rare
                trail_size = 2;
            else
                trail_size = 3;

            code_point c = lead & ((1<<(6-trail_size))-1);

            switch(trail_size) {
            case 3:
                c = (c << 6) | ( static_cast<unsigned char>(*p++) & 0x3F);
            case 2:
                c = (c << 6) | ( static_cast<unsigned char>(*p++) & 0x3F);
            case 1:
                c = (c << 6) | ( static_cast<unsigned char>(*p++) & 0x3F);
            }

            return c;
        }

        template<typename Iterator>
        static Iterator encode(code_point value,Iterator out)
        {
            if(value <=0x7F) {
                *out++ = value;
            }
            else if(value <=0x7FF) {
                *out++=(value >> 6) | 0xC0;
                *out++=(value & 0x3F) | 0x80;
            }
            else if(NOWIDE_LIKELY(value <=0xFFFF)) {
                *out++=(value >> 12) | 0xE0;
                *out++=((value >> 6) & 0x3F) | 0x80;
                *out++=(value & 0x3F) | 0x80;
            }
            else {
                *out++=(value >> 18) | 0xF0;
                *out++=((value >> 12) & 0x3F) | 0x80;
                *out++=((value >> 6) & 0x3F) | 0x80;
                *out++=(value & 0x3F) | 0x80;
            }
            return out;
        }
    }; // utf8

    template<typename CharType>
    struct utf_traits<CharType,2> {
        typedef CharType char_type;

        // See RFC 2781
        static bool is_first_surrogate(uint16_t x)
        {
            return 0xD800 <=x && x<= 0xDBFF;
        }
        static bool is_second_surrogate(uint16_t x)
        {
            return 0xDC00 <=x && x<= 0xDFFF;
        }
        static code_point combine_surrogate(uint16_t w1,uint16_t w2)
        {
            return ((code_point(w1 & 0x3FF) << 10) | (w2 & 0x3FF)) + 0x10000;
        }
        static int trail_length(char_type c)
        {
            if(is_first_surrogate(c))
                return 1;
            if(is_second_surrogate(c))
                return -1;
            return 0;
        }
        ///
        /// Returns true if c is trail code unit, always false for UTF-32
        ///
        static bool is_trail(char_type c)
        {
            return is_second_surrogate(c);
        }
        ///
        /// Returns true if c is lead code unit, always true of UTF-32
        ///
        static bool is_lead(char_type c)
        {
            return !is_second_surrogate(c);
        }

        template<typename It>
        static code_point decode(It &current,It last)
        {
            if(NOWIDE_UNLIKELY(current == last))
                return incomplete;
            uint16_t w1=*current++;
            if(NOWIDE_LIKELY(w1 < 0xD800 || 0xDFFF < w1)) {
                return w1;
            }
            if(w1 > 0xDBFF)
                return illegal;
            if(current==last)
                return incomplete;
            uint16_t w2=*current++;
            if(w2 < 0xDC00 || 0xDFFF < w2)
                return illegal;
            return combine_surrogate(w1,w2);
        }
        template<typename It>
        static code_point decode_valid(It &current)
        {
            uint16_t w1=*current++;
            if(NOWIDE_LIKELY(w1 < 0xD800 || 0xDFFF < w1)) {
                return w1;
            }
            uint16_t w2=*current++;
            return combine_surrogate(w1,w2);
        }

        static const int max_width = 2;
        static int width(code_point u)
        {
            return u>=0x10000 ? 2 : 1;
        }
        template<typename It>
        static It encode(code_point u,It out)
        {
            if(NOWIDE_LIKELY(u<=0xFFFF)) {
                *out++ = u;
            }
            else {
                u-=0x10000;
                *out++=0xD800 | (u>>10);
                *out++=0xDC00 | (u & 0x3FF);
            }
            return out;
        }
    }; // utf16;

    template<typename CharType>
    struct utf_traits<CharType,4> {
        typedef CharType char_type;
        static int trail_length(char_type c)
        {
            if(is_valid_codepoint(c))
                return 0;
            return -1;
        }
        static bool is_trail(char_type /*c*/)
        {
            return false;
        }
        static bool is_lead(char_type /*c*/)
        {
            return true;
        }

        template<typename It>
        static code_point decode_valid(It &current)
        {
            return *current++;
        }

        template<typename It>
        static code_point decode(It &current,It last)
        {
            if(NOWIDE_UNLIKELY(current == last))
                return nowide::utf::incomplete;
            code_point c=*current++;
            if(NOWIDE_UNLIKELY(!is_valid_codepoint(c)))
                return nowide::utf::illegal;
            return c;
        }
        static const int max_width = 1;
        static int width(code_point /*u*/)
        {
            return 1;
        }
        template<typename It>
        static It encode(code_point u,It out)
        {
            *out++ = u;
            return out;
        }

    }; // utf32

    #endif

} // utf
} // nowide

#endif

// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = genStyles;
function genStyles() {
  return "\n    body.my-body {\n      padding: 0 !important,\n      margin: 0 !important,\n    }\n    canvas {\n      margin: 0 auto;\n      height: calc(100% - 20px) !important;\n      width: 100% !important;\n      background-color: white;\n    }\n    select{\n      background-color: #343434;\n      color: white;\n      padding: 20px;\n      font-size: 40px;\n      width: 200px;\n    }\n  ";
}


text:
package org.springframework.boot.gradle.tasks.aot;

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

import org.gradle.api.file.DirectoryProperty;
import org.gradle.api.provider.Property;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.JavaExec;
import org.gradle.api.tasks.OutputDirectory;
import org.gradle.work.DisableCachingByDefault;

/**
 * Specialization of {@link JavaExec} to be used as a base class for tasks that perform
 * ahead-of-time processing.
 *
 * @author Andy Wilkinson
 * @since 3.0.0
 */
@DisableCachingByDefault(because = "Cacheability can only be determined by a concrete implementation")
public abstract class AbstractAot extends JavaExec {

	private final DirectoryProperty sourcesDir;

	private final DirectoryProperty resourcesDir;

	private final DirectoryProperty classesDir;

	private final Property<String> groupId;

	private final Property<String> artifactId;

	protected AbstractAot() {
		this.sourcesDir = getProject().getObjects().directoryProperty();
		this.resourcesDir = getProject().getObjects().directoryProperty();
		this.classesDir = getProject().getObjects().directoryProperty();
		this.groupId = getProject().getObjects().property(String.class);
		this.artifactId = getProject().getObjects().property(String.class);
	}

	/**
	 * The group ID of the application that is to be processed ahead-of-time.
	 * @return the group ID property
	 */
	@Input
	public final Property<String> getGroupId() {
		return this.groupId;
	}

	/**
	 * The artifact ID of the application that is to be processed ahead-of-time.
	 * @return the artifact ID property
	 */
	@Input
	public final Property<String> getArtifactId() {
		return this.artifactId;
	}

	/**
	 * The directory to which AOT-generated sources should be written.
	 * @return the sources directory property
	 */
	@OutputDirectory
	public final DirectoryProperty getSourcesOutput() {
		return this.sourcesDir;
	}

	/**
	 * The directory to which AOT-generated resources should be written.
	 * @return the resources directory property
	 */
	@OutputDirectory
	public final DirectoryProperty getResourcesOutput() {
		return this.resourcesDir;
	}

	/**
	 * The directory to which AOT-generated classes should be written.
	 * @return the classes directory property
	 */
	@OutputDirectory
	public final DirectoryProperty getClassesOutput() {
		return this.classesDir;
	}

	List<String> processorArgs() {
		List<String> args = new ArrayList<>();
		args.add(getSourcesOutput().getAsFile().get().getAbsolutePath());
		args.add(getResourcesOutput().getAsFile().get().getAbsolutePath());
		args.add(getClassesOutput().getAsFile().get().getAbsolutePath());
		args.add(getGroupId().get());
		args.add(getArtifactId().get());
		args.addAll(super.getArgs());
		return args;
	}

}


text:
using System.IO;
using Autofac;
using Moq;
using NUnit.Framework;
using Orchard.Packaging.Services;
using Orchard.UI.Notify;

namespace Orchard.Tests.Modules.Packaging.Services {
    [TestFixture]
    public class FolderUpdaterTests {
        protected IContainer _container;

        private readonly string _basePath = Path.Combine(Path.GetTempPath(), "FolderUpdaterTests");

        [SetUp]
        public virtual void Init() {
            if (Directory.Exists(_basePath)) {
                Directory.Delete(_basePath, true);
            }

            Directory.CreateDirectory(_basePath);

            var builder = new ContainerBuilder();

            builder.RegisterType<FolderUpdater>().As<IFolderUpdater>();
            builder.RegisterInstance(new Mock<INotifier>().Object);

            _container = builder.Build();
        }

        [TestFixtureTearDown]
        public void Clean() {
            if (Directory.Exists(_basePath)) {
                Directory.Delete(_basePath, true);
            }
        }

        [Test]
        public void BackupTest() {
            DirectoryInfo sourceDirectoryInfo = Directory.CreateDirectory(Path.Combine(_basePath, "Source"));
            File.CreateText(Path.Combine(sourceDirectoryInfo.FullName, "file1.txt")).Close();
            File.CreateText(Path.Combine(sourceDirectoryInfo.FullName, "file2.txt")).Close();

            IFolderUpdater folderUpdater = _container.Resolve<IFolderUpdater>();

            DirectoryInfo targetDirectoryInfo = new DirectoryInfo(Path.Combine(_basePath, "Target"));
            folderUpdater.Backup(sourceDirectoryInfo, targetDirectoryInfo);

            Assert.That(File.Exists(Path.Combine(targetDirectoryInfo.FullName, "file1.txt")), Is.True);
            Assert.That(File.Exists(Path.Combine(targetDirectoryInfo.FullName, "file2.txt")), Is.True);
        }
    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Gard. Chron. ser. 3, 4:628. 1888

#### Original name
null

### Remarks
null


text:
source

Description found through definition


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.
namespace DoNotUse
{
    public class Program
    {
        public static int Main(string[] args) => 1;
    }
}


text:
<!doctype html>

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="author" content="M_Adnan" />

<title>Medical - Health Care, Clinic HTML5 Template</title>

<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
<link rel="icon" href="images/favicon.ico" type="image/x-icon">

<link rel="stylesheet" type="text/css" href="rs-plugin/css/settings.css" media="screen" />

<link rel="stylesheet" href="css/ionicons.min.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/responsive.css">

<link href="https://fonts.googleapis.com/css?family=Montserrat:100,200,300,400,500,600,700,800,900|Raleway:200,300,400,500,600,700,800,900" rel="stylesheet">

Welcome To Our Medical & Research Center

          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#nav-open-btn" aria-expanded="false">  </button>

 Home

Index Defult

Index Version 2

Index Version 3

Index Flex Slider

About

 Pages

 Home

Index Defult

Index Version 2

Index Version 3

Index Flex Slider

About Us

Services

Appointment

Doctors

Doctors Profile

 Gallery

Gallery

Gallery 2 Col

Gallery 4 Col

Gallery 5 Col

 Gallery Style 1

Gallery Style 1

Gallery Style 1 2 Col

Gallery Style 1 4 Col

Gallery Style 1 5 Col

Blog

Blog Single

Contact

Doctors

Appointment

Gallery

Blog

Contact

WE ARE MEDICAL

BLOG

Home

BLOG

Claritas est etiam processus dynamicus

Admin 97 563 Medical

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat

                Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat

We Craft Beautiful Website

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat

                Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat

                Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat

                Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat

                Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat

Share

Comment (37)

 JAMMIE LANDING 24.03.2015 at 10:21

"Quando feugait duo ei, te erant corpora interpretaris eos. Illud accommodare vituperatoribus an mea. Erat mazim animal
                          at nam, eam te doctus evertitur, sed decore ornatus"

                         REPLAY

 JAMMIE LANDING 24.03.2015 at 10:21

"Quando feugait duo ei, te erant corpora interpretaris eos. Illud accommodare vituperatoribus an mea. Erat mazim animal
                          at nam, eam te doctus evertitur, sed decore ornatus"

                         REPLAY

REPLY COMMENT

                <form>

                      *NAME
                        <input class="form-control" type="text" placeholder="">

                      *EMAIL ADDRESS
                        <input class="form-control" type="text" placeholder="">

                       WEBSITE
                        <input class="form-control" type="text" placeholder="">

                       SUBJECT
                        <input class="form-control" type="text" placeholder="">

                      <textarea placeholder="YOUR MESSAGE"></textarea>

                      <button type="submit" class="btn btn-dark">POST COMMENT </button>

                </form>

                  <input id="serch" type="search" class="input font-crimson" placeholder="Search..">
                  <button class="sea-icon"></button>

WHITE SHADOW WALKER

                Writer/Personal blog

Latest Articles

 Glamora Wallcoverings

Webdesign

 Anno 2205 Trailer

Webdesign

 The Lisbon Connection

Webdesign

Categories

Business

 Health

 Motion Graphic

 Conecpt Design

 Lifestyle

Archies

March 2015

Jan 2015

December 2015

November 2015

July 2015

Flickr Photo

WIDGET BLOCK

Bleecker Street Guilds

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Bleecker Street Guilds

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do ut labore et dolore magna aliqua.

TAGS CLOUD

FASHION

BAGS

TABLET

ELECTRONIC

BEAUTY

TRtENDING

SHOES

We work in a friendly and efficient using the latest technologies and sharing our expertise to make a diagnosis and implement cutting-edge therapies.

register newsletter

            <form>
              <input type="email"  placeholder="Enter your email here" required>
              <button type="submit"> Subscribe</button>
            </form>

Latest tweets

@medical Sweets and Bakers
                  WordPress Theme' on @EnvatoMarket by themefore http://t.co/we8Kf0

                 - Thursday March 9, 2017

@medical In hendrerit in molestie consequat in  http://t.co/we8Kf0

                 - Thursday March 9, 2017

@medical Duis autem vel eum iriure @medikal dolor in hendrerit in molestie consequat  http://t.co/we8Kf0

                 - Thursday March 9, 2017

Patient Guide

Choosing a doctor

 Health journals

 Insurance converage

 Talking to your doctor

 Medikal error

opening hours

Mon to Fri  8:00 am to 7:00pm

Sun & Sat 9:00 am to 5:00pm

© 2017 Medical. Made by M_ADNAN


text:
<include src="autocomplete_action_predictor.js">
<include src="resource_prefetch_predictor.js">

if (cr.isWindows)
  document.documentElement.setAttribute('os', 'win');

cr.ui.decorate('tabbox', cr.ui.TabBox);


text:
package org.jikesrvm.ppc;

import org.jikesrvm.ArchitectureSpecific;
import org.jikesrvm.VM;
import org.jikesrvm.classloader.RVMMethod;
import org.jikesrvm.compilers.common.assembler.ppc.Assembler;
import org.jikesrvm.compilers.common.assembler.ppc.AssemblerConstants;
import org.jikesrvm.objectmodel.ObjectModel;
import org.jikesrvm.runtime.Magic;
import org.jikesrvm.runtime.Memory;

/**
 * Generates a custom IMT-conflict resolution stub.
 * We create a binary search tree.
 */
public abstract class InterfaceMethodConflictResolver implements BaselineConstants, AssemblerConstants {

  // Create a conflict resolution stub for the set of interface method signatures l.
  //
  public static ArchitectureSpecific.CodeArray createStub(int[] sigIds, RVMMethod[] targets) {
    // (1) Create an assembler.
    int numEntries = sigIds.length;
    Assembler asm = new ArchitectureSpecific.Assembler(numEntries); // pretend each entry is a bytecode

    // (2) signatures must be in ascending order (to build binary search tree).
    if (VM.VerifyAssertions) {
      for (int i = 1; i < sigIds.length; i++) {
        VM._assert(sigIds[i - 1] < sigIds[i]);
      }
    }

    // (3) Assign synthetic bytecode numbers to each switch such that we'll generate them
    // in ascending order.  This lets us use the general forward branching mechanisms
    // of the Assembler.
    int[] bcIndices = new int[numEntries];
    assignBytecodeIndices(0, bcIndices, 0, numEntries - 1);

    // (4) Generate the stub.
    insertStubPrologue(asm);
    insertStubCase(asm, sigIds, targets, bcIndices, 0, numEntries - 1);

    ArchitectureSpecific.CodeArray stub = asm.makeMachineCode().getInstructions();

    // (5) synchronize icache with generated machine code that was written through dcache
    if (VM.runningVM) Memory.sync(Magic.objectAsAddress(stub), stub.length() << LG_INSTRUCTION_WIDTH);

    return stub;
  }

  // Assign ascending bytecode indices to each case (in the order they will be generated)
  private static int assignBytecodeIndices(int bcIndex, int[] bcIndices, int low, int high) {
    int middle = (high + low) / 2;
    bcIndices[middle] = bcIndex++;
    if (low == middle && middle == high) {
      return bcIndex;
    } else {
      // Recurse.
      if (low < middle) {
        bcIndex = assignBytecodeIndices(bcIndex, bcIndices, low, middle - 1);
      }
      if (middle < high) {
        bcIndex = assignBytecodeIndices(bcIndex, bcIndices, middle + 1, high);
      }
      return bcIndex;
    }
  }

  // Make a stub prologue: get TIB into S0
  // factor out to reduce code space in each call.
  //
  private static void insertStubPrologue(Assembler asm) {
    ObjectModel.baselineEmitLoadTIB((ArchitectureSpecific.Assembler) asm, S0, T0);
  }

  // Generate a subtree covering from low to high inclusive.
  private static void insertStubCase(Assembler asm, int[] sigIds, RVMMethod[] targets, int[] bcIndices, int low,
                                     int high) {
    int middle = (high + low) / 2;
    asm.resolveForwardReferences(bcIndices[middle]);
    if (low == middle && middle == high) {
      // a leaf case; can simply invoke the method directly.
      RVMMethod target = targets[middle];
      if (target.isStatic()) {
        // an error case.
        asm.emitLAddrToc(S0, target.getOffset());
      } else {
        asm.emitLAddrOffset(S0, S0, target.getOffset());
      }
      asm.emitMTCTR(S0);
      asm.emitBCCTR();
    } else {
      asm.emitCMPI(S1, sigIds[middle]);
      if (low < middle) {
        asm.emitShortBC(LT, 0, bcIndices[(low + middle - 1) / 2]);
      }
      if (middle < high) {
        asm.emitShortBC(GT, 0, bcIndices[(middle + 1 + high) / 2]);
      }
      // invoke the method for middle.
      RVMMethod target = targets[middle];
      if (target.isStatic()) {
        // an error case.
        asm.emitLAddrToc(S0, target.getOffset());
      } else {
        asm.emitLAddrOffset(S0, S0, target.getOffset());
      }
      asm.emitMTCTR(S0);
      asm.emitBCCTR();
      // Recurse.
      if (low < middle) {
        insertStubCase(asm, sigIds, targets, bcIndices, low, middle - 1);
      }
      if (middle < high) {
        insertStubCase(asm, sigIds, targets, bcIndices, middle + 1, high);
      }
    }
  }
}


text:
struct LoadingThread::Task
{
	int m_counter;
	LoadingTask* m_loadingTask;
};

LoadingThread* LoadingThread::s_singleton = NULL;
class LoadingThread::TaskQueue : public moodycamel::BlockingConcurrentQueue<Task> {};

LoadingThread::LoadingThread()
	:m_running(false)
{
	m_taskQueue = new TaskQueue();
	s_singleton = this;

	start();
}

LoadingThread::~LoadingThread()
{
	if (m_running)
		stop();

	delete m_taskQueue;
}

void LoadingThread::start()
{
	if (m_running)
		return;

	m_running = true;

	m_thread = std::thread(threadFunc, this);
}

void LoadingThread::stop()
{
	if (!m_running)
		return;

	m_running = false;
	Task task; // Dummy task for exit thread
	task.m_loadingTask = NULL;
	m_taskQueue->enqueue(task);
	m_thread.join();
}

void LoadingThread::pushTask(int counter, LoadingTask* loadingTask)
{
	Task task;
	task.m_counter = counter;
	task.m_loadingTask = loadingTask;

	m_taskQueue->enqueue(task);
}

LoadingThread::Task LoadingThread::pop()
{
	Task task;
	m_taskQueue->wait_dequeue(task);
	return task;
}

uint32_t LoadingThread::threadFunc(void* arg)
{
	LoadingThread* loadingThread = (LoadingThread*)arg;

	while (loadingThread->m_running)
	{
		Task task = loadingThread->pop();

		// SAVE TASKS
		if (task.m_loadingTask != NULL)
		{
			task.m_loadingTask->process();
		}
	}

	return 0;
}


text:
package alidayu_demo.entity;

/**
 * 消息队列实体类
 * @author Hank_
 *
Email:hicth_chan@163.com

 * @version 创建时间: 8 Sep 201609:16:16
 *
类说明:
 */
public class MessageQueue {

	/** 消息编号(格式:yyyyMMddHHmmssfff) */
	private String messageId;

	/** 消息类型(1为短信,2为语音) */
	private int messageType;

	/** 消息接收号码,短信类型可以是多个号码,语音类型只能是一个号码(多个号码使用逗号分隔) */
	private String recNum;

	/** 消息内容 */
	private String messageContent;

	/** 项目编号(暂定swift为1,其他项目依次累加1) */
	private int projectId;

	public String getMessageId() {
		return messageId;
	}

	public void setMessageId(String messageId) {
		this.messageId = messageId;
	}

	public int getMessageType() {
		return messageType;
	}

	public void setMessageType(int messageType) {
		this.messageType = messageType;
	}

	public String getRecNum() {
		return recNum;
	}

	public void setRecNum(String recNum) {
		this.recNum = recNum;
	}

	public String getMessageContent() {
		return messageContent;
	}

	public void setMessageContent(String messageContent) {
		this.messageContent = messageContent;
	}

	public int getProjectId() {
		return projectId;
	}

	public void setProjectId(int projectId) {
		this.projectId = projectId;
	}

	@Override
	public String toString() {
		return "MessageQueue [messageId=" + messageId + ", messageType=" + messageType + ", recNum=" + recNum
				+ ", messageContent=" + messageContent + ", projectId=" + projectId + "]";
	}

}


text:
Characters

<form>

		Name: <input type="text" ng-model="character.name">

		<button ng-click="editChar(character)">Edit</button>
		<button ng-click="deleteChar(character)">Delete</button>

	<button ng-click="addChar()">Add new character</button>
</form>

{{character.name}}

				<button ng-click="editBodyPart('Head')">HEAD</button>

				<button ng-click="editBodyPart('Left Arm')">LEFT ARM</button>
				<button ng-click="editBodyPart('Torso')">TORSO</button>
				<button ng-click="editBodyPart('Right Arm')">RIGHT ARM</button>

				<button ng-click="editBodyPart('Left Leg')">LEFT LEG</button>
				<button ng-click="editBodyPart('Right Leg')">RIGHT LEG</button>

		States
		<form>

				Name: <input type="text" ng-model="state.name">

				Active Conversation: <select ng-model="state.convo" ng-options="convo.id as convo.name for convo in getConvos()" >
    	<option value="">Select Convo</option>
		</select>

				<button ng-click="deleteState(character,state)">Delete</button>

			<button ng-click="addState(character)">Add new state</button>
		</form>

		Pick asset for: {{currBodyPart}}

	<button ng-click="closeBodyPart()">Close</button>


text:
namespace RDKit {
class ConformerException;
}
void rdExceptionTranslator(RDKit::ConformerException const& x);

#endif


text:
#ifndef PKCS12EXCEPTION_H_
#define PKCS12EXCEPTION_H_

#include "LibCryptoSecException.h"

class Pkcs12Exception : public LibCryptoSecException
{
public:
	Pkcs12Exception();
	virtual ~Pkcs12Exception() throw() {};

	enum ErrorCode
	{
		UNKNOWN,
		KEY_AND_CERT_DO_NOT_MATCH,
		PARSE_ERROR,
		MAC_VERIFY_FAILURE,
	};

	Pkcs12Exception(std::string where)
    {
    	this->where = where;
    	this->errorCode = Pkcs12Exception::UNKNOWN;
    }
    Pkcs12Exception(Pkcs12Exception::ErrorCode errorCode, std::string where)
    {
    	this->where = where;
    	this->errorCode = errorCode;
    }

	virtual std::string getMessage() const
	{
		return (Pkcs12Exception::errorCode2Message(this->errorCode));
	}

	virtual std::string toString() const
    {
    	std::string ret;
    	if (this->errorCode == Pkcs12Exception::UNKNOWN)
    	{
    		ret = "Pkcs12Exception. Called by: " + this->where + ".";
    	}
    	else
    	{
    		ret = "Pkcs12Exception: " + Pkcs12Exception::errorCode2Message(this->errorCode) + ". Called by: " + this->where + ".";
    	}
    	if (this->details != "")
    	{
    		ret += " More details:\n" + this->details + ".";
    	}
    	return ret;
    }

    virtual Pkcs12Exception::ErrorCode getErrorCode()
    {
    	return this->errorCode;
    }

    static std::string errorCode2Message(Pkcs12Exception::ErrorCode errorCode)
    {
    	std::string ret;
    	switch (errorCode)
    	{
    		case Pkcs12Exception::UNKNOWN:
    			ret = "Unknown error";
    			break;
    		case Pkcs12Exception::KEY_AND_CERT_DO_NOT_MATCH:
    			ret = "Key and certificate do not match";
    			break;
    		case Pkcs12Exception::MAC_VERIFY_FAILURE :
    			ret = "MAC verification failure";
    			break;
    		case Pkcs12Exception::PARSE_ERROR :
    			ret = "Parse error";
    			break;
    			//    		case Pkcs12Exception:::
    			//    			ret = "";
    			//    			break;
    			//    		case Pkcs12Exception:::
    			//    			ret = "";
    			//    			break;
    	}
    	return ret;
    }

protected:
	Pkcs12Exception::ErrorCode errorCode;
};

#endif /*PKCS12EXCEPTION_H_*/


text:
class GitNubWebView < WebView
  def awakeFromNib
    self.setUIDelegate(self)
    self.setPolicyDelegate(self)
  end

  def webView_dragDestinationActionMaskForDraggingInfo(view, info)
    WebDragDestinationActionLoad
  end

  def webView_dragSourceActionMaskForPoint(view, point)
    WebDragSourceActionLink
  end

  def performDragOperation(sender)
    # str = sender.draggingPasteboard.stringForType("NSStringPboardType")
    # puts NSURL.URLWithString(str).host
  end

  def webView_decidePolicyForNavigationAction_request_frame_decisionListener(webview, info, request, frame, listener)
    puts info['WebActionNavigationTypeKey']

    if info['WebActionNavigationTypeKey'].to_i == 0
      if request.URL.to_s =~ /^file:\/\//
        listener.use
      else
        listener.ignore
        NSWorkspace.sharedWorkspace.openURL(request.URL)
      end
    else
      listener.use
    end
  end
end


text:
namespace device {

CoreTimes::CoreTimes(const std::initializer_list<uint64_t>& times) {
  DCHECK_EQ(times.size(), 10u);

  size_t i = 0;
  for (auto value : times)
    times_[i++] = value;
}

void CoreTimes::set_user(uint64_t time) {
  if (times_[0] < time)
    times_[0] = time;
}

void CoreTimes::set_nice(uint64_t time) {
  if (times_[1] < time)
    times_[1] = time;
}

void CoreTimes::set_system(uint64_t time) {
  if (times_[2] < time)
    times_[2] = time;
}

void CoreTimes::set_idle(uint64_t time) {
  if (times_[3] < time)
    times_[3] = time;
}

void CoreTimes::set_iowait(uint64_t time) {
  if (times_[4] < time)
    times_[4] = time;
}

void CoreTimes::set_irq(uint64_t time) {
  if (times_[5] < time)
    times_[5] = time;
}

void CoreTimes::set_softirq(uint64_t time) {
  if (times_[6] < time)
    times_[6] = time;
}

void CoreTimes::set_steal(uint64_t time) {
  if (times_[7] < time)
    times_[7] = time;
}

void CoreTimes::set_guest(uint64_t time) {
  if (times_[8] < time)
    times_[8] = time;
}

void CoreTimes::set_guest_nice(uint64_t time) {
  if (times_[9] < time)
    times_[9] = time;
}

double CoreTimes::TimeUtilization(const CoreTimes& baseline) const {
  // Each of the blocks below consists of a check and a subtraction. The check
  // is used to bail on invalid input (/proc/stat counters should never
  // decrease over time).
  //
  // The check is also essential for the correctness of the subtraction -- the
  // result of the subtraction is stored in a temporary `uint64_t` before being
  // accumulated in `active_delta`, and this intermediate result must not be
  // negative.

  if (user() < baseline.user())
    return -1;
  double active_delta = user() - baseline.user();

  if (nice() < baseline.nice())
    return -1;
  active_delta += nice() - baseline.nice();

  if (system() < baseline.system())
    return -1;
  active_delta += system() - baseline.system();

  if (idle() < baseline.idle())
    return -1;
  uint64_t idle_delta = idle() - baseline.idle();

  // iowait() is unreliable, according to the Linux kernel documentation at
  // https://www.kernel.org/doc/Documentation/filesystems/proc.txt.

  if (irq() < baseline.irq())
    return -1;
  active_delta += irq() - baseline.irq();

  if (softirq() < baseline.softirq())
    return -1;
  active_delta += softirq() - baseline.softirq();

  if (steal() < baseline.steal())
    return -1;
  active_delta += steal() - baseline.steal();

  // guest() and guest_nice() are included in user(). Full analysis in
  // https://unix.stackexchange.com/a/303224/

  double total_delta = active_delta + idle_delta;
  if (total_delta == 0) {
    // The two snapshots represent the same point in time, so the time interval
    // between the two snapshots is empty.
    return -1;
  }

  return active_delta / total_delta;
}

}  // namespace device


text:
/*
 * Decompiled with CFR 0_79.
 *
 * Could not load the following classes:
 *  android.view.MotionEvent
 */
package org.anddev.andengine.input.touch.detector;

import android.view.MotionEvent;
import org.anddev.andengine.input.touch.TouchEvent;
import org.anddev.andengine.input.touch.detector.ScrollDetector;

public class SurfaceScrollDetector
extends ScrollDetector {
    public SurfaceScrollDetector(float f, ScrollDetector.IScrollDetectorListener iScrollDetectorListener) {
        super(f, iScrollDetectorListener);
    }

    public SurfaceScrollDetector(ScrollDetector.IScrollDetectorListener iScrollDetectorListener) {
        super(iScrollDetectorListener);
    }

    @Override
    protected float getX(TouchEvent touchEvent) {
        return touchEvent.getMotionEvent().getX();
    }

    @Override
    protected float getY(TouchEvent touchEvent) {
        return touchEvent.getMotionEvent().getY();
    }
}


text:
package com.darkhouse.gdefence.InventorySystem.inventory;

import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.ui.Window;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;

public class HidingClickListener extends ClickListener {

	private Actor actor;

	public HidingClickListener(Actor actor) {
		this.actor = actor;
	}

	@Override
	public void enter (InputEvent event, float x, float y, int pointer, Actor fromActor) {
//		Window window = (Window) actor;
//		window.setMovable(false);
	}

	@Override
	public void exit (InputEvent event, float x, float y, int pointer, Actor toActor) {
//		Window window = (Window) actor;
//		window.setMovable(true);
	}

	@Override
	public void clicked(InputEvent event, float x, float y) {
		actor.setVisible(false);
	}

}


text:
@class SplashViewController;
@protocol SplashViewControllerDelegate <NSObject>

@optional
- (void)splashWillPerform:(SplashViewController *)splashScreen;
- (void)splashDidPerform:(SplashViewController *)splashScreen;
@end

@interface SplashViewController : UIViewController

@property(nonatomic,weak)   id<SplashViewControllerDelegate>    delegate;

@property(nonatomic,strong) UIImage     *backgroundImage;

@property(nonatomic,copy)   void (^performanceBlock)(UIView *);//参数是stageView,在block里执行需要的操作。

@property(nonatomic,assign) CGFloat     delay; //performanceBlock执行完后多久退出

@end


text:
#include <string.h>
#include "HttpChunkedSplitter.h"

namespace mediakit{

const char *HttpChunkedSplitter::onSearchPacketTail(const char *data, int len) {
    auto pos = strstr(data,"\r\n");
    if(!pos){
        return nullptr;
    }
    return pos + 2;
}

void HttpChunkedSplitter::onRecvContent(const char *data, uint64_t len) {
    onRecvChunk(data,len - 2);
}

int64_t HttpChunkedSplitter::onRecvHeader(const char *data, uint64_t len) {
    string str(data,len - 2);
    int ret;
    sscanf(str.data(),"%X",&ret);
    return ret + 2;
}

}//namespace mediakit


text:
package org.apache.ignite.internal.processors.cache;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
import org.apache.ignite.binary.BinaryObject;
import org.apache.ignite.cache.affinity.AffinityFunction;
import org.apache.ignite.cache.affinity.AffinityKeyMapper;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.internal.IgniteClientDisconnectedCheckedException;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.processors.affinity.AffinityAssignment;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.affinity.GridAffinityAssignmentCache;
import org.apache.ignite.internal.util.future.GridFinishedFuture;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.lang.IgniteFuture;
import org.jetbrains.annotations.Nullable;

/**
 * Cache affinity manager.
 */
public class GridCacheAffinityManager extends GridCacheManagerAdapter {
    /** */
    private static final AffinityTopologyVersion LOC_CACHE_TOP_VER = new AffinityTopologyVersion(1);

    /** */
    private static final String FAILED_TO_FIND_CACHE_ERR_MSG = "Failed to find cache (cache was not started " +
        "yet or cache was already stopped): ";

    /** Affinity cached function. */
    private GridAffinityAssignmentCache aff;

    /** */
    private AffinityFunction affFunction;

    /** */
    private AffinityKeyMapper affMapper;

    /** {@inheritDoc} */
    @Override public void start0() throws IgniteCheckedException {
        affFunction = cctx.config().getAffinity();
        affMapper = cctx.config().getAffinityMapper();

        aff = new GridAffinityAssignmentCache(cctx.kernalContext(),
            cctx.name(),
            affFunction,
            cctx.config().getNodeFilter(),
            cctx.config().getBackups(),
            cctx.isLocal());
    }

    /** {@inheritDoc} */
    @Override protected void onKernalStart0() throws IgniteCheckedException {
        if (cctx.isLocal())
            // No discovery event needed for local affinity.
            aff.calculate(LOC_CACHE_TOP_VER, null, null);
    }

    /** {@inheritDoc} */
    @Override protected void onKernalStop0(boolean cancel) {
        cancelFutures();
    }

    /**
     *
     */
    public void cancelFutures() {
        if (!starting.get())
            // Ignoring attempt to stop manager that has never been started.
            return;

        IgniteCheckedException err =
            new IgniteCheckedException("Failed to wait for topology update, cache (or node) is stopping.");

        if (aff != null)
            aff.cancelFutures(err);
    }

    /** {@inheritDoc} */
    @Override public void onDisconnected(IgniteFuture reconnectFut) {
        IgniteCheckedException err = new IgniteClientDisconnectedCheckedException(reconnectFut,
            "Failed to wait for topology update, client disconnected.");

        if (aff != null)
            aff.cancelFutures(err);
    }

    /**
     *
     */
    public void onReconnected() {
        aff.onReconnected();
    }

    /** {@inheritDoc} */
    @Override protected void stop0(boolean cancel, boolean destroy) {
        aff = null;
    }

    /**
     * Gets affinity ready future, a future that will be completed after affinity with given
     * topology version is calculated.
     *
     * @param topVer Topology version to wait.
     * @return Affinity ready future.
     */
    public IgniteInternalFuture<AffinityTopologyVersion> affinityReadyFuture(long topVer) {
        return affinityReadyFuture(new AffinityTopologyVersion(topVer));
    }

    /**
     * Gets affinity ready future, a future that will be completed after affinity with given
     * topology version is calculated.
     *
     * @param topVer Topology version to wait.
     * @return Affinity ready future.
     */
    public IgniteInternalFuture<AffinityTopologyVersion> affinityReadyFuture(AffinityTopologyVersion topVer) {
        assert !cctx.isLocal();

        IgniteInternalFuture<AffinityTopologyVersion> fut = aff.readyFuture(topVer);

        return fut != null ? fut : new GridFinishedFuture<>(topVer);
    }

    /**
     * Gets affinity ready future that will be completed after affinity with given topology version is calculated.
     * Will return {@code null} if topology with given version is ready by the moment method is invoked.
     *
     * @param topVer Topology version to wait.
     * @return Affinity ready future or {@code null}.
     */
    @Nullable public IgniteInternalFuture<AffinityTopologyVersion> affinityReadyFuturex(AffinityTopologyVersion topVer) {
        assert !cctx.isLocal();

        return aff.readyFuture(topVer);
    }

    /**
     * @param topVer Topology version.
     * @return Affinity assignments.
     */
    public List<List<ClusterNode>> assignments(AffinityTopologyVersion topVer) {
        if (cctx.isLocal())
            topVer = LOC_CACHE_TOP_VER;

        return aff.assignments(topVer);
    }

    /**
     * @return Assignment.
     */
    public List<List<ClusterNode>> idealAssignment() {
        assert !cctx.isLocal();

        return aff.idealAssignment();
    }

    /**
     * @return Partition count.
     */
    public int partitions() {
        GridAffinityAssignmentCache aff0 = aff;

        if (aff0 == null)
            throw new IgniteException(FAILED_TO_FIND_CACHE_ERR_MSG + cctx.name());

        return aff0.partitions();
    }

    /**
     * @param key Key.
     * @return Partition.
     */
    public int partition(Object key) {
        return partition(key, true);
    }

    /**
     * NOTE: Use this method always when you need to calculate partition id for
     * a key provided by user. It's required since we should apply affinity mapper
     * logic in order to find a key that will eventually be passed to affinity function.
     *
     * @param key Key.
     * @param useKeyPart If {@code true} can use pre-calculated partition stored in KeyCacheObject.
     * @return Partition.
     */
    public int partition(Object key, boolean useKeyPart) {
        GridAffinityAssignmentCache aff0 = aff;

        if (aff0 == null)
            throw new IgniteException(FAILED_TO_FIND_CACHE_ERR_MSG + cctx.name());

        if (useKeyPart && (key instanceof KeyCacheObject)) {
            int part = ((KeyCacheObject)key).partition();

            if (part != -1)
                return part;
        }

        return affFunction.partition(affinityKey(key));
    }

    /**
     * If Key is {@link GridCacheInternal GridCacheInternal} entry when won't passed into user's mapper and
     * will use {@link GridCacheDefaultAffinityKeyMapper default}.
     *
     * @param key Key.
     * @return Affinity key.
     */
    public Object affinityKey(Object key) {
        if (key instanceof CacheObject && !(key instanceof BinaryObject))
            key = ((CacheObject)key).value(cctx.cacheObjectContext(), false);

        return (key instanceof GridCacheInternal ? cctx.defaultAffMapper() : affMapper).affinityKey(key);
    }

    /**
     * @param key Key.
     * @param topVer Topology version.
     * @return Affinity nodes.
     */
    public List<ClusterNode> nodesByKey(Object key, AffinityTopologyVersion topVer) {
        return nodesByPartition(partition(key), topVer);
    }

    /**
     * @param part Partition.
     * @param topVer Topology version.
     * @return Affinity nodes.
     */
    public List<ClusterNode> nodesByPartition(int part, AffinityTopologyVersion topVer) {
        if (cctx.isLocal())
            topVer = LOC_CACHE_TOP_VER;

        GridAffinityAssignmentCache aff0 = aff;

        if (aff0 == null)
            throw new IgniteException(FAILED_TO_FIND_CACHE_ERR_MSG + cctx.name());

        return aff0.nodes(part, topVer);
    }

    /**
     * Get affinity assignment for the given topology version.
     *
     * @param topVer Topology version.
     * @return Affinity assignment.
     */
    public AffinityAssignment assignment(AffinityTopologyVersion topVer) {
        if (cctx.isLocal())
            topVer = LOC_CACHE_TOP_VER;

        GridAffinityAssignmentCache aff0 = aff;

        if (aff0 == null)
            throw new IgniteException(FAILED_TO_FIND_CACHE_ERR_MSG + cctx.name());

        return aff0.cachedAffinity(topVer);
    }

    /**
     * @param key Key to check.
     * @param topVer Topology version.
     * @return Primary node for given key.
     */
    @Nullable public ClusterNode primaryByKey(Object key, AffinityTopologyVersion topVer) {
        return primaryByPartition(partition(key), topVer);
    }

    /**
     * @param part Partition.
     * @param topVer Topology version.
     * @return Primary node for given key.
     */
    @Nullable public ClusterNode primaryByPartition(int part, AffinityTopologyVersion topVer) {
        List<ClusterNode> nodes = nodesByPartition(part, topVer);

        if (nodes.isEmpty())
            return null;

        return nodes.get(0);
    }

    /**
     * @param n Node to check.
     * @param key Key to check.
     * @param topVer Topology version.
     * @return {@code True} if checked node is primary for given key.
     */
    public boolean primaryByKey(ClusterNode n, Object key, AffinityTopologyVersion topVer) {
        return F.eq(primaryByKey(key, topVer), n);
    }

    /**
     * @param n Node to check.
     * @param part Partition.
     * @param topVer Topology version.
     * @return {@code True} if checked node is primary for given partition.
     */
    public boolean primaryByPartition(ClusterNode n, int part, AffinityTopologyVersion topVer) {
        return F.eq(primaryByPartition(part, topVer), n);
    }

    /**
     * @param key Key to check.
     * @param topVer Topology version.
     * @return Backup nodes.
     */
    public Collection<ClusterNode> backupsByKey(Object key, AffinityTopologyVersion topVer) {
        return backupsByPartition(partition(key), topVer);
    }

    /**
     * @param part Partition.
     * @param topVer Topology version.
     * @return Backup nodes.
     */
    private Collection<ClusterNode> backupsByPartition(int part, AffinityTopologyVersion topVer) {
        List<ClusterNode> nodes = nodesByPartition(part, topVer);

        assert !F.isEmpty(nodes);

        if (nodes.size() == 1)
            return Collections.emptyList();

        return F.view(nodes, F.notEqualTo(nodes.get(0)));
    }

    /**
     * @param n Node to check.
     * @param part Partition.
     * @param topVer Topology version.
     * @return {@code True} if checked node is a backup node for given partition.
     */
    public boolean backupByPartition(ClusterNode n, int part, AffinityTopologyVersion topVer) {
        List<ClusterNode> nodes = nodesByPartition(part, topVer);

        assert !F.isEmpty(nodes);

        return nodes.indexOf(n) > 0;
    }

    /**
     * @param key Key to check.
     * @param topVer Topology version.
     * @return {@code true} if given key belongs to local node.
     */
    public boolean keyLocalNode(Object key, AffinityTopologyVersion topVer) {
        return partitionLocalNode(partition(key), topVer);
    }

    /**
     * @param part Partition number to check.
     * @param topVer Topology version.
     * @return {@code true} if given partition belongs to local node.
     */
    public boolean partitionLocalNode(int part, AffinityTopologyVersion topVer) {
        assert part >= 0 : "Invalid partition: " + part;

        return nodesByPartition(part, topVer).contains(cctx.localNode());
    }

    /**
     * @param node Node.
     * @param part Partition number to check.
     * @param topVer Topology version.
     * @return {@code true} if given partition belongs to specified node.
     */
    public boolean partitionBelongs(ClusterNode node, int part, AffinityTopologyVersion topVer) {
        assert node != null;
        assert part >= 0 : "Invalid partition: " + part;

        return nodesByPartition(part, topVer).contains(node);
    }

    /**
     * @param nodeId Node ID.
     * @param topVer Topology version to calculate affinity.
     * @return Partitions for which given node is primary.
     */
    public Set<Integer> primaryPartitions(UUID nodeId, AffinityTopologyVersion topVer) {
        if (cctx.isLocal())
            topVer = LOC_CACHE_TOP_VER;

        GridAffinityAssignmentCache aff0 = aff;

        if (aff0 == null)
            throw new IgniteException(FAILED_TO_FIND_CACHE_ERR_MSG + cctx.name());

        return aff0.primaryPartitions(nodeId, topVer);
    }

    /**
     * @param nodeId Node ID.
     * @param topVer Topology version to calculate affinity.
     * @return Partitions for which given node is backup.
     */
    public Set<Integer> backupPartitions(UUID nodeId, AffinityTopologyVersion topVer) {
        if (cctx.isLocal())
            topVer = LOC_CACHE_TOP_VER;

        GridAffinityAssignmentCache aff0 = aff;

        if (aff0 == null)
            throw new IgniteException(FAILED_TO_FIND_CACHE_ERR_MSG + cctx.name());

        return aff0.backupPartitions(nodeId, topVer);
    }

    /**
     * @return Affinity-ready topology version.
     */
    public AffinityTopologyVersion affinityTopologyVersion() {
        GridAffinityAssignmentCache aff0 = aff;

        if (aff0 == null)
            throw new IgniteException(FAILED_TO_FIND_CACHE_ERR_MSG + cctx.name());

        return aff0.lastVersion();
    }

    /**
     * Dumps debug information.
     */
    public void dumpDebugInfo() {
        GridAffinityAssignmentCache aff0 = aff;

        if (aff0 != null)
            aff0.dumpDebugInfo();
    }

    /**
     * @return Affinity cache.
     */
    public GridAffinityAssignmentCache affinityCache() {
        return aff;
    }

    /**
     * @param part Partition.
     * @param startVer Start version.
     * @param endVer End version.
     * @return {@code True} if primary changed or required affinity version not found in history.
     */
    public boolean primaryChanged(int part, AffinityTopologyVersion startVer, AffinityTopologyVersion endVer) {
        assert !cctx.isLocal() : cctx.name();

        GridAffinityAssignmentCache aff0 = aff;

        if (aff0 == null)
            throw new IgniteException(FAILED_TO_FIND_CACHE_ERR_MSG + cctx.name());

        return aff0.primaryChanged(part, startVer, endVer);
    }
}


text:
using System.Collections.Generic;

namespace SuperGlue.EventStore
{
    public interface IEventHandlerMappingStrategy
    {
        IEnumerable<IEventHandler> GetEventHandlers(object target);
    }
}


text:
package rcomic.utils;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

/** @author ray */
public class ThreadPool {
  public static final String TAG = ThreadPool.class.getSimpleName();
  public static final int DEFAULT_COUNT = 10;
  private ExecutorService pool;

  public ThreadPool(int count) {
    if (count <= 0) {
      throw new IllegalArgumentException("count <= 0, count=" + count);
    }

    pool = Executors.newFixedThreadPool(count);
  }

  public ThreadPool() {
    pool = Executors.newCachedThreadPool();
  }

  public void execute(Runnable run) {
    pool.execute(run);
  }

  public Future<?> submit(Runnable run) {
    return pool.submit(run);
  }

  public Future<?> submit(Callable<?> call) {
    return pool.submit(call);
  }

  public void executeTask(Runnable run) {
    pool.execute(run);
  }
}


text:
require 'spec_helper'

describe 'et_nginx::package' do
  before do
    stub_command('which nginx').and_return(nil)
  end

  let(:chef_run) do
    ChefSpec::SoloRunner.new(
      :platform => 'debian',
      :version => '7.0'
    ).converge(described_recipe)
  end

  shared_examples_for 'all platforms' do
    it 'includes the ohai_plugin recipe' do
      expect(chef_run).to include_recipe('et_nginx::ohai_plugin')
    end

    it 'includes the commons recipe' do
      expect(chef_run).to include_recipe('et_nginx::commons')
    end

    it 'enables the nginx service' do
      expect(chef_run).to enable_service('nginx')
    end
  end

  shared_examples_for 'nginx repo' do
    it 'includes the nginx repo recipe' do
      expect(chef_run).to include_recipe('et_nginx::repo')
    end
  end

  shared_examples_for 'package resource' do
    it 'installs the nginx package' do
      expect(chef_run).to install_package('nginx-extras')
    end
  end

  context 'default attributes' do
    it_behaves_like 'all platforms'
    it_behaves_like 'package resource'
  end

  context 'debian platform family' do
    context 'default attributes' do
      it_behaves_like 'all platforms'
      it_behaves_like 'package resource'
    end
  end
end


text:
\section{Glossary}\label{Glossary}

\textbf{\huge{B}}\\
\definizione{Bubble}
Interactive interface formed by graphical elements, functional elements and a memory. Its functionalities are based on the elements used to build the bubble.

\textbf{\huge{F}}\\
\definizione{Framework}
A framework is a platform for developing software applications. It provides a foundation on which software developers can build programs for a specific platform.

\textbf{\huge{N}}\\
\definizione{Node.js}
Node.js is an open-source, cross-platform JavaScript run-time environment for executing JavaScript code server-side.
Node.js uses npm as package ecosystem.

\definizione{Npm}
Npm is a package manager for JavaScript.

\textbf{\huge{R}}\\
\definizione{Rocket.Chat}
Open Source Web Chat platform that can be privately hosted to create communities and companies chat systems.


text:
<Record>
<Term>Decamethonium</Term>
<SemanticType>Pharmacologic Substance</SemanticType>
<SemanticType>Organic Chemical</SemanticType>
<ParentTerm>Muscle Relaxant</ParentTerm>
<ClassificationPath>Chemicals_and_Drugs_Kind/Drug, Food, Chemical or Biomedical Material/Pharmacologic Substance/Adjuvant/Muscle Relaxant/Decamethonium Bromide</ClassificationPath>
<BroaderTerm>Chemicals_and_Drugs_Kind</BroaderTerm>
<BroaderTerm>Pharmacologic Substance</BroaderTerm>
<BroaderTerm>Adjuvant</BroaderTerm>
<BroaderTerm>Decamethonium Bromide</BroaderTerm>
<BroaderTerm>Muscle Relaxant</BroaderTerm>
<BroaderTerm>Drug, Food, Chemical or Biomedical Material</BroaderTerm>
<Synonym>Syncurine</Synonym>
<Synonym>Decamethonium</Synonym>
<Synonym>Decamethonium bromide</Synonym>
<Synonym>Decamethonium Bromide</Synonym>
<Synonym>DECAMETHONIUM BROMIDE</Synonym>
<Source>FDA Registry</Source>
<Source>NCI Thesaurus</Source>
</Record>


text:
package org.realityforge.jeo.geolatte.jpa.eclipselink;

import java.lang.reflect.Field;
import java.util.Map;
import java.util.Vector;
import org.eclipse.persistence.descriptors.ClassDescriptor;
import org.eclipse.persistence.mappings.DatabaseMapping;
import org.eclipse.persistence.mappings.DirectToFieldMapping;
import org.eclipse.persistence.mappings.converters.Converter;
import org.eclipse.persistence.mappings.converters.SerializedObjectConverter;
import org.eclipse.persistence.sessions.Session;
import org.eclipse.persistence.sessions.SessionEvent;
import org.eclipse.persistence.sessions.SessionEventAdapter;
import org.geolatte.geom.Geometry;
import org.geolatte.geom.GeometryCollection;
import org.geolatte.geom.LineString;
import org.geolatte.geom.LinearRing;
import org.geolatte.geom.MultiLineString;
import org.geolatte.geom.MultiPoint;
import org.geolatte.geom.MultiPolygon;
import org.geolatte.geom.Point;
import org.geolatte.geom.Polygon;

public class GeolatteExtension
  extends SessionEventAdapter
{
  @Override
  public void preLogin( final SessionEvent event )
  {
    final Session session = event.getSession();

    boolean isSqlServer = false;
    boolean isPostgreSQL = false;

    final String geomDriver = (String) session.getProperty( "geolatte.geom.driver" );
    if ( null != geomDriver )
    {
      isSqlServer = geomDriver.equals( "sqlserver" );
      isPostgreSQL = geomDriver.equals( "postgres" );
    }
    else
    {
      final String driver = (String) session.getProperty( "javax.persistence.jdbc.driver" );
      if ( null != driver )
      {
        isSqlServer = driver.contains( ".jtds." );
        isPostgreSQL = driver.contains( "org.postgresql." );
      }
    }

    if ( !isSqlServer && !isPostgreSQL )
    {
      final String message =
        "Unable to determine database type. Explicitly set jpa " +
        "property 'geolatte.geom.driver' to 'sqlserver' or 'postgres'" ;
      throw new IllegalStateException( message );
    }

    final Map<Class, ClassDescriptor> descriptorMap = session.getDescriptors();

    // Walk through all descriptors...
    for ( final Map.Entry<Class, ClassDescriptor> entry : descriptorMap.entrySet() )
    {
      final ClassDescriptor desc = entry.getValue();
      final Vector<DatabaseMapping> mappings = desc.getMappings();
      // walk through all mappings for some class...
      for ( final DatabaseMapping mapping : mappings )
      {
        if ( mapping instanceof DirectToFieldMapping )
        {
          final DirectToFieldMapping dfm = (DirectToFieldMapping) mapping;
          if ( isCandidateConverter( dfm ) )
          {
            final Class type = entry.getKey();
            final String attributeName = dfm.getAttributeName();
            final Field field = getField( type, attributeName );
            final Class<?> fieldType = field.getType();
            if ( Point.class == fieldType ||
                 Polygon.class == fieldType ||
                 LinearRing.class == fieldType ||
                 LineString.class == fieldType ||
                 MultiPoint.class == fieldType ||
                 MultiPolygon.class == fieldType ||
                 MultiLineString.class == fieldType ||
                 Geometry.class == fieldType ||
                 GeometryCollection.class == fieldType )
            {
              final Converter converter = isSqlServer ? new SqlServerConverter() : new PostgisConverter();
              converter.initialize( mapping, session );
              dfm.setConverter( converter );
            }
          }
        }
      }
    }
  }

  /**
   * Return the field associated with the specified name.
   * Walk the parent class to locate the field as necessary.
   */
  private Field getField( final Class type, final String attributeName )
  {
    Class t = type;
    while ( t != Object.class )
    {
      try
      {
        return t.getDeclaredField( attributeName );
      }
      catch ( final NoSuchFieldException nsfe )
      {
        //Ignore
      }
      t = t.getSuperclass();
    }
    throw new IllegalStateException( "Unable to find field: " + attributeName );
  }

  // only consider mappings that are deemed to produce
  // byte[] database fields from objects...
  private boolean isCandidateConverter( final DirectToFieldMapping mapping )
  {
    final Converter converter = mapping.getConverter();
    return null != converter && converter instanceof SerializedObjectConverter;
  }
}


text:
Django
======

Django applications

## If you have Django installed, you can use the following commands to check its version
```python
  python -c "import django; print(django.get_version())"
 ```

## Use django-admin to create an new app
```python
  django-admin startproject myapp
```
   The structure it generated is as follows:

      mysite/

          manage.py

          mysite/

            __init__.py

            settings.py

            urls.py

            wsgi.pys

## Use manage.py to start your first app
```python
  python manage.py runservers
```


text:
namespace Directions.Core.Model
{
    public enum Mode
    {
        Driving = 0,
        Walking = 1,
        Cycling = 2,
        PublicTransport = 3
    }
}


text:
import { mergeData } from 'vue-functional-data-merge'
import { scrollTargetIntoView } from '~/utils'

// --- Utility methods ---

// Convert local links to router push or scroll target into view
const linkToRouter = event => {
  if (!event || event.type !== 'click') {
    return
  }
  const $target = event.target && event.target.closest ? event.target.closest('a[href]') : null
  // Early exit if click inside an example, not a link,
  // or default prevented or is a Vue instance
  if (
    !$target ||
    event.type !== 'click' ||
    $target.__vue__ ||
    $target.closest('.bd-example') ||
    $target.closest('pre') ||
    event.defaultPrevented
  ) {
    return
  }
  const href = $target.getAttribute('href')
  if (href && href.indexOf('/') === 0 && href.indexOf('//') !== 0) {
    // If local page-to-page-docs link, convert click to `$router.push()`
    event.preventDefault()
    if (typeof window !== 'undefined' && window.$nuxt) {
      // Since we are a functional component, we can't use `this.$router`
      window.$nuxt.$router.push(href)
    }
  } else if (href && href.indexOf('#') === 0) {
    // In page anchor link, so use `scrollTargetIntoView` utility method
    scrollTargetIntoView(event, href)
  }
  // Else, normal browser link handling (i.e. external links)
}

// @vue/component
export default {
  name: 'BVSection',
  functional: true,
  props: {
    tag: {
      type: String,
      default: 'section'
    },
    play: {
      type: Boolean,
      default: false
    }
  },
  render(h, { props, data, children }) {
    const directives = []
    if (props.play) {
      directives.push({ name: 'play' })
    }
    return h(
      props.tag,
      mergeData(data, {
        class: ['bd-content'],
        directives,
        on: {
          click: linkToRouter
        }
      }),
      [children]
    )
  }
}


text:
/*
 +----------------------------------------------------------------------+
 | Swoole                                                               |
 +----------------------------------------------------------------------+
 | This source file is subject to version 2.0 of the Apache license,    |
 | that is bundled with this package in the file LICENSE, and is        |
 | available through the world-wide-web at the following url:           |
 | http://www.apache.org/licenses/LICENSE-2.0.html                      |
 | If you did not receive a copy of the Apache2.0 license and are unable|
 | to obtain it through the world-wide-web, please send a note to       |
 | license@swoole.com so we can mail you a copy immediately.            |
 +----------------------------------------------------------------------+
 | Author: Tianfeng Han  <mikan.tenny@gmail.com>                        |
 +----------------------------------------------------------------------+
 */

#ifndef _SW_ASYNC_H_
#define _SW_ASYNC_H_

#ifndef O_DIRECT
#define O_DIRECT         040000
#endif

enum swAioMode
{
    SW_AIO_BASE = 0,
    SW_AIO_LINUX,
};

enum
{
    SW_AIO_READ = 0,
    SW_AIO_WRITE = 1,
    SW_AIO_DNS_LOOKUP = 2,
};

typedef struct _swAio_event
{
    int fd;
    int task_id;
    uint8_t type;
    off_t offset;
    size_t nbytes;
    void *buf;
    void *req;
    int ret;
    int error;
} swAio_event;

typedef struct
{
    uint8_t init;
    uint8_t mode;
    uint8_t thread_num;
    uint32_t task_num;
    uint16_t current_id;

    void (*destroy)(void);
    void (*callback)(swAio_event *aio_event);
    int (*read)(int fd, void *outbuf, size_t size, off_t offset);
    int (*write)(int fd, void *inbuf, size_t size, off_t offset);
} swAsyncIO;

extern swAsyncIO SwooleAIO;
extern swPipe swoole_aio_pipe;

void swAio_callback_test(swAio_event *aio_event);
int swAio_init(void);
void swAio_free(void);
int swAioBase_init(int max_aio_events);
int swAio_dns_lookup(void *hostname, void *ip_addr, size_t size);

#ifdef HAVE_GCC_AIO
int swAioGcc_init(int max_aio_events);
#endif

#ifdef HAVE_LINUX_AIO
int swAioLinux_init(int max_aio_events);
#endif

#endif /* _SW_ASYNC_H_ */


text:
<?xml version="1.0" encoding="utf-8"?>

<function>
    <description>
Read a single line from a stream.
A line is defined as a string that ends on *\n*, *\r*, *\r\n* or end of stream.
If the input stream has already reached the end an error will be thrown.
    </description>
    <examples>
        <example title="Usage">
            Read the first three line from a file

                use File, Stream, System;

                var file = File.openRead("./file.txt");

                var line = Stream.readLine(file);
                System.print(line);
                line = Stream.readLine(file);
                System.print(line);
                line = Stream.readLine(file);
                System.print(line);

        </example>
    </examples>
    <references>
        <reference>File.openRead</reference>
        <reference>File.openAppend</reference>
        <reference>File.openWrite</reference>
        <reference>write</reference>
        <reference>iterate</reference>
    </references>
    <tags>
        read, write, append, text, line, sentence
    </tags>
</function>


text:
package org.apache.omid;

import org.apache.hadoop.hbase.HRegionInfo;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.regionserver.Region;

import java.io.IOException;

/**
 * Wrapper over {@link org.apache.hadoop.hbase.regionserver.Region} interface in HBase 1.x versions
 */
public class RegionWrapper {

    Region region;

    public RegionWrapper(Region region) {

        this.region = region;

    }

    public Result get(Get getOperation) throws IOException {

        return region.get(getOperation);

    }

    public HRegionInfo getRegionInfo() {

        return region.getRegionInfo();

    }

}


text:
require 'test/unit'
require 'rubygems'
require 'applecore'

class SystemLogTest < Test::Unit::TestCase

  def setup
    @log = Apple::SystemLogger.new('TestApp', 'user')
  end

  def teardown
    @log.close
  end

  def test_severities
    message = 'Test'
    assert_equal(0, @log.emergency(message), 'Log emergency message failed.')
    assert_equal(0, @log.alert(message), 'Log alert message failed.')
    assert_equal(0, @log.critical(message), 'Log critical message failed.')
    assert_equal(0, @log.error(message), 'Log error message failed.')
    assert_equal(0, @log.warning(message), 'Log warning message failed.')
    assert_equal(0, @log.info(message), 'Log info message failed.')
    assert_equal(0, @log.debug(message), 'Log debug message failed.')
    assert_equal(0, @log << message, 'Log debug shorthand failed.')
  end

end

class SystemLogFileTest < Test::Unit::TestCase

  def setup
    @filename = 'unittest.log'
    @log = Apple::SystemLogger.new('TestApp', 'user', @filename)
  end

  def teardown
    @log.close
    File.delete(@filename)
  end

  def test_severities
    # write message
    assert_equal(0, @log.info('Test info'), 'Log info message failed.')
    assert_equal(0, @log.debug('Test debug'), 'Log debug message failed.')
    assert_equal(0, @log << 'Test debug', 'Log debug shorthand failed.')
    # ensure messages were written.
    fp = File.new(@filename, 'r')
    content = fp.read()
    fp.close
    # verify tests written
    assert_equal(1, content.scan(/Test info/).length, 'Logging of info message failed.')
    assert_equal(2, content.scan(/Test debug/).length, 'Logging of debug message failed.')
  end

end


text:
<?xml version="1.0" encoding="utf-8"?>
<BuildReceipt xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Properties>
    <Property Name="TargetName" Value="OnepointtwoEditor" />
    <Property Name="Platform" Value="Win64" />
    <Property Name="Configuration" Value="Development" />
    <Property Name="Precompile" Value="False" />
  </Properties>
  <BuildProducts>
    <BuildProduct Path="$(ProjectDir)\Binaries\Win64\UE4Editor-Onepointtwo-8286.dll" Type="DynamicLibrary" />
    <BuildProduct Path="$(ProjectDir)\Binaries\Win64\UE4Editor-Onepointtwo-8286.pdb" Type="SymbolFile" />
    <BuildProduct Path="$(ProjectDir)\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-Onepointtwo-8286.lib" Type="ImportLibrary" />
  </BuildProducts>
  <RuntimeDependencies />
  <AdditionalProperties />
  <bRequireDependenciesToExist>true</bRequireDependenciesToExist>
</BuildReceipt>


text:
[![Build Status](https://travis-ci.org/YaroslavLitvinov/gizer.svg?branch=master)](https://travis-ci.org/YaroslavLitvinov/gizer)
[![Coverage Status](https://coveralls.io/repos/github/YaroslavLitvinov/gizer/badge.svg?branch=master)](https://coveralls.io/github/YaroslavLitvinov/gizer?branch=master)

## Intro

Application requires two connections to PostgreSQL instances: one is
using for caching purposes and another is real target instance.  At
least PostgreSQL 9.3 required. This requirement is coming from initial
database synchronization (Init load).

Solution is divided into 3 phases:

* Schema acquisition.

  See get_mongo_schema_as_json.py tool from
  https://github.com/YaroslavLitvinov/mongo_schema. That tool
  creates schema of a data to be used during init & oplog load
  stages.
* Init load.

  It's performing by bulk psql copy. During this phase data
  is reading directly from mongo connector, so no oplog connector is
  using on this stage. It's can be useful to run only this stage if
  you just need to update your postgres data once a day.

  mongo_reader.py and psql_copy.py are the right tools for this stage.
  mongo_reader.py reads data from mongodb into csv files.

  psql_copy.py exports colections of csv files into Postgres.
* Oplog load.

  Sharded cluster supported. Every mongodb replica should be specified
  in config file as separate section. In this mode oplog reader data is reading from syncronization point and transforming oplog data to appropriate sqls. Additionally, just before commiting changes into Postgres it makes reverse load of postgres data and comparing it to actual mongodb record's data. It creates additional overhead, but ensures us from having non consistent data in Postgres database. In case if inconsistency detected, bad data will be fixed by reloading specific record or in worst case it can lead to complete reload of whole database. So, in short this is a startegy that keeps data consistent. As solution is kind of batch `mongo_to_psql` must be invoked every time in order to process freshly added
  mongodb's changes. Simple crontab scheduler can be used for this. So every app invoke will deliver fresh pattches to PostgreSQL. For example, you can run this 'synchronization' tool every minute or five.

  Tool mongo_to_psql.py serves for this stage.

## Environment

* Python 2.7.x
* Add directory containing mongo_schema module to python path.  If
     modules are resided in git directory do:
     ```export PYTHONPATH=~/git/:~/git/gizer```
* Specify TEST_PSQLCONN env variable before running tests
     ```export TEST_PSQLCONN="dbname=zvm user=zvm"```
* create test postgresql user at once (following will create admin user)
     ```sudo su - postgres
     createuser -sdrl zvm
     createdb zvm
     psql -U postgres -c "ALTER USER zvm WITH PASSWORD 'zvm';"
     ```
* Test it
     ./run_cov_tests.sh or py.test

## Config file.

  Connection settings, etc. See sample-config.ini for inspiration.

## Tools.
* mongo_reader.py - 1st part of initial load.
     It's creates relational model of data for specific collection and then saves all collection's data into csv files.
* psql_copy.py - 2nd part of initial load.
     Export scv files previously created by mongo_reader.py into postgres tables.
* etlstatus.py - application managing etl status by external application;
* config_value.py - external config reader, one value per execution;
* mongo_to_psql.py - application for syncing, handling oplog.

## Command line examples

Acquire schema

```python mongo_schema/get_mongo_schema_as_json.py --host localhost:27017  -cn test.get_sql_query_tests > get_sql_query_tests.js```

Save latest oplog timestamp before running init load

```python etlstatus.py -init-load-start-save-ts  --config-file ../gizer-config.ini```

Run init load part 1 of 2
```python mongo_reader.py --config-file ../gizer-config.ini -cn submit_feedbacks --ddl-statements-file submit_feedbacks.sql --csv-path tmp -psql-table-prefix 2016_04_11_ -stats-file submit_feedbacks.stat```

Run init load part 2 of 2
```python psql_copy.py --config-file ../gizer-config.ini -cn submit_feedbacks --psql-table-name submit_feedbacks --input-csv-dir tmp/submit_feedbacks/ -psql-table-prefix 2016_04_11_```

When init load finishes save completion status ok/error

```python etlstatus.py -init-load-finish ok  --config-file ../gizer-config.ini```

Verify etl status, if exit code is 1 then run init load

```python etlstatus.py -init-load-status  --config-file ../gizer-config.ini```

Run following command every time to update postgres database by MongoDB data

```python mongo_to_psql.py --config-file ../gizer-config.ini```

## Know issues.

* Schema items' types should be strictly defined. Incorrectly defined types may lead to errors.
* Fields which are not in schema or whose have different types will not be loaded to relational model


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration.Provider;

namespace BlogEngine.Core.Providers
{
    /// <summary>
    /// A collection class for BlogFileSystemProviders.
    /// </summary>
    public class BlogFileSystemProviderCollection : ProviderCollection
    {
        #region Indexers

        /// <summary>
        ///     Gets a provider by its name.
        /// </summary>
        /// <param name="name">The name of the provider.</param>
        public new BlogFileSystemProvider this[string name]
        {
            get
            {
                return (BlogFileSystemProvider)base[name];
            }
        }

        #endregion

        #region Public Methods

        /// <summary>
        /// Add a provider to the collection.
        /// </summary>
        /// <param name="provider">
        /// The provider.
        /// </param>
        public override void Add(ProviderBase provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            if (!(provider is BlogFileSystemProvider))
            {
                throw new ArgumentException("Invalid provider type", "provider");
            }

            base.Add(provider);
        }

        #endregion
    }
}


text:
Param(
	[switch]$NoElevate
)

$parentKeyPath = "HKLM:\SOFTWARE\Microsoft\HTMLHelp\1.x";
$keyName = "ItssRestrictions";
$propertyName = "MaxAllowedZone";
$propertyValue = [UInt32]0x00000003;

Function Test-WasReInvokedAsElevated {
	[CmdletBinding()]
	Param(
		[Parameter(Mandatory = $true)]
		[string]$ScriptPath,
		[Parameter(Mandatory = $true)]
		[bool]$NoElevate
	)

	$currentPrincipal = [Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent();

	if ($currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { return $false }

	"" | Write-Host;
    "You are not currently running this under Administrative privileges!" | Write-Warning;
	"This system may requires elevated privileges to edit registry values." | Write-Host;

	if ($NoElevate) { return $false; }

    $choices = [System.Management.Automation.Host.ChoiceDescription[]]@(
		(New-Object System.Management.Automation.Host.ChoiceDescription("&Run as Admin", "Elevate your login to Administrative privileges")),
		(New-Object System.Management.Automation.Host.ChoiceDescription("Use &Alternate Credentials", "Supply alternate credentials which may have administrative privileges")),
		(New-Object System.Management.Automation.Host.ChoiceDescription("&Continue with current Credentials", "Attempt to execute script with your current permissions")),
		(New-Object System.Management.Automation.Host.ChoiceDescription("&Quit", "Exit and do nothing"))
	);
    $userchoice = $host.ui.PromptforChoice("Warning","Please select to use Alternate Credentials or current credentials to run command", $choices, 0);

    if ($userchoice -eq 2) {
        @("", "Using current credentials") | Write-Host;
		return $false;
    }

	if ($userChoice -eq 3) {
		@("", "Aborting") | Write-Warning;
		return $true;
	}

	$tempBase = [Environment]::GetEnvironmentVariable("Temp","Machine") | Join-Path -ChildPath ("{0}_tmp" -f ([Guid]::NewGuid()).ToString("N"));
	$tempBatchFile = "{0}.bat" -f $tempBase;
	$tempScript = "{0}.ps1" -f $tempBase;
	$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding($False);
	$txt = "";
	if ($userChoice -ne 1) { $txt = ' -NoElevate' }

	[IO.File]::WriteAllLines($tempBatchFile, @(
		'@echo off',
		('powershell -ExecutionPolicy Bypass -File "{0}"{1}' -f $tempScript, $txt)
		'pause'
	), $Utf8NoBomEncoding);
	try {
		$ScriptPath | Copy-Item -Destination:$tempScript -Force;
		try {
			$proc = $null;
			if ($userChoice -eq 0) {
				$proc = Start-Process "cmd.exe" ('/C "{0}"' -f $tempBatchFile) -Verb:"RunAs" -PassThru;
			} else {
				$proc = Start-Process "cmd.exe" ('/C "{0}"' -f $tempBatchFile) -Credential:(Get-Credential) -PassThru;
			}

			$proc.WaitForExit();
		} catch {
			"" | Write-Host;
			("Error starting process: {0}" -f ($_ | Out-String)) | Write-Error;
		} finally {
			Remove-Item $tempScript -Force;
		}
	} catch {
		"" | Write-Host;
		("Error starting process: {0}" -f ($_ | Out-String)) | Write-Error;
	} finally {
		Remove-Item $tempBatchFile -Force;
	}

	return $true;
}

Function Invoke-FixChmFileSecurity {
	[CmdletBinding()]
	Param(
		[Parameter(Mandatory = $true)]
		[string]$ScriptPath,
		[Parameter(Mandatory = $true)]
		[bool]$NoElevate
	)

	if (Test-WasReInvokedAsElevated -ScriptPath:$ScriptPath -NoElevate:$NoElevate) { return }

	if (-not ($parentKeyPath | Test-Path)) {
		"" | Write-Host;
		("Cannot fix CHM file viewing security because {0} was not found." -f $parentKeyPath) | Write-Error;
		if (-not $NoElevate) {
			@('', "Press a enter to continue...") | Write-Host;
			Read-Host | Out-Null;
		}
		return;
	}

	$keyPath = $parentKeyPath | Join-Path -ChildPath:$keyName;
	if ($keyPath | Test-Path) {
		$Script:key = $keyPath | Get-Item;
	} else {
		@('', ("Creating key {0} in {1}" -f $keyName, $parentKeyPath)) | Write-Host;
		$Script:key = New-Item -Path:$keyPath;
	}

	try {
		$value = $Script:key | Get-ItemProperty -Name:$propertyName;
		if ($value.MaxAllowedZone -eq $propertyValue) {
			@('', ("{0} in {1} already set to {2}." -f $propertyName, $keyPath, $propertyValue)) | Write-Host;
		} else {
			if ($value.MaxAllowedZone -eq $null) {
				@('', ("Adding DWord value of {0} to {1}." -f $propertyValue, $keyPath)) | Write-Host;
			} else {
				@('', ("Changing value of {0} in {1} from ""{2}"" to ""{3}""." -f $propertyName, $keyPath, $value.MaxAllowedZone, $propertyValue)) | Write-Host;
			}
			$Script:key | Set-ItemProperty -Name:$propertyName -Value:$propertyValue -ErrorAction:Stop;
			@(
				"",
				"Registry updated."
			) | Write-Host;
		}
		@(
			'',
			'Please note that there is probably still a bug relating to displaying CHM files, if the a name within file''s path contains symbols (such as "C:\Program Files (x86)"',
			'This is due to a bug which Microsoft never fixed.',
			'To successfully view a Compiled Help File, simply copy it to a path that does not contain symbols (such as "C:\Windows\Temp").'
		) | Write-Host;
	} catch {
		if ($error[0].Exception -ne $null -and $error[0].Exception -is [System.Security.SecurityException]) {
			"" | Write-Host;
			("Registry access writing to {0} is not allowed." -f $keyPath) | Write-Error;
		} else {
			"" | Write-Host;
			("Error writing to registry path {0}: {1}" -f $keyPath, $error[0].Message) | Write-Error;
		}
	}

	'' | Write-Host;

	if ($NoElevate) { return; }

	"Press a enter to continue..." | Write-Host;

	Read-Host | Out-Null;
}

if (-not $NoElevate) {
	@(
		'',
		'This script resolves the following Compiled Help File Display issue:',
		'',
		'Symptom:',
		'When trying to view a help file in CHM format, the index displays, but all pages are blank',
		'',
		'This script fixes this by changing the "zone" from which Microsoft Help is allowed to retreive content.',
		('This setting exists under "{0}\{1}", where the property named "{2}" will be set to a DWORD value of {3}.' -f $parentKeyPath, $keyName, $propertyName, $propertyValue),
		''
	) | Write-Host;

	$choices = [System.Management.Automation.Host.ChoiceDescription[]]@(
		(New-Object System.Management.Automation.Host.ChoiceDescription("&Yes", "Fix Compiled Help File Display issue")),
		(New-Object System.Management.Automation.Host.ChoiceDescription("&No", "Exit and do nothing"))
	);
	$userchoice = $host.ui.PromptforChoice("Proceed?","Would you like this script to proceed?", $choices, 1);
	if ($userchoice -ne 0) { return }
}

try {
	Invoke-FixChmFileSecurity -ScriptPath:($MyInvocation.MyCommand.Path) -NoElevate:$NoElevate;
} catch {
	"" | Write-Host;
	("Unexpected Error: {0}" -f ($_ | Out-String)) | Write-Error;
	@('', "Press a enter to continue...") | Write-Host;
	Read-Host | Out-Null;
}


text:
# HelloWorld
repositorio de demostracao de utilizacao do github


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE193_char_cpy_84_bad.cpp
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE193.label.xml
Template File: sources-sink-84_bad.tmpl.cpp
*/
/*
 * @description
 * CWE: 122 Heap Based Buffer Overflow
 * BadSource:  Allocate memory for a string, but do not allocate space for NULL terminator
 * GoodSource: Allocate enough memory for a string and the NULL terminator
 * Sinks: cpy
 *    BadSink : Copy string to data using strcpy()
 * Flow Variant: 84 Data flow: data passed to class constructor and destructor by declaring the class object on the heap and deleting it after use
 *
 * */
#ifndef OMITBAD

#include "std_testcase.h"
#include "CWE122_Heap_Based_Buffer_Overflow__cpp_CWE193_char_cpy_84.h"

namespace CWE122_Heap_Based_Buffer_Overflow__cpp_CWE193_char_cpy_84
{
CWE122_Heap_Based_Buffer_Overflow__cpp_CWE193_char_cpy_84_bad::CWE122_Heap_Based_Buffer_Overflow__cpp_CWE193_char_cpy_84_bad(char * dataCopy)
{
    data = dataCopy;
    /* FLAW: Did not leave space for a null terminator */
    data = new char[10];
}

CWE122_Heap_Based_Buffer_Overflow__cpp_CWE193_char_cpy_84_bad::~CWE122_Heap_Based_Buffer_Overflow__cpp_CWE193_char_cpy_84_bad()
{
    {
        char source[10+1] = SRC_STRING;
        /* POTENTIAL FLAW: data may not have enough space to hold source */
        strcpy(data, source);
        printLine(data);
        delete [] data;
    }
}
}
#endif /* OMITBAD */


text:
""" Module with all kind of nice runtimes for various platforms! """

import io
from .binutils.objectfile import ObjectFile
from . import ir

def make_trampoline(func_name):
    """ Create a main function that calls another function """
    mod = ir.Module('main')
    main = ir.Procedure('main')
    mod.add_function(main)
    entry = ir.Block('entry')
    main.add_block(entry)
    main.entry = entry
    entry.add_instruction(ir.ProcedureCall(func_name, []))
    entry.add_instruction(ir.Exit())
    return mod

def create_linux_exe(function_name: str, name, obj: ObjectFile):
    """ Create an executable for the given system """
    from .api import c3c, asm, link, objcopy, ir_to_object

    march = obj.arch

    obj1 = c3c([io.StringIO(RT_IO_C3), io.StringIO(LINUX_BSP)], [], march)
    obj2 = asm(io.StringIO(LINUX_CRT0), march)
    trampoline = make_trampoline(function_name)
    obj3 = ir_to_object([trampoline], march)
    obj = link([obj, obj1, obj2, obj3], layout=io.StringIO(LINUX_MMAP))
    objcopy(obj, None, 'elf', name)
    print(obj)

# TODO: is this really a runtime?

RT_IO_C3 = """
module io;
import bsp;

public function void println(string txt)
{
    print(txt);
    bsp.putc(10); // Newline!
}

public function void print(string txt)
{
    var int i;
    i = 0;

    while (i < txt->len)
    {
        bsp.putc(txt->txt[i]);
        i = i + 1;
    }
}
"""

LINUX_BSP = """
module bsp;

public function void putc(byte c)
{
  syscall(1, 1, cast<int64_t>(&c), 1);
}

function void exit()
{
    syscall(60, 0, 0, 0);
}

function void syscall(int64_t nr, int64_t a, int64_t b, int64_t c);

"""

LINUX_CRT0 = """
section reset

start:
    call main_main
    call bsp_exit

bsp_syscall:
    mov rax, rdi ; abi param 1
    mov rdi, rsi ; abi param 2
    mov rsi, rdx ; abi param 3
    mov rdx, rcx ; abi param 4
    syscall
    ret
"""

LINUX_MMAP = """
MEMORY code LOCATION=0x40000 SIZE=0x10000 {
    SECTION(reset)
    ALIGN(4)
    SECTION(code)
}

MEMORY ram LOCATION=0x20000000 SIZE=0xA000 {
    SECTION(data)
}
"""


text:
package com.eaw1805.www.scenario.views.infopanels;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.*;
import com.eaw1805.data.constants.ArmyConstants;
import com.eaw1805.data.constants.StyleConstants;
import com.eaw1805.data.dto.web.army.CommanderDTO;
import com.eaw1805.data.dto.web.army.RankDTO;
import com.eaw1805.www.fieldbattle.widgets.ImageButton;
import com.eaw1805.www.fieldbattle.widgets.OptionEAW;
import com.eaw1805.www.fieldbattle.widgets.SelectEAW;
import com.eaw1805.www.scenario.stores.CommanderUtils;
import com.eaw1805.www.scenario.stores.EditorMapUtils;
import com.eaw1805.www.scenario.stores.EditorStore;
import com.eaw1805.www.scenario.views.EditorPanel;

public class CommanderInfoPanel
        extends AbsolutePanel
        implements ArmyConstants, StyleConstants {

    final AbsolutePanel mainPanel;
    final TextBox commName;
    final TextBox commComC;
    final TextBox commStrC;
    final SelectEAW<RankDTO> rankSelect;
    final CommanderDTO comm;
    public CommanderInfoPanel(final CommanderDTO commander) {
        comm = commander;
        setSize("366px", "90px");

        setStyleName("commanderInfoPanel");
        setSize("363px", "87px");
        mainPanel = new AbsolutePanel();
        add(mainPanel, 0, 0);

        commName = new TextBox();

        rankSelect = new SelectEAW<RankDTO>("Rank, click to change") {
            @Override
            public void onChange() {
                //do nothing here
            }
        };

        for (RankDTO rank : EditorStore.getInstance().getRanks()) {
            rankSelect.addOption(new OptionEAW(130, 15, rank.getName()), rank);
        }

        commComC = new TextBox();
        commStrC = new TextBox();

        final ImageButton updateImg = new ImageButton("http://static.eaw1805.com/images/buttons/ButAcceptOff.png", "Update commander");
        updateImg.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent clickEvent) {
                try {
                    commander.setComc(Integer.parseInt(commComC.getText()));
                } catch (Exception e) {}
                try{
                    commander.setStrc(Integer.parseInt(commStrC.getText()));
                } catch (Exception e) {}
                if (!commName.getText().isEmpty()) {
                    commander.setName(commName.getText());
                }
                commander.setRank(rankSelect.getValue());
                setupPanel();
            }
        });

        final ImageButton deleteImg = new ImageButton("http://static.eaw1805.com/images/buttons/ButCancelOff.png", "Delete commander");
        deleteImg.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent clickEvent) {
                //first delete this brigade
                EditorStore.getInstance().getCommanders().get(commander.getRegionId()).get(commander.getX()).get(commander.getY()).remove(commander.getId());
                //then remove it from map
                EditorMapUtils.getInstance().drawCommanders(commander.getRegionId());
                //then remove it from parent
                removeFromParent();
                //finally update commanders overview
                EditorPanel.getInstance().getCommOverview().updateOverview();
            }
        });
        deleteImg.setSize("20px", "20px");

        add(commName, 3, 3);
        add(rankSelect, 3, 40);
        add(commComC, 180, 3);
        add(commStrC, 180, 40);
        add(deleteImg, 320, 60);
        add(updateImg, 290, 60);
        setupPanel();
    }

    public void setupPanel() {
        commName.setText(comm.getName());
        //now select the selected rank
        rankSelect.selectOptionByValue(comm.getRank());
        commComC.setText(String.valueOf(comm.getComc()));
        commStrC.setText(String.valueOf(comm.getStrc()));
    }

}