text:
package org.mrgeo.services;

import org.mrgeo.mapalgebra.MapAlgebraParser;
import org.mrgeo.utils.ClassLoaderUtil;
import org.mrgeo.utils.HadoopUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import java.io.IOException;
import java.net.URL;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;

//import java.util.ArrayList;
//import java.util.List;
//import java.util.Vector;
//import org.mrgeo.core.wps.ProcessDefinitionConsumer;

/**
 *
 */
public class About extends HttpServlet
{

  private static final long serialVersionUID = 1L;

  private static final Logger log = LoggerFactory.getLogger(About.class);

  private static boolean initialized = false;
  private Properties props;

  /**
   *
   */
  @Override
  public void init(ServletConfig conf) throws ServletException
  {
    if (initialized == true)
    {
      return;
    }
    try
    {
      props = Configuration.getInstance().getProperties();
    }
    catch (IllegalStateException e)
    {
      log.error("About error: " + e.getMessage(), e);
    }
  }

  @Override
  @SuppressWarnings("rawtypes")
  protected void doGet(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException
  {
    XMLOutputFactory factory = XMLOutputFactory.newInstance();
    factory.setProperty("javax.xml.stream.isRepairingNamespaces", Boolean.TRUE);
    XMLStreamWriter xmlWriter;
    try
    {
      xmlWriter = factory.createXMLStreamWriter(response.getWriter());
      xmlWriter.writeStartElement("About");

      URL buildInfoUrl = Thread.currentThread().getContextClassLoader().getResource(
          "org/mrgeo/services/build.info");
      Properties buildInfo = new Properties();
      buildInfo.load(buildInfoUrl.openStream());

      String imageBase = Configuration.getInstance().getProperties().getProperty("image.base", "");

      xmlWriter.writeAttribute("name", buildInfo.getProperty("name"));
      xmlWriter.writeAttribute("version", buildInfo.getProperty("version"));
      xmlWriter.writeAttribute("imagebase", imageBase);
      String user = request.getRemoteUser();
      xmlWriter.writeAttribute("user", user != null ? user : "*unknown*");

      xmlWriter.writeStartElement("Properties");
      Iterator it = props.entrySet().iterator();
      while (it.hasNext())
      {
        Map.Entry prop = (Map.Entry)it.next();
        xmlWriter.writeStartElement("Property");
        xmlWriter.writeAttribute("name", (String)prop.getKey());
        xmlWriter.writeAttribute("value", (String)prop.getValue());
        xmlWriter.writeEndElement();
      }
      xmlWriter.writeEndElement();

      xmlWriter.writeStartElement("MapAlgebra");
      //ServiceLoader<MapOpFactory> loader = ServiceLoader.load(MapOpFactory.class);

      // TODO: The provider properties passed to the MapAlgebraParser need to be
      // constructed from calling a security layer with the web context. The security
      // layer should extract whatever it needs from the web request (like a PKI) and
      // set it into the properties so it can be used as needed by the providers.
      MapAlgebraParser p = new MapAlgebraParser(HadoopUtils.createConfiguration(), "", null);
      for (String n : p.getMapOpNames())
      {
        xmlWriter.writeStartElement("Operation");
        xmlWriter.writeAttribute("name", n);
        xmlWriter.writeEndElement();
      }

//      for (MapOpFactory s : loader)
//      {
//        for (String n : s.getMapOpNames())
//        {
//          xmlWriter.writeStartElement("Operation");
//          xmlWriter.writeAttribute("name", n);
//          xmlWriter.writeEndElement();
//        }
//      }
      xmlWriter.writeEndElement();

      xmlWriter.writeStartElement("ClassPath");

      xmlWriter.writeStartElement("SystemClassPath");
      xmlWriter.writeCharacters(System.getProperty("java.class.path", null));
      xmlWriter.writeEndElement();

      xmlWriter.writeStartElement("ClassLoader");
      xmlWriter.writeComment("This is not an exhaustive jar list, but it should be pretty good.");

      for (String s : ClassLoaderUtil.getMostJars())
      {
        xmlWriter.writeStartElement("jar");
        xmlWriter.writeAttribute("url", s);
        xmlWriter.writeEndElement();
      }

      ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
      Enumeration<URL> urls = classLoader.getResources("");
      while (urls.hasMoreElements())
      {
        URL resource = urls.nextElement();
        xmlWriter.writeStartElement(resource.getProtocol());
        xmlWriter.writeAttribute("url", resource.toString());
        xmlWriter.writeEndElement();
      }

      xmlWriter.writeEndElement();
      xmlWriter.writeEndElement();

      xmlWriter.writeEndElement();
      xmlWriter.flush();
      xmlWriter.close();

    }
    catch (XMLStreamException e)
    {
      throw new ServletException("Error constructing or writing XML Stream", e);
    }
  }
}


text:
package com.intellij.openapi.diff;

import consulo.logging.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.EditorFactory;
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.FileTypeManager;
import com.intellij.openapi.vfs.CharsetToolkit;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.LineSeparator;
import com.intellij.util.SystemProperties;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import java.io.*;
import java.nio.charset.Charset;
import java.nio.ByteBuffer;

/**
 * Allows to compare some text not associated with file or document.
 *
 * @see #getText()
 * @see #setReadOnly(boolean)
 */
public class SimpleContent extends DiffContent {
  private static final Logger LOG = Logger.getInstance(SimpleContent.class);

  private final byte[] myOriginalBytes;
  private final String myOriginalText;
  private final LineSeparators myLineSeparators = new LineSeparators();
  private final Document myDocument;
  private final FileType myType;
  private Charset myCharset;
  private byte[] myBOM;

  /**
   * Constructs content with given text and null type
   */
  public SimpleContent(String text) {
    this(text, null);
  }

  public SimpleContent(@Nonnull String text, @Nullable FileType type) {
    this(text, type, EditorFactory.getInstance());
  }

  public SimpleContent(@Nonnull String text, FileType type, EditorFactory f) {
    myOriginalBytes = text.getBytes();
    myOriginalText = myLineSeparators.correctText(text);
    myDocument = f.createDocument(myOriginalText);
    setReadOnly(true);
    myType = type;
  }

  public static SimpleContent createEmpty() {
    final SimpleContent content = new SimpleContent("");
    content.setIsEmpty(true);
    return content;
  }

  /**
   * Make this content editable or not. By default SimpleContent isn't editable.
   */
  public void setReadOnly(boolean readOnly) {
    myDocument.setReadOnly(readOnly);
  }

  /**
   * @return modified text.
   * @see #setReadOnly(boolean)
   */
  public String getText() {
    return myLineSeparators.restoreText(myDocument.getText());
  }

  public Document getDocument() {
    return myDocument;
  }

  /**
   * @return null
   */
  public OpenFileDescriptor getOpenFileDescriptor(int offset) {
    return null;
  }

  /**
   * @return null
   */
  public VirtualFile getFile() {
    return null;
  }

  @Nullable
  public FileType getContentType() {
    return myType;
  }

  /**
   * @return Encodes using default encoding
   */
  public byte[] getBytes() {
    String currentText = getText();
    if (myOriginalText.equals(myDocument.getText()) && myCharset == null) {
      return myOriginalBytes;
    }
    else if (myCharset != null) {
      final ByteBuffer buffer = myCharset.encode(currentText).compact();
      int bomLength = myBOM != null ? myBOM.length : 0;
      final int encodedLength = buffer.position();
      byte[] result = new byte[encodedLength + bomLength];
      if (bomLength > 0) {
        System.arraycopy(myBOM, 0, result, 0, bomLength);
      }
      buffer.position(0);
      buffer.get(result, bomLength, encodedLength);
      return result;
    }
    else {
      return currentText.getBytes();
    }
  }

  @Nonnull
  @Override
  public LineSeparator getLineSeparator() {
    return LineSeparator.fromString(myLineSeparators.mySeparator);
  }

  public Charset getCharset() {
    return myCharset;
  }

  public void setCharset(final Charset charset) {
    myCharset = charset;
  }

  /**
   * @param text     text of content
   * @param fileName used to determine content type
   * @return
   */
  public static SimpleContent forFileContent(String text, String fileName) {
    FileType fileType;
    if (fileName != null) {
      fileType = FileTypeManager.getInstance().getFileTypeByFileName(fileName);
    }
    else {
      fileType = null;
    }
    return new SimpleContent(text, fileType);
  }

  /**
   * @param bytes    binary text representaion
   * @param charset  name of charset. If null IDE default charset will be used
   * @param fileType content type. If null file name will be used to select file type
   * @return content representing bytes as text
   * @throws UnsupportedEncodingException
   */
  public static SimpleContent fromBytes(byte[] bytes, String charset, FileType fileType) throws UnsupportedEncodingException {
    if (charset == null) charset = CharsetToolkit.getDefaultSystemCharset().name();
    return new SimpleContent(new String(bytes, charset), fileType);
  }

  /**
   * @param file     should exist and not to be a directory
   * @param charset  name of file charset. If null IDE default charset will be used
   * @param fileType content type. If null file name will be used to select file type
   * @return Content representing text in file
   * @throws IOException
   */
  public static DiffContent fromIoFile(File file, String charset, FileType fileType) throws IOException {
    if (file.isDirectory()) throw new IllegalArgumentException(file.toString());
    if (fileType == null) fileType = FileTypeManager.getInstance().getFileTypeByFileName(file.getName());
    BufferedInputStream stream = new BufferedInputStream(new FileInputStream(file));
    try {
      byte[] bytes = new byte[(int)file.length()];
      int bytesRead = stream.read(bytes, 0, bytes.length);
      LOG.assertTrue(file.length() == bytesRead);
      return fromBytes(bytes, charset, fileType);
    }
    finally {
      stream.close();
    }
  }

  public void setBOM(final byte[] BOM) {
    myBOM = BOM;
  }

  private static class LineSeparators {
    private String mySeparator;

    public String correctText(String text) {
      LineTokenizer lineTokenizer = new LineTokenizer(text);
      String[] lines = lineTokenizer.execute();
      mySeparator = lineTokenizer.getLineSeparator();
      LOG.assertTrue(mySeparator == null || mySeparator.length() > 0);
      if (mySeparator == null) mySeparator = SystemProperties.getLineSeparator();
      return LineTokenizer.concatLines(lines);
    }

    public String restoreText(String text) {
      if (mySeparator == null) throw new NullPointerException();
      return text.replaceAll("\n", mySeparator);
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
import os
import argparse
import sys
import multiprocessing
import subprocess

from utils import *

parser = argparse.ArgumentParser()
parser.add_argument("--setup-emscripten",       action = "store_true",              help = "sets up emscripten (for windows?)")
args = parser.parse_args()

# change to the directory where this .py file resides
os.chdir(os.path.dirname(os.path.realpath(__file__)))

# go to root
os.chdir("../../")

if args.setup_emscripten:
    if make_dir('emscripten'):
        msg("setting up emscripten")
        os.chdir('emscripten')
        try:
            msg("downloading emscripten")
            urllib.FancyURLopener().retrieve('https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable-64bit.zip', 'emscripten.zip')
        except:
            msg("could not download emscripten archive!", "RED")
            sys.exit(1)
        msg("extracting emscripten zip")
        extractZip('emscripten.zip', "./")
        msg("updating emscripten")
        subprocess.check_call([os.getcwd() + '/emsdk.bat', 'update'])
        msg("installing emscripten")
        subprocess.check_call([os.getcwd() + '/emsdk.bat', 'install', 'latest'])
        subprocess.check_call([os.getcwd() + '/emsdk.bat', 'activate', 'latest'])

    sys.exit(0)

msg("updating submodules")

os.system("git submodule update --init --recursive")

make_dir("tools")

if isWindows() and not os.path.exists("tools/vswhere.exe"):
    url = 'https://github.com/Microsoft/vswhere/releases/download/2.5.2/vswhere.exe'
    downloadFile(url, "tools/vswhere.exe")

if isWindows() and not os.path.exists("tools/ninja.exe"):
    url = 'https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip'
    downloadAndExtractZip(url, "tools/ninja.zip", "tools")
    os.remove("tools/ninja.zip")

boost_minor = "68"
if not os.path.exists('third_party/boost_1_' + boost_minor + '_0'):
    url = 'http://sourceforge.net/projects/boost/files/boost/1.' + boost_minor + '.0/boost_1_' + boost_minor + '_0.zip/download'
    downloadAndExtractZip(url, "third_party/boost.zip", "third_party")
    os.remove("third_party/boost.zip")

glew_ver = "1.13.0"
if not os.path.exists("third_party/glew-" + glew_ver):
    url = 'https://sourceforge.net/projects/glew/files/glew/' + glew_ver + '/glew-' + glew_ver + '.zip/download'
    downloadAndExtractZip(url, "third_party/glew.zip", "third_party")
    os.remove("third_party/glew.zip")


text:
make clean
ctags *
make
make run


text:
package com.kulinr.android.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;

import com.kulinr.android.R;
import com.kulinr.android.entity.Chrome;
import com.kulinr.android.view.BottomGradientImageView;
import com.squareup.picasso.Picasso;

import java.util.List;

/**
 * Created by bobbyadiprabowo on 07/12/13.
 */
public class ChromeAdapter extends BaseAdapter {

    private List<Chrome> chromeList;
    private Context context;
    private int itemHeight;

    public ChromeAdapter(Context context) {
        this.context = context;
        itemHeight = context.getResources().getDimensionPixelSize(R.dimen.height_xlarge);
    }

    public void setChromeList(List<Chrome> chromeList) {
        this.chromeList = chromeList;
    }

    @Override
    public int getCount() {
        if (chromeList != null) {
            return chromeList.size();
        }
        return 0;
    }

    @Override
    public Object getItem(int i) {
        if (chromeList != null) {
            return chromeList.get(i);
        }
        return null;
    }

    @Override
    public long getItemId(int i) {
        if (chromeList != null) {
            return chromeList.get(i).get_id();
        }
        return -1;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup viewGroup) {
        ViewHolder viewHolder;

        if (convertView == null) {

            BottomGradientImageView bottomGradientImageView = new BottomGradientImageView(context);

            bottomGradientImageView.setLayoutParams(new GridView
                        .LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, itemHeight));

            convertView = bottomGradientImageView;

            viewHolder = new ViewHolder();
            viewHolder.bottomGradientImageView = bottomGradientImageView;

            convertView.setTag(viewHolder);
        }
        Chrome chrome = chromeList.get(position);
        viewHolder = (ViewHolder) convertView.getTag();
        viewHolder.bottomGradientImageView.setTitleText(chrome.getName());
        if (chrome.getName() != null) {
            viewHolder.bottomGradientImageView.setDescriptionText(chrome.getName());
        }
        Picasso.with(context).load(chrome.getPhoto()).placeholder(R.drawable.img_default_placeholder)
                .into(viewHolder.bottomGradientImageView);

        return convertView;
    }

    static class ViewHolder {
        private BottomGradientImageView bottomGradientImageView;
    }

}


text:
@implementation KFBaseTableViewController
- (instancetype)init{
    self = [super init];
    if (self) {
        self.automaticallyAdjustsScrollViewInsets = YES;
        [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(willRotateFromInterface:) name:UIApplicationWillChangeStatusBarOrientationNotification object:nil];
        self.modalPresentationStyle = KF5Helper.defaultModalPresentationStyle;
    }
    return self;
}

- (void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion {
    if (![viewControllerToPresent isKindOfClass:[UISearchController class]]) {
        viewControllerToPresent.modalPresentationStyle = KF5Helper.defaultModalPresentationStyle;
    }
    [super presentViewController:viewControllerToPresent animated:flag completion:completion];
}

- (void)willRotateFromInterface:(NSNotification *)note{
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(100 * NSEC_PER_MSEC)), dispatch_get_main_queue(), ^{
        [self updateFrame];
    });
}

- (void)viewDidLoad {
    [super viewDidLoad];
    if (@available(iOS 11, *)) {
        self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAutomatic;
    }
    self.hidesBottomBarWhenPushed = YES;
    self.view.backgroundColor = [UIColor whiteColor];
}

- (void)updateFrame{}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)dealloc{
    [[NSNotificationCenter defaultCenter]removeObserver:self name:UIApplicationWillChangeStatusBarOrientationNotification object:nil];
}

@end

@implementation KFBaseViewController
- (instancetype)init{
    self = [super init];
    if (self) {
        self.automaticallyAdjustsScrollViewInsets = YES;
        [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(willRotateFromInterface:) name:UIApplicationWillChangeStatusBarOrientationNotification object:nil];
        self.modalPresentationStyle = KF5Helper.defaultModalPresentationStyle;
    }
    return self;
}

- (void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion {
    viewControllerToPresent.modalPresentationStyle = KF5Helper.defaultModalPresentationStyle;
    [super presentViewController:viewControllerToPresent animated:flag completion:completion];
}

- (void)willRotateFromInterface:(NSNotification *)note{
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(100 * NSEC_PER_MSEC)), dispatch_get_main_queue(), ^{
        [self updateFrame];
    });
}

- (void)viewDidLoad {
    [super viewDidLoad];

    self.hidesBottomBarWhenPushed = YES;
    self.view.backgroundColor = [UIColor whiteColor];
}

- (void)updateFrame{}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)dealloc{
    [[NSNotificationCenter defaultCenter]removeObserver:self name:UIApplicationWillChangeStatusBarOrientationNotification object:nil];
}

@end


text:
from django.core.mail.message import EmailMessage, EmailMultiAlternatives
from django.utils.translation import ugettext_lazy as _
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe

def send_mail_task(subject, message, from_email, recipient_list):
    message = EmailMessage("Discover Special Value - {0}".format(subject), message, from_email, recipient_list)
    message.send()

def send_html_mail_task(subject, text_message, html_message, from_email, recipient_list, template='email/email_base.html'):
    if template is not None:
        html_message = render_to_string(template, {'content': mark_safe(html_message)})  # render html into an email template

    message = EmailMultiAlternatives("Discover Special Value - {0}".format(subject), html_message, from_email, recipient_list)
    message.content_subtype = "html"
    message.attach_alternative(text_message, "text/plain")
    message.send()


text:
- [Codex](codex) - расширение документации
- [Accounting](accounting) - Счета и реализации для Бухгалтерии предприятия
- [Unf](unf) - Заказ покупателя для типовой УНФ
- [Paperless](https://github.com/oknosoft/paperless) - Безбумажное производство для [УПзП](http://www.oknosoft.ru/program-possibilities.html)


text:
{% include header.html %}
{% include navbar.html %}

{% include sidebar.html %}

			<hgroup class="postheader">

{{ page.title }}

By Nelly Lam

{{ page.date | date_to_long_string }}

			</hgroup>

				{{ content }}

{% include footer.html %}


text:
.. include:: README.rst

.. include:: multiprocessing.rst

API Reference
-------------
.. toctree::
    :maxdepth: 2

    tables_v1alpha1/services
    tables_v1alpha1/types

Changelog
---------

For a list of all ``google-area120-tables`` releases:

.. toctree::
    :maxdepth: 2

    changelog


text:
from pkg_resources import resource_filename
from pyramid.events import (
    BeforeRender,
    subscriber,
)
from pyramid.httpexceptions import (
    HTTPMovedPermanently,
    HTTPPreconditionFailed,
    HTTPUnauthorized,
    HTTPUnsupportedMediaType,
)
from pyramid.security import forget
from pyramid.settings import asbool
from pyramid.threadlocal import (
    manager,
)
from pyramid.traversal import (
    split_path_info,
    _join_path_tuple,
)

from contentbase.validation import CSRFTokenError
from subprocess_middleware.tween import SubprocessTween
import logging
import os
import psutil
import time

log = logging.getLogger(__name__)

def includeme(config):
    config.add_tween(
        '.renderers.fix_request_method_tween_factory',
        under='contentbase.stats.stats_tween_factory')
    config.add_tween(
        '.renderers.normalize_cookie_tween_factory',
        under='.renderers.fix_request_method_tween_factory')
    config.add_tween('.renderers.page_or_json', under='.renderers.normalize_cookie_tween_factory')
    config.add_tween('.renderers.security_tween_factory', under='pyramid_tm.tm_tween_factory')
    config.scan(__name__)

def fix_request_method_tween_factory(handler, registry):
    """ Fix Request method changed by mod_wsgi.

    See: https://github.com/GrahamDumpleton/mod_wsgi/issues/2

    Apache config:
        SetEnvIf Request_Method HEAD X_REQUEST_METHOD=HEAD
    """

    def fix_request_method_tween(request):
        environ = request.environ
        if 'X_REQUEST_METHOD' in environ:
            environ['REQUEST_METHOD'] = environ['X_REQUEST_METHOD']
        return handler(request)

    return fix_request_method_tween

def security_tween_factory(handler, registry):

    def security_tween(request):
        login = None
        expected_user = request.headers.get('X-If-Match-User')
        if expected_user is not None:
            login = request.authenticated_userid
            if login != 'mailto.' + expected_user:
                detail = 'X-If-Match-User does not match'
                raise HTTPPreconditionFailed(detail)

        # wget may only send credentials following a challenge response.
        auth_challenge = asbool(request.headers.get('X-Auth-Challenge', False))
        if auth_challenge or request.authorization is not None:
            login = request.authenticated_userid
            if login is None:
                raise HTTPUnauthorized(headerlist=forget(request))

        if request.method in ('GET', 'HEAD'):
            return handler(request)

        if request.content_type != 'application/json':
            detail = "%s is not 'application/json'" % request.content_type
            raise HTTPUnsupportedMediaType(detail)

        token = request.headers.get('X-CSRF-Token')
        if token is not None:
            # Avoid dirtying the session and adding a Set-Cookie header
            # XXX Should consider if this is a good idea or not and timeouts
            if token == dict.get(request.session, '_csrft_', None):
                return handler(request)
            raise CSRFTokenError('Incorrect CSRF token')

        if login is None:
            login = request.authenticated_userid
        if login is not None:
            namespace, userid = login.split('.', 1)
            if namespace not in ('mailto', 'persona'):
                return handler(request)
        raise CSRFTokenError('Missing CSRF token')

    return security_tween

def normalize_cookie_tween_factory(handler, registry):
    from webob.cookies import Cookie

    ignore = {
        '/favicon.ico',
    }

    def normalize_cookie_tween(request):
        if request.path in ignore or request.path.startswith('/static/'):
            return handler(request)

        session = request.session
        if session or session._cookie_name not in request.cookies:
            return handler(request)

        response = handler(request)
        existing = response.headers.getall('Set-Cookie')
        if existing:
            cookies = Cookie()
            for header in existing:
                cookies.load(header)
            if session._cookie_name in cookies:
                return response

        response.delete_cookie(
            session._cookie_name,
            path=session._cookie_path,
            domain=session._cookie_domain,
        )

        return response

    return normalize_cookie_tween

@subscriber(BeforeRender)
def set_x_request_url(event):
    # Used by fetch polyfill and server rendering
    request = event['request']
    request.response.headers['X-Request-URL'] = request.url

@subscriber(BeforeRender)
def canonical_redirect(event):
    request = event['request']

    # Ignore subrequests
    if len(manager.stack) > 1:
        return

    if request.method not in ('GET', 'HEAD'):
        return
    if request.response.status_int != 200:
        return
    if not request.environ.get('encoded.canonical_redirect', True):
        return
    if request.path_info == '/':
        return

    canonical_path = event.rendering_val.get('@id', None)
    if canonical_path is None:
        return
    canonical_path = canonical_path.split('?', 1)[0]

    request_path = _join_path_tuple(('',) + split_path_info(request.path_info))
    if (request_path == canonical_path.rstrip('/') and
            request.path_info.endswith('/') == canonical_path.endswith('/')):
        return

    if '/@@' in request.path_info:
        return

    qs = request.query_string
    location = canonical_path + ('?' if qs else '') + qs
    raise HTTPMovedPermanently(location=location)

def should_transform(request, response):
    if request.method not in ('GET', 'HEAD'):
        return False

    if response.content_type != 'application/json':
        return False

    format = request.params.get('format')
    if format is None:
        original_vary = response.vary or ()
        response.vary = original_vary + ('Accept', 'Authorization')
        if request.authorization is not None:
            format = 'json'
        else:
            mime_type = request.accept.best_match(
                [
                    'text/html',
                    'application/ld+json',
                    'application/json',
                ],
                'text/html')
            format = mime_type.split('/', 1)[1]
            if format == 'ld+json':
                format = 'json'
    else:
        format = format.lower()
        if format not in ('html', 'json'):
            format = 'html'

    if format == 'json':
        return False

    request._transform_start = time.time()
    return True

def after_transform(request, response):
    end = time.time()
    duration = int((end - request._transform_start) * 1e6)
    stats = request._stats
    stats['render_count'] = stats.get('render_count', 0) + 1
    stats['render_time'] = stats.get('render_time', 0) + duration
    request._stats_html_attribute = True

# Rendering huge pages can make the node process memory usage explode.
# Ideally we would let the OS handle this with `ulimit` or by calling
# `resource.setrlimit()` from  a `subprocess.Popen(preexec_fn=...)`.
# Unfortunately Linux does not enforce RLIMIT_RSS.
# An alternative would be to use cgroups, but that makes per-process limits
# tricky to enforce (we would need to create one cgroup per process.)
# So we just manually check the resource usage after each transform.

rss_limit = 256 * (1024 ** 2)  # MB

def reload_process(process):
    return psutil.Process(process.pid).memory_info().rss > rss_limit

node_env = os.environ.copy()
node_env['NODE_PATH'] = ''

page_or_json = SubprocessTween(
    should_transform=should_transform,
    after_transform=after_transform,
    reload_process=reload_process,
    args=['node', resource_filename(__name__, 'static/build/renderer.js')],
    env=node_env,
)


text:
// Copyright 2014 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.devtools.build.lib.syntax;

import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.hash.HashCode;
import com.google.devtools.build.lib.events.Event;
import com.google.devtools.build.lib.events.EventHandler;
import com.google.devtools.build.lib.events.Location;
import com.google.devtools.build.lib.packages.CachingPackageLocator;
import com.google.devtools.build.lib.vfs.Path;
import com.google.devtools.build.lib.vfs.PathFragment;

import java.io.IOException;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.annotation.Nullable;

/**
 * Abstract syntax node for an entire BUILD file.
 */
public class BuildFileAST extends ASTNode {

  private final ImmutableList<Statement> stmts;

  private final ImmutableList<Comment> comments;

  private final ImmutableSet<PathFragment> imports;

  /**
   * Whether any errors were encountered during scanning or parsing.
   */
  private final boolean containsErrors;

  private final String contentHashCode;

  private BuildFileAST(Lexer lexer, List<Statement> preludeStatements, Parser.ParseResult result) {
    this(lexer, preludeStatements, result, null);
  }

  private BuildFileAST(Lexer lexer, List<Statement> preludeStatements,
      Parser.ParseResult result, String contentHashCode) {
    this.stmts = ImmutableList.<Statement>builder()
        .addAll(preludeStatements)
        .addAll(result.statements)
        .build();
    this.comments = ImmutableList.copyOf(result.comments);
    this.containsErrors = result.containsErrors;
    this.contentHashCode = contentHashCode;
    this.imports = fetchImports(this.stmts);
    if (!result.statements.isEmpty()) {
      setLocation(lexer.createLocation(
          result.statements.get(0).getLocation().getStartOffset(),
          result.statements.get(result.statements.size() - 1).getLocation().getEndOffset()));
    } else {
      setLocation(Location.fromPathFragment(lexer.getFilename()));
    }
  }

  private ImmutableSet<PathFragment> fetchImports(List<Statement> stmts) {
    Set<PathFragment> imports = new HashSet<>();
    for (Statement stmt : stmts) {
      if (stmt instanceof LoadStatement) {
        LoadStatement imp = (LoadStatement) stmt;
        imports.add(imp.getImportPath());
      }
    }
    return ImmutableSet.copyOf(imports);
  }

  /**
   * Returns true if any errors were encountered during scanning or parsing. If
   * set, clients should not rely on the correctness of the AST for builds or
   * BUILD-file editing.
   */
  public boolean containsErrors() {
    return containsErrors;
  }

  /**
   * Returns an (immutable, ordered) list of statements in this BUILD file.
   */
  public ImmutableList<Statement> getStatements() {
    return stmts;
  }

  /**
   * Returns an (immutable, ordered) list of comments in this BUILD file.
   */
  public ImmutableList<Comment> getComments() {
    return comments;
  }

  /**
   * Returns an (immutable) set of imports in this BUILD file.
   */
  public ImmutableCollection<PathFragment> getImports() {
    return imports;
  }

  /**
   * Executes this build file in a given Environment.
   *
   *
If, for any reason, execution of a statement cannot be completed, an
   * {@link EvalException} is thrown by {@link Statement#exec(Environment)}.
   * This exception is caught here and reported through reporter and execution
   * continues on the next statement.  In effect, there is a "try/except" block
   * around every top level statement.  Such exceptions are not ignored, though:
   * they are visible via the return value.  Rules declared in a package
   * containing any error (including loading-phase semantical errors that
   * cannot be checked here) must also be considered "in error".
   *
   *
Note that this method will not affect the value of {@link
   * #containsErrors()}; that refers only to lexer/parser errors.
   *
   * @return true if no error occurred during execution.
   */
  public boolean exec(Environment env, EventHandler eventHandler) throws InterruptedException {
    boolean ok = true;
    for (Statement stmt : stmts) {
      try {
        stmt.exec(env);
      } catch (EvalException e) {
        ok = false;
        // Do not report errors caused by a previous parsing error, as it has already been
        // reported.
        if (e.isDueToIncompleteAST()) {
          continue;
        }
        // When the exception is raised from another file, report first the location in the
        // BUILD file (as it is the most probable cause for the error).
        Location exnLoc = e.getLocation();
        Location nodeLoc = stmt.getLocation();
        if (exnLoc == null || !nodeLoc.getPath().equals(exnLoc.getPath())) {
          eventHandler.handle(Event.error(nodeLoc,
                  e.getMessage() + " (raised from " + exnLoc + ")"));
        } else {
          eventHandler.handle(Event.error(exnLoc, e.getMessage()));
        }
      }
    }
    return ok;
  }

  @Override
  public String toString() {
    return "BuildFileAST" + getStatements();
  }

  @Override
  public void accept(SyntaxTreeVisitor visitor) {
    visitor.visit(this);
  }

  /**
   * Parse the specified build file, returning its AST. All errors during
   * scanning or parsing will be reported to the reporter.
   *
   * @throws IOException if the file cannot not be read.
   */
  public static BuildFileAST parseBuildFile(Path buildFile, EventHandler eventHandler,
                                            CachingPackageLocator locator, boolean parsePython)
      throws IOException {
    ParserInputSource inputSource = ParserInputSource.create(buildFile);
    return parseBuildFile(inputSource, eventHandler, locator, parsePython);
  }

  /**
   * Parse the specified build file, returning its AST. All errors during
   * scanning or parsing will be reported to the reporter.
   */
  public static BuildFileAST parseBuildFile(ParserInputSource input,
                                            List<Statement> preludeStatements,
                                            EventHandler eventHandler,
                                            CachingPackageLocator locator,
                                            boolean parsePython) {
    Lexer lexer = new Lexer(input, eventHandler, parsePython);
    Parser.ParseResult result = Parser.parseFile(lexer, eventHandler, locator, parsePython);
    return new BuildFileAST(lexer, preludeStatements, result);
  }

  public static BuildFileAST parseBuildFile(ParserInputSource input, EventHandler eventHandler,
      CachingPackageLocator locator, boolean parsePython) {
    Lexer lexer = new Lexer(input, eventHandler, parsePython);
    Parser.ParseResult result = Parser.parseFile(lexer, eventHandler, locator, parsePython);
    return new BuildFileAST(lexer, ImmutableList.<Statement>of(), result);
  }

  /**
   * Parse the specified build file, returning its AST. All errors during
   * scanning or parsing will be reported to the reporter.
   */
  public static BuildFileAST parseBuildFile(Lexer lexer, EventHandler eventHandler) {
    Parser.ParseResult result = Parser.parseFile(lexer, eventHandler, null, false);
    return new BuildFileAST(lexer, ImmutableList.<Statement>of(), result);
  }

  /**
   * Parse the specified Skylark file, returning its AST. All errors during
   * scanning or parsing will be reported to the reporter.
   *
   * @throws IOException if the file cannot not be read.
   */
  public static BuildFileAST parseSkylarkFile(Path file, EventHandler eventHandler,
      CachingPackageLocator locator, ValidationEnvironment validationEnvironment)
          throws IOException {
    ParserInputSource input = ParserInputSource.create(file);
    Lexer lexer = new Lexer(input, eventHandler, false);
    Parser.ParseResult result =
        Parser.parseFileForSkylark(lexer, eventHandler, locator, validationEnvironment);
    return new BuildFileAST(lexer, ImmutableList.<Statement>of(), result,
        HashCode.fromBytes(file.getMD5Digest()).toString());
  }

  /**
   * Parse the specified build file, without building the AST.
   *
   * @return true if the input file is syntactically valid
   */
  public static boolean checkSyntax(ParserInputSource input,
                                    EventHandler eventHandler, boolean parsePython) {
    return !parseBuildFile(input, eventHandler, null, parsePython).containsErrors();
  }

  /**
   * Returns a hash code calculated from the string content of the source file of this AST.
   */
  @Nullable public String getContentHashCode() {
    return contentHashCode;
  }
}


text:
<!DOCTYPE html>

        <title>Tic Tac Toe Game</title>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width initial-scale=1">

        <link href="https://fonts.googleapis.com/css?family=Alex+Brush|Molle|Bonbon|Sail|Lobster|Graduate|Philosopher|Roboto+Mono|Dancing+Script" rel="stylesheet">

        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">

        <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">

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

Tic-Tac-Toe


text:
<form id="addBusiRuleProcessFieldsForm" method="post">
    <input type="hidden" id="id" name="id"/>

            规则名称:

                <input name="name" id="name"/>

            运算符类型:

                <input name="operatorType" id="operatorType"/>

            运算符:

                <input name="operator" id="operator"/>

            参数:

                <input name="params" id="params"/>

</form>


text:
namespace quic {

// A decoder to read encoded data from a file, decode it, and compare to
// a list of expected header lists read from another file.  File format is
// described at
// https://github.com/quicwg/base-drafts/wiki/QPACK-Offline-Interop.
class QpackOfflineDecoder : public QpackDecoder::EncoderStreamErrorDelegate {
 public:
  QpackOfflineDecoder();
  ~QpackOfflineDecoder() override = default;

  // Read encoded header blocks and encoder stream data from |input_filename|
  // and decode them, read expected header lists from
  // |expected_headers_filename|, and compare decoded header lists to expected
  // ones.  Returns true if there is an equal number of them and the
  // corresponding ones match, false otherwise.
  bool DecodeAndVerifyOfflineData(
      quiche::QuicheStringPiece input_filename,
      quiche::QuicheStringPiece expected_headers_filename);

  // QpackDecoder::EncoderStreamErrorDelegate implementation:
  void OnEncoderStreamError(quiche::QuicheStringPiece error_message) override;

 private:
  // Data structure to hold TestHeadersHandler and QpackProgressiveDecoder until
  // decoding of a header header block (and all preceding header blocks) is
  // complete.
  struct Decoder {
    std::unique_ptr<test::TestHeadersHandler> headers_handler;
    std::unique_ptr<QpackProgressiveDecoder> progressive_decoder;
    uint64_t stream_id;
  };

  // Parse decoder parameters from |input_filename| and set up |qpack_decoder_|
  // accordingly.
  bool ParseInputFilename(quiche::QuicheStringPiece input_filename);

  // Read encoded header blocks and encoder stream data from |input_filename|,
  // pass them to |qpack_decoder_| for decoding, and add decoded header lists to
  // |decoded_header_lists_|.
  bool DecodeHeaderBlocksFromFile(quiche::QuicheStringPiece input_filename);

  // Read expected header lists from |expected_headers_filename| and verify
  // decoded header lists in |decoded_header_lists_| against them.
  bool VerifyDecodedHeaderLists(
      quiche::QuicheStringPiece expected_headers_filename);

  // Parse next header list from |*expected_headers_data| into
  // |*expected_header_list|, removing consumed data from the beginning of
  // |*expected_headers_data|.  Returns true on success, false if parsing fails.
  bool ReadNextExpectedHeaderList(
      quiche::QuicheStringPiece* expected_headers_data,
      spdy::SpdyHeaderBlock* expected_header_list);

  // Compare two header lists.  Allow for different orders of certain headers as
  // described at
  // https://github.com/qpackers/qifs/blob/master/encoded/qpack-03/h2o/README.md.
  bool CompareHeaderBlocks(spdy::SpdyHeaderBlock decoded_header_list,
                           spdy::SpdyHeaderBlock expected_header_list);

  bool encoder_stream_error_detected_;
  test::NoopQpackStreamSenderDelegate decoder_stream_sender_delegate_;
  std::unique_ptr<QpackDecoder> qpack_decoder_;

  // Objects necessary for decoding, one list element for each header block.
  std::list<Decoder> decoders_;

  // Decoded header lists.
  std::list<spdy::SpdyHeaderBlock> decoded_header_lists_;
};

}  // namespace quic

#endif  // QUICHE_QUIC_TEST_TOOLS_QPACK_QPACK_OFFLINE_DECODER_H_


text:
package com.lovejjfg.blogdemo.base;

import com.lovejjfg.blogdemo.model.bean.BlogBean;

import retrofit2.http.Body;
import retrofit2.http.POST;
import retrofit2.http.Path;
import rx.Observable;

/**
 * Created by 张俊 on 2016/3/15.
 */
public interface BombApiService {

//    @Multipart
//    @POST("/batch")
//    void updateFile(@Part("photo") RequestBody photo, @Part("description") RequestBody description);

    @POST("files/{fileName}")
    Observable<BlogBean> OupdateFiles(@Path("fileName") String fileName, @Body byte[] bytes);

}


text:
import {
    ComponentRef,
    Input,
    SimpleChanges,
    ViewContainerRef,
    OnChanges,
    Component,
    ViewChild,
    Injectable,
    ComponentFactory,
    Compiler,
    NgModule
} from "@angular/core";
import {ComponentRegistry} from "./editor-component.class";
import {AppModule} from "../app.module";

@Injectable()
@Component({
    selector: '[render-component]',
    template: `
<div #container></div>
`
})
export class RenderComponent implements OnChanges {
    // instance data

    public versionCounter : number = 1;
    @Input()
    private component : any;
    @Input()
    private context : any;
    @ViewChild('container', {read: ViewContainerRef})
    private container : ViewContainerRef;
    private componentRef : ComponentRef<any>;
    @Input('render-component')
    private visible;

    // constructor

    constructor(private componentRegistry : ComponentRegistry, private compiler : Compiler) {
    }

    // private

    public buildFactory(template : string, ...inputs : string[]) : ComponentFactory<any> {
        @Component({
            inputs: inputs,
            template: template
        })
        class TemplateComponent {
        }

        // the module

        @NgModule({
            imports: [AppModule], // TODO
            declarations: [TemplateComponent]
        })
        class TemplateModule {
        }

        // compile and create

        let module = this.compiler.compileModuleAndAllComponentsSync(TemplateModule);

        return module.componentFactories.find((comp) =>
            comp.componentType === TemplateComponent
        );

    }

    public render() {
        let html = this.componentRegistry.find(this.component.id).render(this.component, false);

        this.update(html);
    }

    public update(html : string) {
        if (this.componentRef)
            this.componentRef.destroy();

        let factory = this.buildFactory(html);

        this.componentRef = this.container.createComponent(factory);

        // pass data

        let instance : any = this.componentRef.instance;

        instance.__proto__ = this.context; // :-) // constructor.prototype!
    }

    // implement OnChanges

    ngOnChanges(changes : SimpleChanges) : void {
        if (this.visible)
            this.render();
    }
}


text:
<?php

/**
 *
 * @package Core_Resource
 * @author Christian Gijtenbeek <gijtenbeek@terena.org>
 */
class Core_Resource_Events extends TA_Model_Resource_Db_Table_Abstract
{

	protected $_name = 'events';

	protected $_primary = 'event_id';

	protected $_rowClass = 'Core_Resource_Event_Item';

	public function init() {}

	/**
	 * Gets deadline by primary key
	 * @return object Zend_Db_Table_Row
	 */
	public function getEventById($id)
	{
		return $this->find((int) $id)->current();
	}

}


text:
import * as React from 'react';
import { StandardProps } from '..';
import { OverridableComponent, OverrideProps } from '../OverridableComponent';

export interface ListSubheaderTypeMap<P = {}, D extends React.ElementType = 'li'> {
  props: P & {
    color?: 'default' | 'primary' | 'inherit';
    disableGutters?: boolean;
    disableSticky?: boolean;
    inset?: boolean;
  };
  defaultComponent: D;
  classKey: ListSubheaderClassKey;
}

/**
 *
 * Demos:
 *
 * - [Grid List](https://material-ui.com/components/grid-list/)
 * - [Lists](https://material-ui.com/components/lists/)
 *
 * API:
 *
 * - [ListSubheader API](https://material-ui.com/api/list-subheader/)
 */
declare const ListSubheader: OverridableComponent<ListSubheaderTypeMap>;

export type ListSubheaderClassKey =
  | 'root'
  | 'colorPrimary'
  | 'colorInherit'
  | 'inset'
  | 'sticky'
  | 'gutters';

export type ListSubheaderProps<
  D extends React.ElementType = ListSubheaderTypeMap['defaultComponent'],
  P = {}
> = OverrideProps<ListSubheaderTypeMap<P, D>, D>;

export default ListSubheader;


text:
"""Test wechat custom menu module."""

from unittest import TestCase
from unittest.mock import patch

from wechatkit.exceptions import WechatKitException
from wechatkit.menu import (
    MenuUtil, MenuButton, ClickButton, ViewButton, SubButton,
    ScanButton, PhotoButton, LocationButton, MediaButton
)

class MenuUtilTest(TestCase):
    """MenuUtilTest test case."""

    def setUp(self):
        """Init setup."""

    def tearDown(self):
        """Tear down."""

    @patch('wechatkit.utils.RequestUtil.get')
    def test_query(self, mock_data):
        """Test query custom menu."""
        mock_data.return_value = {
            "menu": {
                "button": [{
                    "type": "click",
                    "name": "今日歌曲",
                    "key": "V1001_TODAY_MUSIC",
                    "sub_button": []
                }]
            }
        }
        resp = MenuUtil.query('access token')
        self.assertEqual(len(resp['menu']['button']), 1)

    def test_create_with_failure(self):
        """Test create custom menu."""
        resp = MenuUtil.create('test', 'access_token')
        self.assertEqual(resp['errcode'], 40001)

    @patch('wechatkit.utils.RequestUtil.post')
    def test_create_with_success(self, mock_data):
        """Test create custom menu success."""
        menu = {
            "button": [{
                "type": "click",
                "name": "今日歌曲",
                "key": "V1001_TODAY_MUSIC",
                "sub_button": []
            }]
        }
        mock_data.return_value = {
            "errcode": 0,
            "errmsg": "ok"
        }
        resp = MenuUtil.create(menu, 'access_token')
        self.assertEqual(resp['errcode'], 0)

    @patch('wechatkit.utils.RequestUtil.get')
    def test_delete(self, mock_data):
        """Test delete custom menu."""
        mock_data.return_value = {
            "errcode": 0,
            "errmsg": "ok"
        }
        resp = MenuUtil.delete('access_token')
        self.assertEqual(resp['errcode'], 0)

class MenuButtonTest(TestCase):
    """MenuButtonTest test case."""

    def setUp(self):
        """Init."""
        self.menu = MenuButton()

    def tearDown(self):
        """Tear down."""

    def test_menu_json(self):
        """Test menu json. """
        self.assertEqual(self.menu.json(), {'button': []})

    def test_menu_with_sub_button(self):
        """Test menu json with sub button. """
        click = ClickButton('测试', key='test')
        self.menu.add(click)
        self.assertIn(click.json(), self.menu.json()['button'])

    def test_menu_parse(self):
        """Test menu parse from json. """
        data = {'button': [{'key': 'test', 'name': '测试', 'type': 'click'}]}
        self.menu.parse(data)
        self.assertEqual(len(self.menu.buttons), 1)

    def test_menu_more_buttons(self):
        """Test menu more than 3 button. """
        click = ClickButton('测试', 'test')
        self.menu.add(click)
        self.menu.add(click)
        self.menu.add(click)
        with self.assertRaises(WechatKitException) as error:
            self.menu.add(click)

        self.assertEqual(
            error.exception.error_info, 'Level menu must not more than 3'
        )

    def test_menu_button_deep(self):
        """Test menu button with two deep. """
        sub = SubButton('导航')
        click = ClickButton('测试点击', 'click')
        view = ViewButton('测试视图', 'view')
        sub.add(click)
        sub.add(view)
        self.menu.add(sub)

        self.assertEqual(len(self.menu.buttons), 1)
        self.assertIn(
            click.json(),
            self.menu.json()['button'][0]['sub_button']
        )

    def test_sub_button_more(self):
        """ Test add more than 5 secondary button. """
        sub = SubButton('测试')
        click = ClickButton('测试', 'test')
        sub.add(click)
        sub.add(click)
        sub.add(click)
        sub.add(click)
        sub.add(click)
        with self.assertRaises(WechatKitException) as error:
            sub.add(click)

        self.assertEqual(
            error.exception.error_info, 'Secondary submenu must not more than 5'
        )

    def test_other_button(self):
        """ Test other button. """
        sub = SubButton('测试')
        scan = ScanButton('扫描', 'scan')
        sub.add(scan)
        photo = PhotoButton('相册', 'photo')
        sub.add(photo)
        loc = LocationButton('位置', 'location')
        sub.add(loc)
        media = MediaButton('图文', 'media_id')
        sub.add(media)
        self.menu.add(sub)

        self.assertEqual(len(self.menu.buttons[0].buttons), 4)

    def test_menu_button_parse(self):
        """ Test menu button parse. """
        data = {
            "button": [
                {
                    "type": "view",
                    "name": "我要吃饭",
                    "url": "test",
                    "sub_button": []
                }, {
                    "name": "订单",
                    "sub_button": [
                        {
                            "type": "view",
                            "name": "我的订单",
                            "url": "test..."
                        },
                        {
                            "type": "view",
                            "name": "我的收藏",
                            "url": "test..."
                        },
                        {
                            "type": "view",
                            "name": "优惠/折扣券",
                            "url": "test..."
                        }
                    ]
                },
                {
                    "name": "食饭志\"说\"",
                    "sub_button": [
                        {
                            "name": "成为\"料理人\"",
                            "type": "view",
                            "url": "test..."
                        },
                        {
                            "name": "关于\"食饭志\"",
                            "type": "view",
                            "url": "test..."
                        },
                        {
                            "name": "联系我们",
                            "type": "view",
                            "url": "test..."
                        }
                    ]
                }
            ]
        }
        self.menu.parse(data)

        self.assertEqual(len(self.menu.buttons), 3)
        self.assertEqual(len(self.menu.buttons[1].buttons), 3)
        self.assertEqual(self.menu.buttons[1].name, '订单')

    def test_no_value_button(self):
        """ Test no name for sub button. """
        with self.assertRaises(WechatKitException) as error:
            SubButton()

        self.assertEqual(error.exception.error_info, 'Not empty for `name`')

    def test_remove_menu_button(self):
        """ Test Remove menu button. """
        with self.assertRaises(WechatKitException) as error:
            self.menu.remove(1)

        self.assertEqual(error.exception.error_info, 'Sub button not exists')

        with self.assertRaises(WechatKitException) as error:
            sub = SubButton('test')
            sub.remove(1)

        self.assertEqual(error.exception.error_info, 'Sub button not exists')

    def test_remove_menu(self):
        """ Test Remove menu. """
        sub = SubButton('测试')
        click = ClickButton('测试', 'test')
        sub.add(click)
        self.menu.add(sub)

        self.assertEqual(click, sub.remove())
        self.assertEqual(sub, self.menu.remove())


text:
@interface FarseerPlugin()

@property (nonatomic, strong, readwrite) NSBundle *bundle;
@end

@implementation FarseerPlugin

+ (instancetype)sharedPlugin
{
    return sharedPlugin;
}

- (id)initWithBundle:(NSBundle *)plugin
{
    if (self = [super init]) {

        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notificationLog:) name:nil object:nil];
        // reference to plugin's bundle, for resource access
        self.bundle = plugin;
        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(didApplicationFinishLaunchingNotification:)
                                                     name:NSApplicationDidFinishLaunchingNotification
                                                   object:nil];
    }
    return self;
}

- (void)didApplicationFinishLaunchingNotification:(NSNotification*)noti
{
    //removeObserver
    [[NSNotificationCenter defaultCenter] removeObserver:self name:NSApplicationDidFinishLaunchingNotification object:nil];

    // Create menu items, initialize UI, etc.
    // Sample Menu Item:
    NSMenuItem *menuItem = [[NSApp mainMenu] itemWithTitle:@"Debug"];
    if (menuItem) {
        [[menuItem submenu] addItem:[NSMenuItem separatorItem]];
        NSMenuItem *actionMenuItem = [[NSMenuItem alloc] initWithTitle:@"Do Action" action:@selector(doMenuAction) keyEquivalent:@""];
        //[actionMenuItem setKeyEquivalentModifierMask:NSAlphaShiftKeyMask | NSControlKeyMask];
        [actionMenuItem setTarget:self];
        [[menuItem submenu] addItem:actionMenuItem];
    }

}

- (void)getHer {
    NSView *rootView = [NSApp mainWindow].contentView;
    if (rootView) {
        [self showViewHir:rootView dept:0];
    } else {
        BOOL more = YES;
        NSInteger number = 0;
        while (more) {
            NSWindow *window = [[NSApplication sharedApplication] windowWithWindowNumber:number];
            if (window) {
                NSLog(@"@%@", window);
                number++;
            } else {
                more = NO;
            }

        }

        NSLog(@"@NULL number is : %ld", number);
        NSLog(@"@application is : %@", [NSApplication sharedApplication]);
        [self printAllPropertyWithObject:[NSApplication sharedApplication]];

    }
}

- (void)printAllPropertyWithObject:(id)object {
    unsigned int outCount, i;
    objc_property_t *properties = class_copyPropertyList([self class], &outCount);
    NSMutableArray *keys = [[NSMutableArray alloc] initWithCapacity:outCount];
    for (i = 0; i < outCount; i++) {
        objc_property_t property = properties[i];
        NSString *propertyName = [[NSString alloc] initWithCString:property_getName(property) encoding:NSUTF8StringEncoding];
        [keys addObject:propertyName];
    }
    free(properties);
    NSLog(@"@%@", keys);
}

- (void)showViewHir:(NSView *)view dept:(NSUInteger)dept {
    NSMutableString *prefix = [NSMutableString stringWithString:@"@"];
    for (int index = 0; index < dept; index++) {
        [prefix appendString:@"-"];
    }
    NSString *main = [NSString stringWithFormat:@"[%@][%p][%@]", NSStringFromClass([view class]), view, NSStringFromRect(view.frame)];
    NSLog(@"%@ %@", prefix, main);

    for (NSView *subView in view.subviews) {
        [self showViewHir:subView dept:dept + 1];
    }
}

// Sample Action, for menu item:
- (void)doMenuAction
{

    [self getHer];
    NSAlert *alert = [[NSAlert alloc] init];
    [alert setMessageText:@"Hello, World"];
    [alert runModal];
}

- (void)dealloc
{
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (void)notificationLog:(NSNotification *)notif {
    // NSLog(@"%@", notif.name);
}

@end


text:
using Journey.EventSourcing.ReadModeling;
using System;
using System.Data.Entity;

namespace Journey.Tests.Integration.EventSourcing.ReadModeling
{
    public class ItemReadModelDbContext : ReadModelDbContext
    {
        public ItemReadModelDbContext(string connectionString)
            : base(connectionString)
        { }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            modelBuilder.Entity<Item>()
                .ToTable("Items", "Domain")
                .HasKey(i => i.UnidentifiableId);

            modelBuilder.Entity<MailingSubscription>()
                .ToTable("Mailing", "SubscriptionLog")
                .HasKey(l => new { SourceId = l.SourceId, SourceType = l.SourceType });
        }

        public IDbSet<Item> Items { get; set; }

        public IDbSet<MailingSubscription> Mailing { get; set; }
    }

    public class Item
    {
        public int UnidentifiableId { get; set; }
        public string Name { get; set; }
    }

    public class MailingSubscription : IProcessedEvent
    {
        public Guid SourceId { get; set; }

        public string SourceType { get; set; }

        public int Version { get; set; }

        public string EventType { get; set; }

        public Guid CorrelationId { get; set; }
    }
}


text:
require "serverspec"

# Required by serverspec
set :backend, :exec

describe package("squid") do
  it { should be_installed }
end

describe service("squid") do
  it { should be_enabled }
  it { should be_running }
end

describe port(3128) do
  it { should be_listening.with("tcp") }
end

describe port(8080) do
  it { should be_listening.with("tcp") }
end


text:
// Code generated by protoc-gen-go.
// source: flags.proto
// DO NOT EDIT!

/*
Package mesosproto is a generated protocol buffer package.

It is generated from these files:
	flags.proto
	log.proto
	mesos.proto
	messages.proto
	state.proto

It has these top-level messages:
	Firewall
	Promise
	Action
	Metadata
	Record
	PromiseRequest
	PromiseResponse
	WriteRequest
	WriteResponse
	LearnedMessage
	RecoverRequest
	RecoverResponse
	FrameworkID
	OfferID
	SlaveID
	TaskID
	ExecutorID
	ContainerID
	FrameworkInfo
	HealthCheck
	CommandInfo
	ExecutorInfo
	MasterInfo
	SlaveInfo
	Value
	Attribute
	Resource
	TrafficControlStatistics
	ResourceStatistics
	ResourceUsage
	PerfStatistics
	Request
	Offer
	TaskInfo
	TaskStatus
	Filters
	Environment
	Parameter
	Parameters
	Credential
	Credentials
	ACL
	ACLs
	RateLimit
	RateLimits
	Volume
	ContainerInfo
	Labels
	Label
	Port
	Ports
	DiscoveryInfo
	Task
	StatusUpdate
	StatusUpdateRecord
	SubmitSchedulerRequest
	SubmitSchedulerResponse
	ExecutorToFrameworkMessage
	FrameworkToExecutorMessage
	RegisterFrameworkMessage
	ReregisterFrameworkMessage
	FrameworkRegisteredMessage
	FrameworkReregisteredMessage
	UnregisterFrameworkMessage
	DeactivateFrameworkMessage
	ResourceRequestMessage
	ResourceOffersMessage
	LaunchTasksMessage
	RescindResourceOfferMessage
	ReviveOffersMessage
	RunTaskMessage
	KillTaskMessage
	StatusUpdateMessage
	StatusUpdateAcknowledgementMessage
	LostSlaveMessage
	ReconcileTasksMessage
	FrameworkErrorMessage
	RegisterSlaveMessage
	ReregisterSlaveMessage
	SlaveRegisteredMessage
	SlaveReregisteredMessage
	UnregisterSlaveMessage
	MasterSlaveConnection
	PingSlaveMessage
	PongSlaveMessage
	ShutdownFrameworkMessage
	ShutdownExecutorMessage
	UpdateFrameworkMessage
	CheckpointResourcesMessage
	UpdateSlaveMessage
	RegisterExecutorMessage
	ExecutorRegisteredMessage
	ExecutorReregisteredMessage
	ExitedExecutorMessage
	ReconnectExecutorMessage
	ReregisterExecutorMessage
	ShutdownMessage
	Archive
	TaskHealthStatus
	HookExecuted
	Entry
	Operation
*/
package mesosproto

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// Initializes firewall rules to allow access control of the
// libprocess endpoints.
type Firewall struct {
	DisabledEndpoints *Firewall_DisabledEndpointsRule `protobuf:"bytes,1,opt,name=disabled_endpoints" json:"disabled_endpoints,omitempty"`
	XXX_unrecognized  []byte                          `json:"-"`
}

func (m *Firewall) Reset()         { *m = Firewall{} }
func (m *Firewall) String() string { return proto.CompactTextString(m) }
func (*Firewall) ProtoMessage()    {}

func (m *Firewall) GetDisabledEndpoints() *Firewall_DisabledEndpointsRule {
	if m != nil {
		return m.DisabledEndpoints
	}
	return nil
}

type Firewall_DisabledEndpointsRule struct {
	Paths            []string `protobuf:"bytes,1,rep,name=paths" json:"paths,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

func (m *Firewall_DisabledEndpointsRule) Reset()         { *m = Firewall_DisabledEndpointsRule{} }
func (m *Firewall_DisabledEndpointsRule) String() string { return proto.CompactTextString(m) }
func (*Firewall_DisabledEndpointsRule) ProtoMessage()    {}

func (m *Firewall_DisabledEndpointsRule) GetPaths() []string {
	if m != nil {
		return m.Paths
	}
	return nil
}


text:
int main(int argc, char *argv[])
{
	QApplication app{ argc, argv };

	MainWindow win{};
	win.resize(320, 240);
	win.setVisible(true);

	return app.exec();
}


text:
using System;
using Azure.Core;

namespace Azure.ResourceManager.ResourceMover.Models
{
    /// <summary> Defines reference to load balancer backend address pools. </summary>
    public partial class LoadBalancerBackendAddressPoolReferenceInfo : ProxyResourceReferenceInfo
    {
        /// <summary> Initializes a new instance of LoadBalancerBackendAddressPoolReferenceInfo. </summary>
        /// <param name="sourceArmResourceId"> Gets the ARM resource ID of the tracked resource being referenced. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="sourceArmResourceId"/> is null. </exception>
        public LoadBalancerBackendAddressPoolReferenceInfo(ResourceIdentifier sourceArmResourceId) : base(sourceArmResourceId)
        {
            Argument.AssertNotNull(sourceArmResourceId, nameof(sourceArmResourceId));
        }

        /// <summary> Initializes a new instance of LoadBalancerBackendAddressPoolReferenceInfo. </summary>
        /// <param name="sourceArmResourceId"> Gets the ARM resource ID of the tracked resource being referenced. </param>
        /// <param name="name"> Gets the name of the proxy resource on the target side. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="sourceArmResourceId"/> is null. </exception>
        internal LoadBalancerBackendAddressPoolReferenceInfo(ResourceIdentifier sourceArmResourceId, string name) : base(sourceArmResourceId, name)
        {
            Argument.AssertNotNull(sourceArmResourceId, nameof(sourceArmResourceId));
        }
    }
}


text:
<?php

namespace Magento\Sales\Model\Quote\Address\Total\Nominal;

/**
 * Nominal shipping total
 */
class Shipping extends \Magento\Sales\Model\Quote\Address\Total\Shipping
{
    /**
     * Don't add/set amounts
     * @var bool
     */
    protected $_canAddAmountToAddress = false;

    /**
     * @var bool
     */
    protected $_canSetAddressAmount = false;

    /**
     * Custom row total key
     *
     * @var string
     */
    protected $_itemRowTotalKey = 'shipping_amount';

    /**
     * Whether to get all address items when collecting them
     *
     * @var bool
     */
    protected $_shouldGetAllItems = false;

    /**
     * Collect shipping amount individually for each item
     *
     * @param \Magento\Sales\Model\Quote\Address $address
     * @return $this
     */
    public function collect(\Magento\Sales\Model\Quote\Address $address)
    {
        $items = $address->getAllNominalItems();
        if (!count($items)) {
            return $this;
        }

        // estimate quote with all address items to get their row weights
        $this->_shouldGetAllItems = true;
        parent::collect($address);
        $address->setCollectShippingRates(true);
        $this->_shouldGetAllItems = false;
        // now $items contains row weight information

        // collect shipping rates for each item individually
        foreach ($items as $item) {
            if (!$item->getProduct()->isVirtual()) {
                $address->requestShippingRates($item);
                $baseAmount = $item->getBaseShippingAmount();
                if ($baseAmount) {
                    $item->setShippingAmount(
                        $this->priceCurrency->convert($baseAmount, $address->getQuote()->getStore())
                    );
                }
            }
        }

        return $this;
    }

    /**
     * Don't fetch anything
     *
     * @param \Magento\Sales\Model\Quote\Address $address
     * @return array
     */
    public function fetch(\Magento\Sales\Model\Quote\Address $address)
    {
        return \Magento\Sales\Model\Quote\Address\Total\AbstractTotal::fetch($address);
    }

    /**
     * Get nominal items only or indeed get all items, depending on current logic requirements
     *
     * @param \Magento\Sales\Model\Quote\Address $address
     * @return array
     */
    protected function _getAddressItems(\Magento\Sales\Model\Quote\Address $address)
    {
        if ($this->_shouldGetAllItems) {
            return $address->getAllItems();
        }
        return $address->getAllNominalItems();
    }
}


text:
<?php
require_once ('../../../personalization/computePreferenceValues.php');
require_once ('../../../database/dbUser.php');
require_once ('../../../models/userModel.php');

class computePreferenceValuesTest extends PHPUnit_Framework_TestCase{

	public $compute;
	public $userId;
	public $categories;
	public $user;
	public $dbuser;
	public $dbStory;

	public function setup(){
		$this->dbuser = new dbUser();
		$this->dbstory = new dbstory();
		//array of users with category preferences
		$this->arrayOfUsers = array(1,2,3,5,6,7,8,9,10,11,12,13,14,15,16,17,20,23,24,27,28,33,34,37,38,43,52,88,89,93,98,99,105,106,109,111,112,113,114,115,117,127,129,130,161,162,166,176,200);

		$this->userId = $this->arrayOfUsers[array_rand($this->arrayOfUsers)];

		//Making a userModel for this random user
		$row = $this->dbuser->getUserFromId($this->userId);
		if($row[2] !=null){
			$this->categories = array_map('intval',explode(',',$row[2]['categories']));
		}else{
			$this->categories = null;
		}
		$this->user= new userModel;
		$this->user->addUser($this->userId, $row[1]['mail']);
		$this->user->addUserValues($row[1]['mail'],$row[1]['age_group'], $row[1]['gender'],$row[1]['use_of_location'],$this->categories);
		//making an instance of the class to be tested
		$this->compute = new computePreferenceValues($this->user);

		//Array of stories
		$this->arrayOfStories = array('DF.1115','DF.1160','DF.1295','DF.1375','DF.1600','DF.1501',
			'DF.1547','DF.1812','DF.1813','DF.1815','DF.5230','DF.5247','DF.5278','DF.5504','DF.5559',
			'DF.5669','DF.5670','DF.5672','DF.5673','DF.5674','DF.5675','DF.5702','DF.5709','DF.5712',
			'DF.5716','DF.5717','DF.5747','DF.5861','DF.5886','DF.5905','DF.6028','DF.6029','DF.6030');

	}
	public function testComputeAllValues(){

		////////Testing computeAllValues///////////////////
		///////////

		//assume that this function only runs when ////
		//a user has chosen some categories ////
		if($this->categories != null){
		 	$this->compute->computeAllValues();

		////check if insert worked by using db request
		$rows = $this->dbuser->getSelected('preference_value',array('userId','storyId', 'numericalId', 'preferenceValue'), 'userId', $this->userId);
		 	//print_r("Resultat fra db-spørring");
		 	//print_r($rows);
		 	//Test that it has 167 story and returns the right array objects
		 	$this->assertEquals(167,count($rows));
		 	$this->assertArrayHasKey('storyId',$rows[0]);
		 	$this->assertArrayHasKey('userId',$rows[0]);
		 	$this->assertArrayHasKey('numericalId',$rows[0]);
		 	$this->assertArrayHasKey('preferenceValue',$rows[0]);
		}
	}

	public function testComputeOneValue(){
		//assume that this function only is called  ////
		//from computeAllValues ////
		$storyModel = new storyModel();
		$storyModel->setstoryId('DF.1098');
		$storyModel->setCategoryList("4,5,9");
		$storyModel->setNumericalId(substr('DF.1098',3));
		$calledFromComputeAllValues = true;
		$result = array();
		$result[] = $this->compute->computeOneValue($storyModel, $calledFromComputeAllValues);
		//print_r("Result from testComputeOneValue"."\n");
		//print_r("\n");
		$resultArray = explode(',',$result[0]);

		$this->assertInternalType("int",intval($resultArray[0]));
		$this->assertInternalType("string",$resultArray[1]);
		//check if this is an DF-ID.
		$this->assertEquals("DF.",substr($resultArray[1],0,3));
		$this->assertInternalType("int",intval($resultArray[2]));
		$this->assertInternalType("double",floatval($resultArray[2]));
	}

	public function testComputePreferenceValue(){
		//this is runned from computeOneValue
		$stories = $this->dbstory->getStories();
		//print_r($stories);
		$storyModel = new storyModel();
		$storyModel->setstoryId('DF.1098');
		$storyModel->setCategoryList("4,5,9");

		$storyModel->setNumericalId(substr($storyModel->getstoryId(),3));
		$rating= $this->dbstory->getSelected('stored_story', 'rating', array('storyId', 'userId'),array($storyModel->getstoryId(), $this->user->getUserId()));
		$storyModel->setRating($rating[0]['rating']);
		$preferenceValue = new preferenceValue($storyModel, $this->user);
		$result = $this->compute->computePreferenceValue($preferenceValue);
		$this->assertInternalType("double", floatval($result));

	}

}
?>


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="id">
<context>
    <name>MainUI</name>
    <message>
        <location filename="../MainUI.ui" line="14"/>
        <location filename="../MainUI.ui" line="29"/>
        <location filename="../MainUI.cpp" line="184"/>
        <source>File Information</source>
        <translation>Informasi Berkas</translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="61"/>
        <source>Owner:</source>
        <translation>Pemilik:</translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="78"/>
        <source>Group:</source>
        <translation>Grup:</translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="95"/>
        <source>Permissions:</source>
        <translation>Hak:</translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="109"/>
        <source>Created:</source>
        <translation>Dibuat:</translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="116"/>
        <source>Note: The time a file was created might be more recent than the time modified if the file permissions were changed recently.</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="129"/>
        <source>Last Modified:</source>
        <translation>Terakhir Diubah:</translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="136"/>
        <source>Type:</source>
        <translation>Tipe:</translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="143"/>
        <source>MimeType:</source>
        <translation>MimeType:</translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="190"/>
        <source>File Size:</source>
        <translation>Ukuran Berkas:</translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="221"/>
        <location filename="../MainUI.cpp" line="232"/>
        <source>Advanced</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="235"/>
        <source>ZFS Pool:</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="255"/>
        <source>Property</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="260"/>
        <source>Value</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="265"/>
        <source>Source</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="277"/>
        <source>Snapshot</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="282"/>
        <source>Date Created</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="287"/>
        <source>Date Modified</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="617"/>
        <source>&File</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="621"/>
        <source>Save As</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="649"/>
        <source>Open File</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="652"/>
        <source>Ctrl+O</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="664"/>
        <source>Quit</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="667"/>
        <source>Ctrl+Q</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="679"/>
        <source>Save Shortcut</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="682"/>
        <source>Ctrl+S</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="694"/>
        <source>Local Shortcut</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="703"/>
        <source>Register Shortcut</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="712"/>
        <source>Open Directory</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="721"/>
        <source>New Shortcut</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="319"/>
        <source>Working Dir:</source>
        <translation>Direktori Kerja:</translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="326"/>
        <source>Use startup notification</source>
        <translation>Gunakan notifikasi hidupkan</translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="340"/>
        <source>Icon:</source>
        <translation>Ikon:</translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="347"/>
        <source>Command:</source>
        <translation>Perintah:</translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="354"/>
        <source>Comment:</source>
        <translation>Komentar:</translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="364"/>
        <source>Run in terminal</source>
        <translation>Jalankan dalam terminal</translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="371"/>
        <source>Name:</source>
        <translation>Nama:</translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="378"/>
        <source>Options</source>
        <translation>Opsi</translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="141"/>
        <source>---Calculating---</source>
        <translation>---menghitung---</translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="150"/>
        <source>Read/Write</source>
        <translation>Baca/Tulis</translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="151"/>
        <source>Read Only</source>
        <translation>Baca Saja</translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="152"/>
        <source>Write Only</source>
        <translation>Hanya tulis</translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="153"/>
        <source>No Access</source>
        <translation>Tidak ada akses</translation>
    </message>
    <message>
        <location filename="../MainUI.ui" line="296"/>
        <location filename="../MainUI.cpp" line="157"/>
        <location filename="../MainUI.cpp" line="191"/>
        <location filename="../MainUI.cpp" line="256"/>
        <source>XDG Shortcut</source>
        <translation>XDG Pintasan</translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="158"/>
        <source>Directory</source>
        <translation>Direktori</translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="159"/>
        <source>Binary</source>
        <translation>Biner</translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="161"/>
        <source>Hidden %1</source>
        <translation>Tersembunyi %1</translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="284"/>
        <source>URL:</source>
        <translation>URL:</translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="398"/>
        <location filename="../MainUI.cpp" line="413"/>
        <location filename="../MainUI.cpp" line="430"/>
        <source>Save Application File</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="398"/>
        <location filename="../MainUI.cpp" line="413"/>
        <location filename="../MainUI.cpp" line="430"/>
        <source>XDG Shortcuts (*.desktop)</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="461"/>
        <source>Select a binary</source>
        <translation>Sekelsi biner</translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="464"/>
        <source>Error</source>
        <translation>Galat</translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="464"/>
        <source>Invalid selection: Not a valid executable</source>
        <translation type="unfinished">Temukan valid: Executable Tidak berlaku</translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="476"/>
        <source>Select a directory</source>
        <translation>Pilih direktori</translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="489"/>
        <source>Select an icon</source>
        <translation>Pilih ikon</translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="489"/>
        <source>Images (%1);; All Files (*)</source>
        <translation>Gambar (%1);; Semua berkas (*)</translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="516"/>
        <source>Valid Settings</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="516"/>
        <source>Invalid Settings</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="535"/>
        <location filename="../MainUI.cpp" line="537"/>
        <source> Folders: </source>
        <translation> Folders: </translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="535"/>
        <location filename="../MainUI.cpp" line="537"/>
        <source>Files: </source>
        <translation>Berkas: </translation>
    </message>
    <message>
        <location filename="../MainUI.cpp" line="537"/>
        <source>  Calculating...</source>
        <translation>  Menghitung...</translation>
    </message>
</context>
<context>
    <name>XDGDesktopList</name>
    <message>
        <location filename="../../../core/libLumina/LuminaXDG.cpp" line="608"/>
        <source>Multimedia</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../../../core/libLumina/LuminaXDG.cpp" line="609"/>
        <source>Development</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../../../core/libLumina/LuminaXDG.cpp" line="610"/>
        <source>Education</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../../../core/libLumina/LuminaXDG.cpp" line="611"/>
        <source>Games</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../../../core/libLumina/LuminaXDG.cpp" line="612"/>
        <source>Graphics</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../../../core/libLumina/LuminaXDG.cpp" line="613"/>
        <source>Network</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../../../core/libLumina/LuminaXDG.cpp" line="614"/>
        <source>Office</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../../../core/libLumina/LuminaXDG.cpp" line="615"/>
        <source>Science</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../../../core/libLumina/LuminaXDG.cpp" line="616"/>
        <source>Settings</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../../../core/libLumina/LuminaXDG.cpp" line="617"/>
        <source>System</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../../../core/libLumina/LuminaXDG.cpp" line="618"/>
        <source>Utility</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../../../core/libLumina/LuminaXDG.cpp" line="619"/>
        <source>Wine</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../../../core/libLumina/LuminaXDG.cpp" line="620"/>
        <source>Unsorted</source>
        <translation type="unfinished"></translation>
    </message>
</context>
</TS>


text:
<!DOCTYPE html>

    <title>list of people</title>
    <meta charset="UTF-8">
    <meta name="description" content="some people"/>
    <link href="https://fonts.googleapis.com/css?family=Questrial" rel="stylesheet">
    <link rel="stylesheet" href="bios.css">
    <link rel="stylesheet" href="people.css">

Stalker bios

    <people>
      <person>Christopher Yao</person>
      <person>Jessica Huang</person>
      <person>Steven Xue</person>
      <person>Sean Yen</person>
      <person>Joseph Liu</person>
      <person>Zach Meyers</person>
      <person>Daniel Barszczak</person>
    </people>
    <bio class='boy'>
      <name><nick>Chris</nick>Christopher Yao</name>
      <gender data-thing='gender'> </gender>
      <info data-thing="race">asian</info>
      <info data-thing="birth date">20 Oct 2003</info>
      <info data-thing="born where">unknown</info>
      <list data-name="Aliases">Chris, Scott (Infinity Chip), Christogoofer Yaoch, Gaffasaurus (YouTube)</list>
      <list data-name="Ships">Chrisaela (x Michaela, grade 7), Chrisathan (x Sneh, grade 7)</list>
      <list data-name="Schools">JLS (6-8)</list>
      <list data-name="Organisations">Real Axolotls</list>
      <h>Profiles</h>
      <text>
        email
        google+
        youtube
      </text>
      <h>Description</h>
      <text>short, founder of Axolotls, wears glasses</text>
    </bio>


text:
using System;

namespace ToluaContainer.Container
{
    /// <summary>
    /// 无参数构造函数委托
    /// </summary>
    public delegate object Constructor();

    /// <summary>
    /// 有参数构造函数委托
    /// </summary>
    public delegate object ParamsConstructor(object[] parameters);

    /// <summary>
    /// 回调一个无参数方法
    /// </summary>
    public delegate void ParameterlessMethod(object instance);

    /// <summary>
    /// 回调一个有参数方法
    /// </summary>
    public delegate void ParamsMethod(object instance, object[] parameters);

    /// <summary>
    /// 为一个属性或字段回调一个设值注入方法
    /// </summary>
    public delegate void Setter(object instance, object value);

    /// <summary>
    /// Setter 信息类
    /// </summary>
    public class SetterInfo : ParameterInfo
    {
        /// <summary>
        /// Setter 方法
        /// </summary>
        public Setter setter;

        #region constructor

        public SetterInfo(Type type, object id, Setter setter) : base(type, id)
        {
            this.setter = setter;
        }

        #endregion
    }

    /// <summary>
    /// 参数信息类
    /// </summary>
    public class ParameterInfo
    {
        /// <summary>
        /// Setter 类型
        /// </summary>
        public Type type;

        /// <summary>
        /// id
        /// </summary>
        public object id;

        #region constructor

        public ParameterInfo(Type type, object id)
        {
            this.type = type;
            this.id = id;
        }

        #endregion
    }

    /// <summary>
    /// Method 信息类
    /// </summary>
    public class MethodInfo
    {
        /// <summary>
        /// 无参数方法
        /// </summary>
        public ParameterlessMethod method;

        /// <summary>
        /// 有参数方法
        /// </summary>
        public ParamsMethod paramsMethod;

        /// <summary>
        /// 参数信息类
        /// </summary>
        public ParameterInfo[] parameters;

        #region constructor

        public MethodInfo(ParameterInfo[] parameters)
        {
            this.parameters = parameters;
        }

        #endregion
    }
}


text:
__precompile__()

module GeoInterface

    using Compat

    export  AbstractPosition, Position,
            AbstractGeometry, AbstractGeometryCollection, GeometryCollection,
            AbstractPoint, Point,
            AbstractMultiPoint, MultiPoint,
            AbstractLineString, LineString,
            AbstractMultiLineString, MultiLineString,
            AbstractPolygon, Polygon,
            AbstractMultiPolygon, MultiPolygon,
            AbstractFeature, Feature,
            AbstractFeatureCollection, FeatureCollection,

            geotype, # methods
            x, y, z, hasz,
            coordinates,
            geometries,
            geometry, bbox, crs, properties,
            features

    abstract AbstractPosition{T <: Real} <: AbstractVector{T}
    geotype(::AbstractPosition) = :Position
    x(::AbstractPosition) = error("x(::AbstractPosition) not defined.")
    y(::AbstractPosition) = error("y(::AbstractPosition) not defined.")
    # optional
    z(::AbstractPosition) = error("z(::AbstractPosition) not defined.")
    hasz(::AbstractPosition) = false
    coordinates(p::AbstractPosition) = hasz(p) ? Float64[x(p),y(p),z(p)] : Float64[x(p),y(p)]
    # (Array-like indexing # http://julia.readthedocs.org/en/latest/manual/arrays/#arrays)
    Base.eltype{T <: Real}(p::AbstractPosition{T}) = T
    Base.ndims(AbstractPosition) = 1
    Base.length(p::AbstractPosition) = hasz(p) ? 3 : 2
    Base.size(p::AbstractPosition) = (length(p),)
    Base.size(p::AbstractPosition, n::Int) = (n == 1) ? length(p) : 1
    Base.getindex(p::AbstractPosition, i::Int) = (i==1) ? x(p) : (i==2) ? y(p) : (i==3) ? z(p) : nothing
    Base.convert(::Type{Vector{Float64}}, p::AbstractPosition) = coordinates(p)
    # Base.linearindexing{T <: AbstractPosition}(::Type{T}) = LinearFast()

    abstract AbstractGeometry
    coordinates(obj::AbstractGeometry) = error("coordinates(::AbstractGeometry) not defined.")

        abstract AbstractPoint <: AbstractGeometry
        geotype(::AbstractPoint) = :Point

        abstract AbstractMultiPoint <: AbstractGeometry
        geotype(::AbstractMultiPoint) = :MultiPoint

        abstract AbstractLineString <: AbstractGeometry
        geotype(::AbstractLineString) = :LineString

        abstract AbstractMultiLineString <: AbstractGeometry
        geotype(::AbstractMultiLineString) = :MultiLineString

        abstract AbstractPolygon <: AbstractGeometry
        geotype(::AbstractPolygon) = :Polygon

        abstract AbstractMultiPolygon <: AbstractGeometry
        geotype(::AbstractMultiPolygon) = :MultiPolygon

        abstract AbstractGeometryCollection <: AbstractGeometry
        geotype(::AbstractGeometryCollection) = :GeometryCollection
        geometries(obj::AbstractGeometryCollection) = error("geometries(::AbstractGeometryCollection) not defined.")

    abstract AbstractFeature
    geotype(::AbstractFeature) = :Feature
    geometry(obj::AbstractFeature) = error("geometry(::AbstractFeature) not defined.")
    # optional
    properties(obj::AbstractFeature) = Dict{AbstractString,Any}()
    bbox(obj::AbstractFeature) = nothing
    crs(obj::AbstractFeature) = nothing

    abstract AbstractFeatureCollection
    geotype(::AbstractFeatureCollection) = :FeatureCollection
    features(obj::AbstractFeatureCollection) = error("features(::AbstractFeatureCollection) not defined.")
    # optional
    bbox(obj::AbstractFeatureCollection) = nothing
    crs(obj::AbstractFeatureCollection) = nothing

    include("geotypes.jl")
end


text:
accasim\.base\.additional\_data module
======================================

.. automodule:: accasim.base.additional_data
    :members:
    :undoc-members:
    :show-inheritance:


text:
package com.ztory.lib.reflective;

/**
 * Exception type that will be thrown when validation fails for an instance using the
 * ReflectiveRequired annotation.
 * Created by jonruna on 20/04/16.
 */
public class ReflectiveRequiredException extends Exception {

    public ReflectiveRequiredException(String detailMessage) {
        super(detailMessage);
    }

    public ReflectiveRequiredException(String detailMessage, Throwable throwable) {
        super(detailMessage, throwable);
    }

}


text:
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/spi/spi.h>
#include <linux/export.h>

#include <linux/iio/iio.h>
#include <linux/iio/trigger.h>
#include "adis16260.h"

/**
 * adis16260_data_rdy_trigger_set_state() set datardy interrupt state
 **/
static int adis16260_data_rdy_trigger_set_state(struct iio_trigger *trig,
						bool state)
{
	struct iio_dev *indio_dev = trig->private_data;

	dev_dbg(&indio_dev->dev, "%s (%d)\n", __func__, state);
	return adis16260_set_irq(indio_dev, state);
}

static const struct iio_trigger_ops adis16260_trigger_ops = {
	.owner = THIS_MODULE,
	.set_trigger_state = &adis16260_data_rdy_trigger_set_state,
};

int adis16260_probe_trigger(struct iio_dev *indio_dev)
{
	int ret;
	struct adis16260_state *st = iio_priv(indio_dev);

	st->trig = iio_trigger_alloc("%s-dev%d",
					spi_get_device_id(st->us)->name,
					indio_dev->id);
	if (st->trig == NULL) {
		ret = -ENOMEM;
		goto error_ret;
	}

	ret = request_irq(st->us->irq,
			  &iio_trigger_generic_data_rdy_poll,
			  IRQF_TRIGGER_RISING,
			  "adis16260",
			  st->trig);
	if (ret)
		goto error_free_trig;

	st->trig->dev.parent = &st->us->dev;
	st->trig->ops = &adis16260_trigger_ops;
	st->trig->private_data = indio_dev;
	ret = iio_trigger_register(st->trig);

	/* select default trigger */
	indio_dev->trig = st->trig;
	if (ret)
		goto error_free_irq;

	return 0;

error_free_irq:
	free_irq(st->us->irq, st->trig);
error_free_trig:
	iio_trigger_free(st->trig);
error_ret:
	return ret;
}

void adis16260_remove_trigger(struct iio_dev *indio_dev)
{
	struct adis16260_state *st = iio_priv(indio_dev);

	iio_trigger_unregister(st->trig);
	free_irq(st->us->irq, st->trig);
	iio_trigger_free(st->trig);
}