text:
//****************************************************************************//
// File:          qcan_config.cpp                                             //
// Description:   Additional Device Configuration QCAN interface               //
//                                                                            //
// Copyright (C) MicroControl GmbH & Co. KG                                   //
// 53842 Troisdorf - Germany                                                  //
// www.microcontrol.net                                                       //
//                                                                            //
//----------------------------------------------------------------------------//
// Redistribution and use in source and binary forms, with or without         //
// modification, are permitted provided that the following conditions         //
// are met:                                                                   //
// 1. Redistributions of source code must retain the above copyright          //
//    notice, this list of conditions, the following disclaimer and           //
//    the referenced file 'COPYING'.                                          //
// 2. Redistributions in binary form must reproduce the above copyright       //
//    notice, this list of conditions and the following disclaimer in the     //
//    documentation and/or other materials provided with the distribution.    //
// 3. Neither the name of MicroControl nor the names of its contributors      //
//    may be used to endorse or promote products derived from this software   //
//    without specific prior written permission.                              //
//                                                                            //
// Provided that this notice is retained in full, this software may be        //
// distributed under the terms of the GNU Lesser General Public License       //
// ("LGPL") version 3 as distributed in the 'COPYING' file.                   //
//                                                                            //
//============================================================================//

/*----------------------------------------------------------------------------*\
** Include files                                                              **
**                                                                            **
\*----------------------------------------------------------------------------*/

#include "qcan_config.hpp"

//----------------------------------------------------------------------------//
// QCanConfig                                                                 //
//                                                                            //
//----------------------------------------------------------------------------//
QCanConfig::QCanConfig(QCanUsart::QCanUsartConfig_ts &tsConfigurationR, QWidget *parent)
   : QDialog(parent)
{
   //-----------------------------------------------------------------
   // setup GUI
   //
   clQCanCfgGuiP.setupUi(this);

   tsCurrentConfigP = tsConfigurationR;

   //-----------------------------------------------------------------
   // initialise parameter of CAN Hardware
   //
   clQCanCfgGuiP.groupBox->setTitle(tsCurrentConfigP.clName);

   //----------------------------------------------------------------
   // check requested COM Port is available
   //
   QStringList clStringListT;
   clStringListT.clear();
   qint32 slCurrentIndexT = 0;
   foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts())
   {
      if (info.portName() == tsCurrentConfigP.clName)
      {
         foreach (const qint32 &infoBaud, QSerialPortInfo::standardBaudRates())
         {
            clStringListT.append(QString::number(infoBaud,10));

            if (tsCurrentConfigP.slBaud == qint32(infoBaud))
            {
               slCurrentIndexT = clStringListT.count()-1;
            }
         }
      }
   }

   //----------------------------------------------------------------
   // insert default baud rates and select current one
   //
   clQCanCfgGuiP.clComboBoxCOMBaud->insertItems(0,clStringListT);
   clQCanCfgGuiP.clComboBoxCOMBaud->setCurrentIndex(slCurrentIndexT);

   //----------------------------------------------------------------
   // insert default baud rates and select current one
   //
   clStringListT.clear();
   clStringListT << "8N1" << "8E1" << "8O1";
   clQCanCfgGuiP.clComboBoxCOMMode->insertItems(0,clStringListT);
   clQCanCfgGuiP.clComboBoxCOMMode->setCurrentIndex(tsCurrentConfigP.ubMode-4);

   //----------------------------------------------------------------
   // insert default baud rates and select current one
   //
   clStringListT.clear();
   clStringListT << "Rx & Tx OFF" << "Only Rx" << "Only Tx" << "Rx & Tx ON" << "RS485";
   clQCanCfgGuiP.clComboBoxCOMDirection->insertItems(0,clStringListT);
   clQCanCfgGuiP.clComboBoxCOMDirection->setCurrentIndex(tsCurrentConfigP.ubDirection);
}

//----------------------------------------------------------------------------//
// currentConfig                                                              //
//                                                                            //
//----------------------------------------------------------------------------//
QCanUsart::QCanUsartConfig_ts & QCanConfig::currentConfig()
{
   tsCurrentConfigP.ubDirection = clQCanCfgGuiP.clComboBoxCOMDirection->currentIndex();
   tsCurrentConfigP.ubMode = (clQCanCfgGuiP.clComboBoxCOMMode->currentIndex()+4);

   return tsCurrentConfigP;
}


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Bash | FOP 2017 | NUS Computing</title>
		<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700%7CLato:400,900">
		<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200&text=2017">
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
		<link rel="stylesheet" href="https://freshmen.nuscomputing.com/css/app.css">
		<link rel="icon" href="https://freshmen.nuscomputing.com/favicon.ico">

Freshmen Orientation Projects 2017

			<button class="btn menu-btn">Open Menu</button>
			<button class="btn show-menu">Show Menu</button>

FSC

FOW

RAG

FLAG

BASH

Celebrate

Bash

18 August

					It's time to party! BASH marks the final event of FOP where you get to celebrate
					and party at a club with your new university friends. Enjoy a night of spectacular
					performances put up by our pageant candidates. The new Mr and Ms SoC will be crowned
					on the very same night! Join in on the fun and games and celebrate the night away. Did
					we mention that there's afterparty?

See you on 18 August at f. Club Singapore! Cheers!

				BASH has been a pleasant experience for me and I myself have never entered
				a club prior to BASH. The event provided a splendid opportunity to party the
				night away with all the new friends I made during summer.

Kwok Jiahui, Year 1 Information Systems Student

Click here to read more about Bash from your seniors!

Our very own in house DJ playing up the numbers for the house!

						Other than performing, our pageants will also go through a series of spontaneous
						Q&A and fun activities with our hosts for the night. Get to know more about the
						finalists while you party the night away!

						At the end of Bash, we will crown Mr and Miss SoC with the help of our judges
						and the crowd's votes.

						After the crowning of Mr and Miss SoC, the event will have officially ended.
						But that is not the end of the night - party away with your fellow
						coursemates and seniors at the after party!

What your seniors have to say about Bash!

								BASH officially marks the end of my term as Computing Club's Freshmen
								Orientation Projects Director for the year 2016. I am thankful for
								BASH as I was able to unwind from summer's jam-packed fun-filled
								activities.

Low Wei Kit, Year 3 Computer Science Student

								BASH was an unforgettable event as it marks the end of summer, which
								also means the semester has officially begun with all the schoolwork
								and projects. The freshmen and I had lots of fun throughout the entire
								event. I am thankful for BASH as I was given an opportunity to perform
								on stage. It was my first-ever performance too!

Koh Min Xuan, Year 1 Information Systems Student

								The experience was memorable as the venue was filled with familiar faces
								and everyone simply wanted to have fun. BASH was a great event to have
								everyone who was involved in the summer projects to gather, let down our
								hair and create memories that would last. I am already looking forward to
								BASH in the following year!

Clarisse Lim, Year 1 Information Systems Student

								I had an eventful summer with NUS School of Computing and BASH was a good
								way to officially end FOP. BASH was a great opportunity to spend time with
								friends that I have made over summer.

Loh Cai Jun, Year 1 Computer Science Student

Proudly brought to you by these awesome people

Sim Kwan Tiong Damien

Project Director

Lee Yun Lin Nivian

Vice Project Director

Ang Wei Ping

Committee

Chang Yu Wei

Committee

Kerk Zhu Zhi

Committee

Koh Min Xuan

Committee

Low Rui Jia

Committee

Sim Teng Kuan Joel

Committee

Surekha Kattula

Committee

Tan Chee Wee

Committee

Background pattern Symphony from subtlepatterns.com used under CC BY-SA 3.0

What are you waiting for? Sign up for FOP now!

Alright, count me in! (Sign up here)

Email UsOur YouTube ChannelFollow us on FacebookFork this on GitHub

A project by NUS Students' Computing Club. Last updated
					<time title="2017-06-10T15:36:12+08:00">Jun 10 2017, 3:36:12pm. </time>

					Site designed and coded by Zhang Yi Jiang, and maintained by the NUS Students' Computing Club IT cell.
Video editing by Wang Xien Dong.
					Logo design by Rebecca Tan.

redpajama_set_name: RedPajamaGithub


text:
/*
 * ALMA - Atacama Large Millimiter Array (c) European Southern Observatory, 2007
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library; if not, write to the Free Software Foundation, Inc.,
 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */
package alma.acsplugins.alarmsystem.gui.tree;

import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;

import cern.laser.client.data.Alarm;

import alma.acs.gui.util.threadsupport.EDTExecutor;

/**
 * The model for the tree of reduced alarms.
 *

 * The model is changed only inside the swing event dispatcher thread
 * to ensure thread safety.
 *
 * @author acaproni
 *
 */
public class AlarmTreeModel extends DefaultTreeModel {

	/**
	 * The content of each node
	 *

	 * The purpose of this class is to show only the ID of each
	 * alarm in every node
	 *
	 * @author acaproni
	 *
	 */
	public class NodeContent {
		/**
		 * The alarm whose ID is show in a node
		 */
		private final Alarm alarm;

		/**
		 * Constructor
		 *
		 * @param al The alarm shown in the node
		 */
		public NodeContent(Alarm al) {
			if (al==null) {
				throw new IllegalArgumentException("The content can't be null");
			}
			alarm=al;
		}

		@Override
		public String toString() {
			StringBuilder str = new StringBuilder(alarm.getTriplet().getFaultMember());
			str.append(' ');
			str.append(alarm.getTriplet().getFaultCode());
			str.append(": ");
			str.append(alarm.getProblemDescription());
			return str.toString();
		}
	}

	/**
	 * constructor
	 *
	 * @param rootNode The root node
	 */
	public AlarmTreeModel(DefaultMutableTreeNode rootNode) {
		super(rootNode);
	}

	/**
	 * Add an alarm as a child of the passed node
	 *
	 * @param al The alarm to add
	 * @param parent The parent node;
	 * 				if it is null the child is added to the root node
	 * @return The newly added node
	 */
	public DefaultMutableTreeNode addChild(Alarm al, DefaultMutableTreeNode parent) {
		if (al==null) {
			throw new IllegalArgumentException("The alarm can't be null");
		}
		if (parent == null) {
			parent=(DefaultMutableTreeNode)root;
		}
		final DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(new NodeContent(al));
		final DefaultMutableTreeNode parentNode=parent;
		try {
			// Inside the EDT for safety
			EDTExecutor.instance().executeSync(new Runnable() {
				public void run() {
					insertNodeInto(newNode, parentNode, 0);
					nodeStructureChanged(parentNode);
				}
			});
		} catch (Exception e) {
			// What to do in this case?
			e.printStackTrace();
		}

		return newNode;
	}

	/**
	 * Empty the tree and set the passed alarm as the root
	 *
	 * @param label The string to set as label of the root node
	 */
	public void clearTree(final Alarm al) {
		// Inside the EDT for safety
		EDTExecutor.instance().execute(new Runnable() {
			public void run() {
				for (int t=0; t<root.getChildCount(); t++) {
					DefaultMutableTreeNode node = (DefaultMutableTreeNode)root.getChildAt(t);
					removeNodeFromParent(node);
				}
				((DefaultMutableTreeNode)root).setUserObject(al);
				nodeStructureChanged(root);
			}
		});
	}
}


text:
import { Observable } from 'rxjs/Observable';
/**
 * @name AdMob
 * @description
 * @usage
 */
export declare class AdMob {
    /**
     *
     * @param adIdOrOptions
     */
    static createBanner(adIdOrOptions: any): Promise<any>;
    /**
     *
     */
    static removeBanner(): void;
    /**
     *
     * @param position
     */
    static showBanner(position: any): void;
    /**
     *
     * @param x
     * @param y
     */
    static showBannerAtXY(x: number, y: number): void;
    /**
     *
     */
    static hideBanner(): void;
    /**
     *
     * @param adIdOrOptions
     */
    static prepareInterstitial(adIdOrOptions: any): Promise<any>;
    /**
     * Show interstitial
     */
    static showInterstitial(): void;
    /**
     *
     */
    static isInterstitialReady(): Promise<boolean>;
    /**
     * Prepare a reward video ad
     * @param adIdOrOptions
     */
    static prepareRewardVideoAd(adIdOrOptions: any): Promise<any>;
    /**
     * Show a reward video ad
     */
    static showRewardVideoAd(): void;
    /**
     * Sets the values for configuration and targeting
     * @param options Returns a promise that resolves if the options are set successfully
     */
    static setOptions(options: any): Promise<any>;
    /**
     * Get user ad settings
     * @returns {Promise<any>} Returns a promise that resolves with the ad settings
     */
    static getAdSettings(): Promise<any>;
    static onBannerFailedToReceive(): Observable<any>;
    static onBannerReceive(): Observable<any>;
    static onBannerPresent(): Observable<any>;
    static onBannerLeaveApp(): Observable<any>;
    static onBannerDismiss(): Observable<any>;
    static onInterstitialFailedToReceive(): Observable<any>;
    static onInterstitialReceive(): Observable<any>;
    static onInterstitialPresent(): Observable<any>;
    static onInterstitialLeaveApp(): Observable<any>;
    static onInterstitialDismiss(): Observable<any>;
}


text:
smarthouseServer
================

smarthouseServer


text:
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta name="Content-Style" content="text/css">
<title>TIFFSV</title>

TIFFSV

NAME

SYNOPSIS

DESCRIPTION

OPTIONS

NOTE

BUGS

SEE ALSO

NAME

tiffsv − save an image from the framebuffer in a
TIFF file (Silicon Graphics version)

SYNOPSIS

tiffsv [ options ] output.tif [
x1 x2 y1 y2 ]

DESCRIPTION

tiffsv saves all or part of the framebuffer in a
file using the Tag Image File Format, Revision 6.0. By
default, the image is saved with data samples packed
(PlanarConfiguration=1), compressed with the
Lempel-Ziv & Welch algorithm (Compression=5), and
with each strip no more than 8 kilobytes. These
characteristics can be overridden, or explicitly specified
with the options described below.

OPTIONS

−b

Save the image as a greyscale image as if it were
processed by tiff2bw(1). This option is included for
compatibility with the standard scrsave(6D)
program.

−c

Specify the compression to use for data written to the
output file: none for no compression, packbits
for PackBits compression, jpeg for baseline JPEG
compression, zip for Deflate compression, and
lzw for Lempel-Ziv & Welch compression
(default).

LZW compression can be specified together
with a predictor value. A predictor value of 2 causes
each scanline of the output image to undergo horizontal
differencing before it is encoded; a value of 1 forces each
scanline to be encoded without differencing. LZW-specific
options are specified by appending a
‘‘:’’-separated list to the
‘‘lzw’’ option; e.g. −c
lzw:2 for LZW compression with horizontal
differencing.

−p

Specify the planar configuration to use in writing image
data. By default, tiffsv will create a new file with
the data samples packed contiguously. Specifying −p
contig will force data to be written with multi-sample
data packed together, while −p separate will
force samples to be written in separate planes.

−r

Specify the number of rows (scanlines) in each strip of
data written to the output file. By default, tiffsv
attempts to set the rows/strip that no more than 8 kilobytes
of data appear in a strip.

NOTE

Except for the use of TIFF, this program
is equivalent to the standard scrsave program. This
means, for example, that you can use it in conjunction with
the standard icut program simply by creating a link
called scrsave, or by creating a shell script called
scrsave that invokes tiffgt with the
appropriate options.

BUGS

If data are saved compressed and in separate planes, then
the rows in each strip is silently set to one to avoid
limitations in the libtiff(3TIFF) library.

SEE ALSO

scrsave(6D) pal2rgb(1), tiffdump(1),
tiffgt(1), tiffinfo(1), tiffcp(1),
tiffmedian(1), libtiff(3TIFF)

Libtiff library home page:
http://www.remotesensing.org/libtiff/


text:
.. vim: set fileencoding=UTF-8 :
.. vim: set tw=80 :
.. include:: globals.rst

Caching asynchronous methods
============================

.. automodule:: tornadotools.caching


text:
from django.db import models
import time
# Create your models here.

class PlayerManager(models.Manager):

    def get_by_natural_key(self, username):
        return self.get(username=username)

class Player(models.Model):

    objects = PlayerManager()
    username=models.CharField(max_length=12, unique=True, default="")

    email = models.CharField(max_length=12, default="guest", unique=True)

    password = models.CharField(max_length=128, default="abc")

    score = models.PositiveIntegerField(default=100)

    date_joined = models.IntegerField(default=time.time)

    class Meta:
        unique_together=(('username'),)

    def __str__(self):

        return self.username

    # http://stackoverflow.com/questions/3715103/password-field-in-django-model/3715382#3715382
    #This is to prevent storing the password as plain text. I think..?
    def set_password(self, raw_password):
        import random
        algo = 'sha1'
        salt = get_hexdigest(algo, str(random.random()), str(random.random()))[:5]
        hsh = get_hexdigest(algo, salt, raw_password)
        self.password = '%s$%s$%s' % (algo, salt, hsh)


text:
package sunlabs.brazil.appengine;

import sunlabs.brazil.template.RewriteContext;
import sunlabs.brazil.template.Template;

import java.util.Properties;
import java.util.StringTokenizer;

import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

/**
 * AppEngine version of SMTPHandler using JavaMail.
 * Only the "singleton" tag is supported (for now).
 * @author suhler@google.com
 *
 */

public class SendMail extends Template {

  /**
   * <sendmail to|cc|bcc="a,b,c ...."  from="  ", subject="  " body="  " />
   * Messages are sent as plain text, unless "subtype" is used to set an alternamte
   * text subtype.
   * @param hr
   */

  public void tag_sendmail(RewriteContext hr) {
    debug(hr);
    hr.killToken();

    String to = hr.get("to");
    if (to == null) {
      debug(hr, "to missing");
      return;
    }
    Properties props = new Properties();
    Session session = Session.getDefaultInstance(props, null);
    try {
        Message msg = new MimeMessage(session);
        msg.setFrom(new InternetAddress(hr.get("from")));

        StringTokenizer st = new StringTokenizer(to, ", \t");
        while(st.hasMoreTokens()) {
          String rcpt = st.nextToken();
          msg.addRecipient(Message.RecipientType.TO,
              new InternetAddress(rcpt));
        }

        st = new StringTokenizer(hr.get("cc", ""), ", \t");
        while(st.hasMoreTokens()) {
          String rcpt = st.nextToken();
          msg.addRecipient(Message.RecipientType.CC,
              new InternetAddress(rcpt));
        }

        st = new StringTokenizer(hr.get("bcc", ""), ", \t");
        while(st.hasMoreTokens()) {
          String rcpt = st.nextToken();
          msg.addRecipient(Message.RecipientType.BCC,
              new InternetAddress(rcpt));
        }

        String subject = hr.get("subject");
        if (subject != null) {
          msg.setSubject(subject);
        }
        String body = hr.get("body");
        // String charset=hr.get("charset", "UTF-8");
        String type = hr.get("subtype","plain");
        if (body != null) {
          // msg.setText(body); // this works for plain text
          //msg.setText(body, charset, type); // XXX not supported on app engine
          msg.setContent(body, "text/" + type);
        }
        Transport.send(msg);
    } catch (AddressException e) {
        e.printStackTrace();
        debug(hr, e.getMessage());
    } catch (MessagingException e) {
        e.printStackTrace();
        debug(hr, e.getMessage());
    }
  }
}


text:
/* eslint-env browser */

import '@webex/plugin-authorization-browser';
import StorageAdapterLocalStorage from '@webex/storage-adapter-local-storage';
import WebexCore from '@webex/webex-core';
import pkg from '../../../package';

const webex = window.webex = new WebexCore({
  config: {
    credentials: {
      refreshCallback(webex, token) {
        return webex.request({
          method: 'POST',
          uri: '/refresh',
          body: {
            // eslint-disable-next-line camelcase
            refresh_token: token.refresh_token
          }
        })
          .then((res) => res.body);
      }
    },
    storage: {
      boundedAdapter: new StorageAdapterLocalStorage('webex')
    }
  }
});

webex.once('ready', () => {
  if (webex.canAuthorize) {
    document.getElementById('access-token').innerHTML = webex.credentials.supertoken.access_token;
    document.getElementById('refresh-token').innerHTML = webex.credentials.supertoken.refresh_token;

    webex.request({
      uri: 'https://locus-a.wbx2.com/locus/api/v1/ping'
    })
      .then(() => {
        document.getElementById('ping-complete').innerHTML = 'success';
      });
  }
});

// ready class implies js has loaded and selenium can start doing stuff
document.body.classList.add('ready');

document.getElementById('initiate-implicit-grant').addEventListener('click', () => {
  webex.authorization.initiateLogin({
    state: {name: pkg.name}
  });
});

document.getElementById('initiate-authorization-code-grant').addEventListener('click', () => {
  webex.config.credentials.clientType = 'confidential';
  webex.authorization.initiateLogin({
    state: {name: pkg.name}
  });
});

document.getElementById('token-refresh').addEventListener('click', () => {
  document.getElementById('access-token').innerHTML = '';
  webex.refresh({force: true})
    .then(() => {
      document.getElementById('access-token').innerHTML = webex.credentials.supertoken.access_token;
      document.getElementById('refresh-token').innerHTML = webex.credentials.supertoken.refresh_token;
    });
});

document.getElementById('logout').addEventListener('click', () => {
  webex.logout();
});


text:
from ctypes import byref
from typing import List, Optional

from sdl2 import *
from sdl2.sdlimage import *

class WindowManager:
    """The Window Manager

    This class contains the SDL Window, and handles the viewport and display.

    Attributes:
        driftwood: Base class instance.
        window: The SDL Window.
        renderer: The SDL Renderer attached to the window.
    """

    def __init__(self, driftwood):
        """WindowManager class initializer.

        Initializes SDL, and creates a window and a renderer.

        Args:
            driftwood: Base class instance.
        """
        self.driftwood = driftwood

        # The resolution that the game wants to pretend it is running at.
        # (See physical_width in __prepare() for comparison.)
        self.__logical_width = self.driftwood.config["window"]["width"]
        self.__logical_height = self.driftwood.config["window"]["height"]

        # The SDL Window and Renderer.
        self.window = None
        self.renderer = None

        self.__prepare()

        self.driftwood.tick.register(self._tick, delay=1.0 / self.driftwood.config["window"]["maxfps"],
                                     during_pause=True)

    def title(self, title: str) -> bool:
        """Set the window title.

        Args:
            title: The new title to be set.

        Returns:
            True if succeeded, False if failed.
        """
        # Input Check
        try:
            CHECK(title, str)
        except CheckFailure as e:
            self.driftwood.log.msg("ERROR", "Window", "title", "bad argument", e)
            return False

        SDL_SetWindowTitle(self.window, title.encode())
        return True

    def refresh(self, area: bool = False) -> bool:
        """Force the window to redraw.

        Args:
            area: Whether to mark the area changed as well.

        Returns:
            True if succeeded, False if failed.
        """
        # Input Check
        try:
            CHECK(area, bool)
        except CheckFailure as e:
            self.driftwood.log.msg("ERROR", "Window", "refresh", "bad argument", e)
            return False

        self.driftwood.frame.changed = self.driftwood.frame.STATE_CHANGED
        if area:
            self.driftwood.area.changed = True
        return True

    def resolution(self) -> List[int]:
        """Query the logical resolution of the window. This is different from the window dimensions.

        Returns: A tuple containing the resolution.
        """
        return [self.__logical_width, self.__logical_height]

    def resize(self, width: int, height: int) -> bool:
        """Change the logical resolution of the window.

        Warning: This will also reset WidgetManager.

        Args:
            width: The new logical width.
            height: The new logical height.

        Returns: True if succeeded, False if failed.
        """
        # Input Check
        try:
            CHECK(width, int, _min=1)
            CHECK(height, int, _min=1)
        except CheckFailure as e:
            self.driftwood.log.msg("ERROR", "Window", "resolution", "bad argument", e)
            return False

        # Set the new resolution.
        self.__logical_width = width
        self.__logical_height = height

        # If WidgetManager is initialized yet, reset it.
        if "widget" in dir(self.driftwood):
            self.driftwood.widget.reset()

        return True

    def zoom(self, factor):
        """Zoom the window.

        Args:
            factor: Integer zoom amount.

        Returns:
            Tuple containing new window resolution if succeeded, None if failed.
        """
        width = self.driftwood.config["window"]["width"]
        height = self.driftwood.config["window"]["height"]
        if self.resize(width // factor, height // factor):
            return self.resolution()
        return None

    def _tick(self, seconds_past: float) -> None:
        """Tick callback which refreshes the renderer.
        """
        if self.driftwood.frame.changed:
            SDL_RenderSetLogicalSize(self.renderer,
                                     self.__logical_width, self.__logical_height)  # Set logical size.

            SDL_RenderClear(self.renderer)

            if self.driftwood.frame._frame:  # This might not exist if we didn't find init.py.
                r = SDL_RenderCopy(self.renderer, *self.driftwood.frame._frame)
                if type(r) is int and r < 0:
                    self.driftwood.log.msg("ERROR", "Window", "_tick", "SDL", SDL_GetError())

            SDL_RenderSetLogicalSize(self.renderer, 0, 0)  # reset
            self.driftwood.frame.changed -= 1

            SDL_RenderPresent(self.renderer)

    def __prepare(self) -> None:
        """Prepare the window for use.

        Create a new window and renderer with the configured settings.
        """
        if SDL_Init(SDL_INIT_EVERYTHING) < 0:  # Couldn't init SDL.
            self.driftwood.log.msg("ERROR", "Window", "__prepare", "SDL", SDL_GetError())
        init_flags = IMG_INIT_JPG | IMG_INIT_PNG
        if IMG_Init(init_flags) & init_flags != init_flags:  # Couldn't init SDL_Image.
            self.driftwood.log.msg("ERROR", "Window", "__prepare", "SDL", SDL_GetError())

        if self.driftwood.config["window"]["fullscreen"]:
            # Desktop's current width and height
            physical_width = 0
            physical_height = 0

            # No video mode change
            flags = SDL_WINDOW_FULLSCREEN_DESKTOP
        else:
            # 1-to-1 mapping between logical and physical pixels
            physical_width = self.__logical_width
            physical_height = self.__logical_height
            flags = 0

        flags |= SDL_WINDOW_ALLOW_HIGHDPI
        self.window = SDL_CreateWindow(self.driftwood.config["window"]["title"].encode(), SDL_WINDOWPOS_CENTERED,
                                       SDL_WINDOWPOS_CENTERED, physical_width, physical_height, flags)

        self.renderer = SDL_CreateRenderer(self.window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC)
        if not self.renderer:  # We don't have hardware rendering on this machine.
            self.driftwood.log.info("Window", "SDL", "falling back to software renderer")
            self.renderer = SDL_CreateRenderer(self.window, -1, SDL_RENDERER_SOFTWARE)
            if not self.renderer:  # Still no.
                self.driftwood.log.msg("ERROR", "Window", "__prepare", "SDL", SDL_GetError())

        # Pixelated goodness, like a rebel.
        SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, b"nearest")

        # Since the computer might have multiple monitors, we can now look at the monitor our window is on for a
        # singular FPS.
        self.__setup_fps()

    def __setup_fps(self) -> None:
        """Query SDL to determine our monitor's refresh rate. Use this to set the engine's maximum frames per second
        if it's not already set.
        """
        if self.driftwood.config["window"]["maxfps"] == 0:
            display = SDL_GetWindowDisplayIndex(self.window)
            display_mode = SDL_DisplayMode()
            SDL_GetCurrentDisplayMode(display, byref(display_mode))
            refresh_rate = display_mode.refresh_rate

            if not refresh_rate:
                refresh_rate = 60

            self.driftwood.config["window"]["maxfps"] = refresh_rate

    def _terminate(self) -> None:
        """Cleanup before deletion.
        """
        SDL_DestroyRenderer(self.renderer)
        self.renderer = None
        SDL_DestroyWindow(self.window)
        self.window = None

        IMG_Quit()
        SDL_Quit()


text:
/**
 * @Project: JAYAYA CRM
 * @Author: Equipe JAYAYA
 * @Description: Definition du Layout de l'onglet Toutes les conversations du navigateur Conversations
 * @version: 1.0
 */

var mesConv_onglet_contacts = o_conv_client.newVerticalLayout();
o_conv_client.addCssClass("content_clients_allConv");

	// Bloc liste de toutes les conversations
	var content_liste_my_conversations = mesConv_onglet_contacts.newVerticalLayout();
	var liste_conversations_mine = new GraphicalList();
	liste_conversations_mine.addCssClass("liste");
	liste_conversations_mine.addCssClass("liste_conversations");

	var conversations = DatasBuffer.getRequest("/billets/personne")[0];
	if(conversations && conversations !== null){
		for(var i = 0;i < conversations.idB.length; i++){
			var messages = DatasBuffer.getRequest("/billets/"+conversations.idB[i]+"/messages");
			var billet = DatasBuffer.getRequest("/billets/"+conversations.idB[i])[0];
			// Creation des items de la liste
			if(messages)
				liste_conversations_mine.addItem('
'+billet.titre+'

'+messages.length+' '+_("commentaires")+'
',billet._id);
			else liste_conversations_mine.addItem('
'+billet.titre+'

0 '+_("commentaire")+'
',billet._id);
		}
	}

	content_liste_my_conversations.setGraphicalElement(liste_conversations_mine);


text:
package org.sakaiproject.importer.impl.translators;

public class CCLearningApplicationResourceTranslator extends
		CCWebContentTranslator {

	public String getTypeName() {
		return "associatedcontent/imscc_xmlv1p0/learning-application-resource";
	}

}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.07.02 at 03:35:23 PM MSK
//

package ru.gov.zakupki.oos.types._1;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;

/**
 * Справочник: Причины начисления неустоек (штрафов, пеней)
 *
 *
Java class for zfcs_nsiContractPenaltyReasonType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="zfcs_nsiContractPenaltyReasonType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="code" type="{http://zakupki.gov.ru/oos/types/1}zfcs_nsiContractPenaltyReasonCodeType"/>
 *         <element name="name" type="{http://zakupki.gov.ru/oos/types/1}zfcs_nsiContractPenaltyReasonNameType"/>
 *         <element name="penaltyType" type="{http://zakupki.gov.ru/oos/types/1}zfcs_contractPenaltyType"/>
 *         <element name="actual" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "zfcs_nsiContractPenaltyReasonType", propOrder = {
    "code",
    "name",
    "penaltyType",
    "actual"
})
public class ZfcsNsiContractPenaltyReasonType {

    @XmlElement(required = true)
    protected String code;
    @XmlElement(required = true)
    protected String name;
    @XmlElement(required = true)
    @XmlSchemaType(name = "string")
    protected ZfcsContractPenaltyType penaltyType;
    protected boolean actual;

    /**
     * Gets the value of the code property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getCode() {
        return code;
    }

    /**
     * Sets the value of the code property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setCode(String value) {
        this.code = value;
    }

    /**
     * Gets the value of the name property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getName() {
        return name;
    }

    /**
     * Sets the value of the name property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setName(String value) {
        this.name = value;
    }

    /**
     * Gets the value of the penaltyType property.
     *
     * @return
     *     possible object is
     *     {@link ZfcsContractPenaltyType }
     *
     */
    public ZfcsContractPenaltyType getPenaltyType() {
        return penaltyType;
    }

    /**
     * Sets the value of the penaltyType property.
     *
     * @param value
     *     allowed object is
     *     {@link ZfcsContractPenaltyType }
     *
     */
    public void setPenaltyType(ZfcsContractPenaltyType value) {
        this.penaltyType = value;
    }

    /**
     * Gets the value of the actual property.
     *
     */
    public boolean isActual() {
        return actual;
    }

    /**
     * Sets the value of the actual property.
     *
     */
    public void setActual(boolean value) {
        this.actual = value;
    }

}


text:
from rl_coach.data_stores.data_store import DataStoreParameters
from rl_coach.data_stores.checkpoint_data_store import CheckpointDataStore
from minio import Minio
from minio.error import S3Error
from configparser import ConfigParser, Error
from rl_coach.checkpoint import CheckpointStateFile
from rl_coach.data_stores.data_store import SyncFiles
from rl_coach.logger import screen

import os
import time
import io

class S3DataStoreParameters(DataStoreParameters):
    def __init__(self, ds_params, creds_file: str = None, end_point: str = None, bucket_name: str = None,
                 checkpoint_dir: str = None, expt_dir: str = None):

        super().__init__(ds_params.store_type, ds_params.orchestrator_type, ds_params.orchestrator_params)
        self.creds_file = creds_file
        self.end_point = end_point
        self.bucket_name = bucket_name
        self.checkpoint_dir = checkpoint_dir
        self.expt_dir = expt_dir

class S3DataStore(CheckpointDataStore):
    """
    An implementation of the data store using S3 for storing policy checkpoints when using Coach in distributed mode.
    The policy checkpoints are written by the trainer and read by the rollout worker.
    """

    def __init__(self, params: S3DataStoreParameters):
        """
        :param params: The parameters required to use the S3 data store.
        """

        super(S3DataStore, self).__init__(params)
        self.params = params
        access_key = None
        secret_key = None
        if params.creds_file:
            config = ConfigParser()
            config.read(params.creds_file)
            try:
                access_key = config.get('default', 'aws_access_key_id')
                secret_key = config.get('default', 'aws_secret_access_key')
            except Error as e:
                screen.print("Error when reading S3 credentials file: %s", e)
        else:
            access_key = os.environ.get('ACCESS_KEY_ID')
            secret_key = os.environ.get('SECRET_ACCESS_KEY')
        self.mc = Minio(self.params.end_point, access_key=access_key, secret_key=secret_key)

    def deploy(self) -> bool:
        return True

    def get_info(self):
        return "s3://{}/{}".format(self.params.bucket_name)

    def undeploy(self) -> bool:
        return True

    def save_to_store(self):
        self._save_to_store(self.params.checkpoint_dir)

    def _save_to_store(self, checkpoint_dir):
        """
        save_to_store() uploads the policy checkpoint, gifs and videos to the S3 data store. It reads the checkpoint state files and
        uploads only the latest checkpoint files to S3. It is used by the trainer in Coach when used in the distributed mode.
        """
        try:
            # remove lock file if it exists
            self.mc.remove_object(self.params.bucket_name, SyncFiles.LOCKFILE.value)

            # Acquire lock
            self.mc.put_object(self.params.bucket_name, SyncFiles.LOCKFILE.value, io.BytesIO(b''), 0)

            state_file = CheckpointStateFile(os.path.abspath(checkpoint_dir))
            if state_file.exists():
                ckpt_state = state_file.read()
                checkpoint_file = None
                for root, dirs, files in os.walk(checkpoint_dir):
                    for filename in files:
                        if filename == CheckpointStateFile.checkpoint_state_filename:
                            checkpoint_file = (root, filename)
                            continue
                        if filename.startswith(ckpt_state.name):
                            abs_name = os.path.abspath(os.path.join(root, filename))
                            rel_name = os.path.relpath(abs_name, checkpoint_dir)
                            self.mc.fput_object(self.params.bucket_name, rel_name, abs_name)

                abs_name = os.path.abspath(os.path.join(checkpoint_file[0], checkpoint_file[1]))
                rel_name = os.path.relpath(abs_name, checkpoint_dir)
                self.mc.fput_object(self.params.bucket_name, rel_name, abs_name)

            # upload Finished if present
            if os.path.exists(os.path.join(checkpoint_dir, SyncFiles.FINISHED.value)):
                self.mc.put_object(self.params.bucket_name, SyncFiles.FINISHED.value, io.BytesIO(b''), 0)

            # upload Ready if present
            if os.path.exists(os.path.join(checkpoint_dir, SyncFiles.TRAINER_READY.value)):
                self.mc.put_object(self.params.bucket_name, SyncFiles.TRAINER_READY.value, io.BytesIO(b''), 0)

            # release lock
            self.mc.remove_object(self.params.bucket_name, SyncFiles.LOCKFILE.value)

            if self.params.expt_dir and os.path.exists(self.params.expt_dir):
                for filename in os.listdir(self.params.expt_dir):
                    if filename.endswith((".csv", ".json")):
                        self.mc.fput_object(self.params.bucket_name, filename, os.path.join(self.params.expt_dir, filename))

            if self.params.expt_dir and os.path.exists(os.path.join(self.params.expt_dir, 'videos')):
                for filename in os.listdir(os.path.join(self.params.expt_dir, 'videos')):
                        self.mc.fput_object(self.params.bucket_name, filename, os.path.join(self.params.expt_dir, 'videos', filename))

            if self.params.expt_dir and os.path.exists(os.path.join(self.params.expt_dir, 'gifs')):
                for filename in os.listdir(os.path.join(self.params.expt_dir, 'gifs')):
                        self.mc.fput_object(self.params.bucket_name, filename, os.path.join(self.params.expt_dir, 'gifs', filename))

        except S3Error as e:
            screen.print("Got exception: %s\n while saving to S3", e)

    def load_from_store(self):
        """
        load_from_store() downloads a new checkpoint from the S3 data store when it is not available locally. It is used
        by the rollout workers when using Coach in distributed mode.
        """
        try:
            state_file = CheckpointStateFile(os.path.abspath(self.params.checkpoint_dir))

            # wait until lock is removed
            while True:
                objects = self.mc.list_objects_v2(self.params.bucket_name, SyncFiles.LOCKFILE.value)

                if next(objects, None) is None:
                    try:
                        # fetch checkpoint state file from S3
                        self.mc.fget_object(self.params.bucket_name, state_file.filename, state_file.path)
                    except Exception as e:
                        continue
                    break
                time.sleep(10)

            # Check if there's a finished file
            objects = self.mc.list_objects_v2(self.params.bucket_name, SyncFiles.FINISHED.value)

            if next(objects, None) is not None:
                try:
                    self.mc.fget_object(
                        self.params.bucket_name, SyncFiles.FINISHED.value,
                        os.path.abspath(os.path.join(self.params.checkpoint_dir, SyncFiles.FINISHED.value))
                    )
                except Exception as e:
                    pass

            # Check if there's a ready file
            objects = self.mc.list_objects_v2(self.params.bucket_name, SyncFiles.TRAINER_READY.value)

            if next(objects, None) is not None:
                try:
                    self.mc.fget_object(
                        self.params.bucket_name, SyncFiles.TRAINER_READY.value,
                        os.path.abspath(os.path.join(self.params.checkpoint_dir, SyncFiles.TRAINER_READY.value))
                    )
                except Exception as e:
                    pass

            checkpoint_state = state_file.read()
            if checkpoint_state is not None:
                objects = self.mc.list_objects_v2(self.params.bucket_name, prefix=checkpoint_state.name, recursive=True)
                for obj in objects:
                    filename = os.path.abspath(os.path.join(self.params.checkpoint_dir, obj.object_name))
                    if not os.path.exists(filename):
                        self.mc.fget_object(obj.bucket_name, obj.object_name, filename)

        except S3Error as e:
            screen.print("Got exception: %s\n while loading from S3", e)

    def setup_checkpoint_dir(self, crd=None):
        if crd:
            self._save_to_store(crd)


text:
renderSearchGeneric :: Site -> Html -> Params -> Pagination -> Maybe Text  -- comment
                    -> (a -> AttributeValue) -- linkItem function
                    -> [a]
                    -> ItemRendering a ViewMode
                    -> (  Html   -- ^ page title
                       -> Html   -- ^ content
                       -> Html   -- ^ sidebar
                       -> Page a
                       )
                    -> Html  -- ^ sidebar
                    -> Html  -- ^ page title
                    -> ActionM ()


text:
import logging
from pyvisdk.exceptions import InvalidArgumentError

########################################
# Automatically generated, do not edit.
########################################

log = logging.getLogger(__name__)

def VmwareUplinkPortTeamingPolicy(vim, *args, **kwargs):
    '''Policy for a uplink port team.'''

    obj = vim.client.factory.create('ns0:VmwareUplinkPortTeamingPolicy')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 1:
        raise IndexError('Expected at least 2 arguments got: %d' % len(args))

    required = [ 'inherited' ]
    optional = [ 'failureCriteria', 'notifySwitches', 'policy', 'reversePolicy', 'rollingOrder',
        'uplinkPortOrder', 'dynamicProperty', 'dynamicType' ]

    for name, arg in zip(required+optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError("Invalid argument: %s.  Expected one of %s" % (name, ", ".join(required + optional)))

    return obj


text:
package ua.com.fielden.platform.web.view.master.api.widgets.impl;

import ua.com.fielden.platform.entity.AbstractEntity;
import ua.com.fielden.platform.web.centre.api.actions.EntityActionConfig;
import ua.com.fielden.platform.web.view.master.api.actions.IPropertyActionConfig;
import ua.com.fielden.platform.web.view.master.api.helpers.IAlso;
import ua.com.fielden.platform.web.view.master.api.helpers.IPropertySelector;
import ua.com.fielden.platform.web.view.master.api.helpers.ISkipValidation;

public abstract class AbstractEditorWidgetConfig<T extends AbstractEntity<?>, WIDGET extends AbstractWidget, NEXT_CONFIG> implements IAlso<T>, IPropertyActionConfig<T>, ISkipValidation<NEXT_CONFIG> {
    private final IPropertySelector<T> propSelector;
    private final WIDGET widget;

    public AbstractEditorWidgetConfig(final WIDGET widget, final IPropertySelector<T> propSelector) {
        this.propSelector = propSelector;
        this.widget = widget;
    }

    protected void skipVal() {
        this.widget.skipValidation();
    }

    @Override
    public IAlso<T> withAction(final EntityActionConfig action) {
        widget.withAction(action);
        return this;
    }

    @Override
    public IPropertySelector<T> also() {
        return propSelector;
    }

    public WIDGET widget() {
        return widget;
    }
}


text:
'use strict';

/**
 * Module dependencies.
 */
var express = require('express'),
    passport = require('passport'),
    utils = require('../utils/utils'),
    logger = require('mean-logger');
var console = require('../utils/easy-logger')('server.js');

/**
 * Main application entry file.
 * Please note that the order of loading is important.
 */

// Load configurations
// Set the node environment variable if not set before
process.env.NODE_ENV = process.env.NODE_ENV || 'development';

// Initializing system variables
var config = require('../config/config'),
    mongoose = require('mongoose');

// Bootstrap db connection
var db = mongoose.connect(config.db);

// Bootstrap models
utils.load(__dirname + '/../utils/models');

// Bootstrap passport config
require('./passport')(passport);

var app = express();

// Express settings
require('./express')(app, passport, db);

// Bootstrap routes
utils.load(__dirname + '/app/routes', 'middlewares', function(path){
  require(path)(app, passport);
});

// Start the app by listening on <port>
var port = process.env.PORT || config.port;
app.listen(port);
console.log('Express app started on port ' + port);

// Initializing logger
logger.init(app, passport, mongoose);

// Expose app
exports = module.exports = app;


text:
package com.intive.patronage.toz;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;

@SpringBootApplication
@EnableAsync
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}


text:
#pragma once

#include <QtCore/QTimer>

#include "abstractTimer.h"
#include "utilsDeclSpec.h"

namespace utils {

/// Timer implementation for real-life time
class ROBOTS_UTILS_EXPORT RealTimer : public AbstractTimer
{
public:
	RealTimer();

	bool isTicking() const override;
	void start() override;
	void start(int ms) override;
	void stop() override;
	void setInterval(int ms) override;
	void setRepeatable(bool repeatable) override;

private:
	QTimer mTimer;
};

}


text:
[![NPM version](http://img.shields.io/npm/v/terra-modal.svg)](https://www.npmjs.org/package/terra-modal)
[![Build Status](https://travis-ci.org/cerner/terra-core.svg?branch=master)](https://travis-ci.org/cerner/terra-core)

Modals are used to display content in a layer above the app. Modals consist of an overlay and container. Higher order components can provide the modal dialog with a header, body, and close button.

- [Getting Started](#getting-started)
- [Documentation](#documentation)
- [LICENSE](#license)

## Getting Started

- Install from [npmjs](https://www.npmjs.com): `npm install terra-modal`

## Documentation

Documentation for this component is spilt into individual files.
One file for the main component and one file for each component modifier.

See the [documentation](docs/).

## LICENSE

Copyright 2017 Cerner Innovation, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


text:
package com.streamsets.pipeline.stage.origin.mysql;

import com.streamsets.pipeline.api.Config;
import com.streamsets.pipeline.api.StageException;
import com.streamsets.pipeline.api.StageUpgrader;
import com.streamsets.pipeline.api.impl.Utils;
import java.util.List;

public class MySqlSourceUpgrader implements StageUpgrader {

  @Override
  public List<Config> upgrade(
      String library,
      String stageName,
      String stageInstance,
      int fromVersion,
      int toVersion,
      List<Config> configs
  ) throws StageException {
    switch (fromVersion) {
      case 1:
        upgradeV1ToV2(configs);
        break;
      case 2:
        break;
      default:
        throw new IllegalStateException(Utils.format("Unexpected fromVersion {}", fromVersion));
    }
    return configs;
  }

  private void upgradeV1ToV2(List<Config> configs) {
    configs.add(new Config(MysqlDSource.CONFIG_PREFIX + "enableKeepAlive", true));
    configs.add(new Config(MysqlDSource.CONFIG_PREFIX + "keepAliveInterval", 60000));
  }
}


text:
class BookmarkModel;
class BookmarkNode;

typedef struct _GtkTreeIter GtkTreeIter;
typedef struct _GtkTreeModel GtkTreeModel;
typedef struct _GtkTreeStore GtkTreeStore;
typedef struct _GdkPixbuf GdkPixbuf;

namespace bookmark_utils {

enum FolderTreeStoreColumns {
  FOLDER_ICON,
  FOLDER_NAME,
  ITEM_ID,
  FOLDER_STORE_NUM_COLUMNS
};

// Make a tree store that has two columns: name and id.
GtkTreeStore* MakeFolderTreeStore();

// Copies the folders in the model's root node into a GtkTreeStore. We
// want the user to be able to modify the tree of folders, but to be able to
// click Cancel and discard their modifications. |selected_id| is the
// node->id() of the BookmarkNode that should selected on
// node->screen. |selected_iter| is an out value that points to the
// node->representation of the node associated with |selected_id| in |store|.
// |recursive| indicates whether to recurse into sub-directories (if false,
// the tree store will effectively be a list). |only_folders| indicates whether
// to include bookmarks in the tree, or to only show folders.
void AddToTreeStore(BookmarkModel* model, int selected_id,
                    GtkTreeStore* store, GtkTreeIter* selected_iter);

// As above, but inserts just the tree rooted at |node| as a child of |parent|.
// If |parent| is NULL, add it at the top level.
void AddToTreeStoreAt(const BookmarkNode* node, int selected_id,
                      GtkTreeStore* store, GtkTreeIter* selected_iter,
                      GtkTreeIter* parent);

// Commits changes to a GtkTreeStore built from BuildTreeStoreFrom() back
// into the BookmarkModel it was generated from.  Returns the BookmarkNode that
// represented by |selected|.
const BookmarkNode* CommitTreeStoreDifferencesBetween(
    BookmarkModel* model, GtkTreeStore* tree_store,
    GtkTreeIter* selected);

// Returns the id field of the row pointed to by |iter|.
int GetIdFromTreeIter(GtkTreeModel* model, GtkTreeIter* iter);

// Returns the title field of the row pointed to by |iter|.
std::wstring GetTitleFromTreeIter(GtkTreeModel* model, GtkTreeIter* iter);

}  // namespace bookmark_utils

#endif  // CHROME_BROWSER_GTK_BOOKMARK_TREE_MODEL_H_


text:
+(NSSet *)independence_requirements{ \
    NSSet *requirements = [NSSet setWithObjects: args, nil]; \
    return [INDUtils \
            unionRequirementsSetForClass:self \
            withSet:requirements \
            selector:@selector(independence_requirements)]; \
}


text:
<?php
namespace Kir\Data\ArrayObjectConverter\Mock;

class Subject2 {
	/**
	 * @var int
	 * @aoc-array-key data
	 */
	private $property = 123;

	/**
	 * @param int $property
	 * @return $this
	 */
	public function setProperty($property) {
		$this->property = $property;
		return $this;
	}

	/**
	 * @return int
	 */
	public function getProperty() {
		return $this->property;
	}
}


text:
<!doctype html>

  <meta charset="utf-8">
  <title>Spring Cloud Data Flow</title>
  <base href="/">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">

  <app-root>

          <svg class="icon-spinner-lg" width="200px" height="200px" viewBox="0 0 101 101"
              xmlns="http://www.w3.org/2000/svg">
              <circle class="ring" fill="none" stroke-width="10%" stroke-linecap="butt" cx="50%" cy="50%"
                      r="45%"></circle>
              <circle class="path" fill="none" stroke-width="10%" stroke-linecap="butt" cx="50%" cy="50%"
                      r="45%"></circle>
          </svg>

  </app-root>


text:
选择处理客户

                            <input type="text" class="form-control" id="appId" ng-model="vm.appId" placeholder="申请单号">

                            <input type="text" class="form-control" id="name" ng-model="vm.name" placeholder="客户姓名">

                            <select id="productCode" class="form-control" ng-model="vm.productCode"
                                    ng-options="item.productCode as item.productName group by item.productTypeName  for item in productList track by item.id" >
                                <option value="">请选择产品</option>
                            </select>

                            <input type="text" class="form-control" id="idNo" ng-model="vm.idNo" placeholder="证件号码">

                            <input type="text" class="form-control" id="mobile" ng-model="vm.mobile" placeholder="承租人电话号码">

                            <input type="text" class="form-control" id="contractNo" ng-model="vm.contractNo" placeholder="合同编号">

                            <input type="text" class="form-control" id="sysBranchCode" ng-model="vm.sysBranchCode" placeholder="经销商编码">

                                <input type="text" id="applyStartDate" class="form-control m-b-sm m-r-xs" uib-datepicker-popup="yyyy-MM-dd"
                                       placeholder="申请开始日期"
                                       is-open="isopenApplyStartDate"
                                       ng-model="vm.applyStartDate" >

                            <button type="button" class="form-control btn btn-default m-b-ms"   ng-click="isopenApplyStartDate=!isopenApplyStartDate" ></button>

                                <input type="text" id="applyEndDate" class="form-control m-b-sm m-r-xs" uib-datepicker-popup
                                       placeholder="申请截止日期"
                                       is-open="isopenApplyeEndDate"
                                       ng-model="vm.applyEndDate" >

                            <button type="button" class="form-control btn btn-default btn-md m-b-ms"   ng-click="isopenApplyeEndDate=!isopenApplyeEndDate" ></button>

                                <input type="text" id="approveStartDate" class="form-control m-b-sm m-r-xs" uib-datepicker-popup
                                       placeholder="审批通过开始日期"
                                       is-open="isopenApproveStartDate"
                                       ng-model="vm.approveStartDate" >

                            <button type="button" class="form-control btn btn-default btn-md m-b-ms"   ng-click="isopenApproveStartDate=!isopenApproveStartDate" ></button>

                                <input type="text" id="approveEndDate" class="form-control m-b-sm m-r-xs" uib-datepicker-popup
                                       placeholder="审核通过结束日期"
                                       is-open="isopenApproveEndDate"
                                       ng-model="vm.approveEndDate" >

                            <button type="button" class="form-control btn btn-default btn-md m-b-ms"   ng-click="isopenApproveEndDate=!isopenApproveEndDate" ></button>

                                <input type="text" id="loanStartDate" class="form-control m-b-sm m-r-xs" uib-datepicker-popup
                                       placeholder="放款完成开始日期"
                                       is-open="isopenLoanStartDate"
                                       ng-model="vm.loanStartDate" >

                            <button type="button" class="form-control btn btn-default btn-md m-b-ms"   ng-click="isopenLoanStartDate=!isopenLoanStartDate" ></button>

                                <input type="text" id="loanEndDate" class="form-control m-b-sm m-r-xs" uib-datepicker-popup
                                       placeholder="放款完成结束日期"
                                       is-open="isopenLoanEndDate"
                                       ng-model="vm.loanEndDate" >

                            <button type="button" class="form-control btn btn-default btn-md m-b-ms"   ng-click="isopenLoanEndDate=!isopenLoanEndDate" ></button>

                            <select ng-model="vm.applyStatus"  class="form-control m-b-sm m-r-xs"
                                    ng-options="item.dictDataCode as item.dictDataName for item in appStatusList" >
                                <option value="">请选择申请单状态</option>
                            </select>

                        <button type="submit" class="btn btn-default btn-sm m-b-sm m-r-xs" ng-click="queryApplyList()">查询</button>

                        案件编号
                        客户姓名
                        身份证号
                        申请日期
                        案件状态
                        经销商
                        批核金额
                        期数
                        操作

                        {{item.appId}}
                        {{item.name}}
                        {{item.idNo}}
                        {{item.createTime|mysqlDatetime}}
                        {{item.status}}
                        {{item.branchName}}
                        {{item.totalFinanceAmt}}
                        {{item.period}}

                            选择

                        无查询结果

0">

                        总共{{paginationInfo.totalItem}}条      每页显示:{{paginationInfo.pageSize}}条

                            <uib-pagination boundary-links="true" total-items="paginationInfo.totalItem"
                                            ng-model="paginationInfo.curPage"
                                            max-size="paginationInfo.maxSize"
                                            items-per-page="paginationInfo.pageSize" ng-change="pageChanged()"
                                            previous-text="‹" next-text="›" first-text="«"
                                            last-text="»">
                            </uib-pagination>

        <button class="btn btn-default" type="button" ng-click="cancel()">关闭</button>


text:
#include <linux/module.h>
#include <linux/acpi.h>
#include <linux/delay.h>
#include <linux/bitops.h>
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <asm/intel_punit_ipc.h>

/* IPC Mailbox registers */
#define OFFSET_DATA_LOW		0x0
#define OFFSET_DATA_HIGH	0x4
/* bit field of interface register */
#define	CMD_RUN			BIT(31)
#define	CMD_ERRCODE_MASK	GENMASK(7, 0)
#define	CMD_PARA1_SHIFT		8
#define	CMD_PARA2_SHIFT		16

#define CMD_TIMEOUT_SECONDS	1

enum {
	BASE_DATA = 0,
	BASE_IFACE,
	BASE_MAX,
};

typedef struct {
	struct device *dev;
	struct mutex lock;
	int irq;
	struct completion cmd_complete;
	/* base of interface and data registers */
	void __iomem *base[RESERVED_IPC][BASE_MAX];
	IPC_TYPE type;
} IPC_DEV;

static IPC_DEV *punit_ipcdev;

static inline u32 ipc_read_status(IPC_DEV *ipcdev, IPC_TYPE type)
{
	return readl(ipcdev->base[type][BASE_IFACE]);
}

static inline void ipc_write_cmd(IPC_DEV *ipcdev, IPC_TYPE type, u32 cmd)
{
	writel(cmd, ipcdev->base[type][BASE_IFACE]);
}

static inline u32 ipc_read_data_low(IPC_DEV *ipcdev, IPC_TYPE type)
{
	return readl(ipcdev->base[type][BASE_DATA] + OFFSET_DATA_LOW);
}

static inline u32 ipc_read_data_high(IPC_DEV *ipcdev, IPC_TYPE type)
{
	return readl(ipcdev->base[type][BASE_DATA] + OFFSET_DATA_HIGH);
}

static inline void ipc_write_data_low(IPC_DEV *ipcdev, IPC_TYPE type, u32 data)
{
	writel(data, ipcdev->base[type][BASE_DATA] + OFFSET_DATA_LOW);
}

static inline void ipc_write_data_high(IPC_DEV *ipcdev, IPC_TYPE type, u32 data)
{
	writel(data, ipcdev->base[type][BASE_DATA] + OFFSET_DATA_HIGH);
}

static const char *ipc_err_string(int error)
{
	if (error == IPC_PUNIT_ERR_SUCCESS)
		return "no error";
	else if (error == IPC_PUNIT_ERR_INVALID_CMD)
		return "invalid command";
	else if (error == IPC_PUNIT_ERR_INVALID_PARAMETER)
		return "invalid parameter";
	else if (error == IPC_PUNIT_ERR_CMD_TIMEOUT)
		return "command timeout";
	else if (error == IPC_PUNIT_ERR_CMD_LOCKED)
		return "command locked";
	else if (error == IPC_PUNIT_ERR_INVALID_VR_ID)
		return "invalid vr id";
	else if (error == IPC_PUNIT_ERR_VR_ERR)
		return "vr error";
	else
		return "unknown error";
}

static int intel_punit_ipc_check_status(IPC_DEV *ipcdev, IPC_TYPE type)
{
	int loops = CMD_TIMEOUT_SECONDS * USEC_PER_SEC;
	int errcode;
	int status;

	if (ipcdev->irq) {
		if (!wait_for_completion_timeout(&ipcdev->cmd_complete,
						 CMD_TIMEOUT_SECONDS * HZ)) {
			dev_err(ipcdev->dev, "IPC timed out\n");
			return -ETIMEDOUT;
		}
	} else {
		while ((ipc_read_status(ipcdev, type) & CMD_RUN) && --loops)
			udelay(1);
		if (!loops) {
			dev_err(ipcdev->dev, "IPC timed out\n");
			return -ETIMEDOUT;
		}
	}

	status = ipc_read_status(ipcdev, type);
	errcode = status & CMD_ERRCODE_MASK;
	if (errcode) {
		dev_err(ipcdev->dev, "IPC failed: %s, IPC_STS=0x%x\n",
			ipc_err_string(errcode), status);
		return -EIO;
	}

	return 0;
}

/**
 * intel_punit_ipc_simple_command() - Simple IPC command
 * @cmd:	IPC command code.
 * @para1:	First 8bit parameter, set 0 if not used.
 * @para2:	Second 8bit parameter, set 0 if not used.
 *
 * Send a IPC command to P-Unit when there is no data transaction
 *
 * Return:	IPC error code or 0 on success.
 */
int intel_punit_ipc_simple_command(int cmd, int para1, int para2)
{
	IPC_DEV *ipcdev = punit_ipcdev;
	IPC_TYPE type;
	u32 val;
	int ret;

	mutex_lock(&ipcdev->lock);

	reinit_completion(&ipcdev->cmd_complete);
	type = (cmd & IPC_PUNIT_CMD_TYPE_MASK) >> IPC_TYPE_OFFSET;

	val = cmd & ~IPC_PUNIT_CMD_TYPE_MASK;
	val |= CMD_RUN | para2 << CMD_PARA2_SHIFT | para1 << CMD_PARA1_SHIFT;
	ipc_write_cmd(ipcdev, type, val);
	ret = intel_punit_ipc_check_status(ipcdev, type);

	mutex_unlock(&ipcdev->lock);

	return ret;
}
EXPORT_SYMBOL(intel_punit_ipc_simple_command);

/**
 * intel_punit_ipc_command() - IPC command with data and pointers
 * @cmd:	IPC command code.
 * @para1:	First 8bit parameter, set 0 if not used.
 * @para2:	Second 8bit parameter, set 0 if not used.
 * @in:		Input data, 32bit for BIOS cmd, two 32bit for GTD and ISPD.
 * @out:	Output data.
 *
 * Send a IPC command to P-Unit with data transaction
 *
 * Return:	IPC error code or 0 on success.
 */
int intel_punit_ipc_command(u32 cmd, u32 para1, u32 para2, u32 *in, u32 *out)
{
	IPC_DEV *ipcdev = punit_ipcdev;
	IPC_TYPE type;
	u32 val;
	int ret;

	mutex_lock(&ipcdev->lock);

	reinit_completion(&ipcdev->cmd_complete);
	type = (cmd & IPC_PUNIT_CMD_TYPE_MASK) >> IPC_TYPE_OFFSET;

	if (in) {
		ipc_write_data_low(ipcdev, type, *in);
		if (type == GTDRIVER_IPC || type == ISPDRIVER_IPC)
			ipc_write_data_high(ipcdev, type, *++in);
	}

	val = cmd & ~IPC_PUNIT_CMD_TYPE_MASK;
	val |= CMD_RUN | para2 << CMD_PARA2_SHIFT | para1 << CMD_PARA1_SHIFT;
	ipc_write_cmd(ipcdev, type, val);

	ret = intel_punit_ipc_check_status(ipcdev, type);
	if (ret)
		goto out;

	if (out) {
		*out = ipc_read_data_low(ipcdev, type);
		if (type == GTDRIVER_IPC || type == ISPDRIVER_IPC)
			*++out = ipc_read_data_high(ipcdev, type);
	}

out:
	mutex_unlock(&ipcdev->lock);
	return ret;
}
EXPORT_SYMBOL_GPL(intel_punit_ipc_command);

static irqreturn_t intel_punit_ioc(int irq, void *dev_id)
{
	IPC_DEV *ipcdev = dev_id;

	complete(&ipcdev->cmd_complete);
	return IRQ_HANDLED;
}

static int intel_punit_get_bars(struct platform_device *pdev)
{
	struct resource *res;
	void __iomem *addr;

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	addr = devm_ioremap_resource(&pdev->dev, res);
	if (IS_ERR(addr))
		return PTR_ERR(addr);
	punit_ipcdev->base[BIOS_IPC][BASE_DATA] = addr;

	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
	addr = devm_ioremap_resource(&pdev->dev, res);
	if (IS_ERR(addr))
		return PTR_ERR(addr);
	punit_ipcdev->base[BIOS_IPC][BASE_IFACE] = addr;

	res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
	addr = devm_ioremap_resource(&pdev->dev, res);
	if (IS_ERR(addr))
		return PTR_ERR(addr);
	punit_ipcdev->base[ISPDRIVER_IPC][BASE_DATA] = addr;

	res = platform_get_resource(pdev, IORESOURCE_MEM, 3);
	addr = devm_ioremap_resource(&pdev->dev, res);
	if (IS_ERR(addr))
		return PTR_ERR(addr);
	punit_ipcdev->base[ISPDRIVER_IPC][BASE_IFACE] = addr;

	res = platform_get_resource(pdev, IORESOURCE_MEM, 4);
	addr = devm_ioremap_resource(&pdev->dev, res);
	if (IS_ERR(addr))
		return PTR_ERR(addr);
	punit_ipcdev->base[GTDRIVER_IPC][BASE_DATA] = addr;

	res = platform_get_resource(pdev, IORESOURCE_MEM, 5);
	addr = devm_ioremap_resource(&pdev->dev, res);
	if (IS_ERR(addr))
		return PTR_ERR(addr);
	punit_ipcdev->base[GTDRIVER_IPC][BASE_IFACE] = addr;

	return 0;
}

static int intel_punit_ipc_probe(struct platform_device *pdev)
{
	int irq, ret;

	punit_ipcdev = devm_kzalloc(&pdev->dev,
				    sizeof(*punit_ipcdev), GFP_KERNEL);
	if (!punit_ipcdev)
		return -ENOMEM;

	platform_set_drvdata(pdev, punit_ipcdev);

	irq = platform_get_irq(pdev, 0);
	if (irq < 0) {
		punit_ipcdev->irq = 0;
		dev_warn(&pdev->dev, "Invalid IRQ, using polling mode\n");
	} else {
		ret = devm_request_irq(&pdev->dev, irq, intel_punit_ioc,
				       IRQF_NO_SUSPEND, "intel_punit_ipc",
				       &punit_ipcdev);
		if (ret) {
			dev_err(&pdev->dev, "Failed to request irq: %d\n", irq);
			return ret;
		}
		punit_ipcdev->irq = irq;
	}

	ret = intel_punit_get_bars(pdev);
	if (ret)
		goto out;

	punit_ipcdev->dev = &pdev->dev;
	mutex_init(&punit_ipcdev->lock);
	init_completion(&punit_ipcdev->cmd_complete);

out:
	return ret;
}

static int intel_punit_ipc_remove(struct platform_device *pdev)
{
	return 0;
}

static const struct acpi_device_id punit_ipc_acpi_ids[] = {
	{ "INT34D4", 0 },
	{ }
};

static struct platform_driver intel_punit_ipc_driver = {
	.probe = intel_punit_ipc_probe,
	.remove = intel_punit_ipc_remove,
	.driver = {
		.name = "intel_punit_ipc",
		.acpi_match_table = ACPI_PTR(punit_ipc_acpi_ids),
	},
};

static int __init intel_punit_ipc_init(void)
{
	return platform_driver_register(&intel_punit_ipc_driver);
}

static void __exit intel_punit_ipc_exit(void)
{
	platform_driver_unregister(&intel_punit_ipc_driver);
}

MODULE_AUTHOR("Zha Qipeng <qipeng.zha@intel.com>");
MODULE_DESCRIPTION("Intel P-Unit IPC driver");
MODULE_LICENSE("GPL v2");

/* Some modules are dependent on this, so init earlier */
fs_initcall(intel_punit_ipc_init);
module_exit(intel_punit_ipc_exit);


text:
class HotspotImage < ActiveRecord::Base
	has_many :hotspots
	belongs_to :interface
end


text:
<Alloy>
    <ItemTemplate height="50" name="closedTemplate" backgroundColor="transparent" selectedBackgroundColor="transparent" height="Ti.UI.SIZE">
        <Label height="50" color="#c5c5c7" bindId="desc" left="10" width="200"/>
        <Label height="50" color="#c5c5c7" bindId="priority" right="10" width="75"/>
        <Label height=0 width=0 id="alloy_id">
    </ItemTemplate>
</Alloy>


text:
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/platform_device.h>
#include <linux/rotary_encoder.h>

#define DRV_NAME	"rotary-gpio-custom"
#define DRV_DESC	"Custom GPIO-based rotary driver"
#define DRV_VERSION	"0.1.0"

#define PFX		DRV_NAME ": "

#define BUS_PARAM_REQUIRED	5
#define BUS_PARAM_COUNT		6
#define BUS_COUNT_MAX		4

static unsigned int bus0[BUS_PARAM_COUNT] __initdata;
static unsigned int bus1[BUS_PARAM_COUNT] __initdata;
static unsigned int bus2[BUS_PARAM_COUNT] __initdata;
static unsigned int bus3[BUS_PARAM_COUNT] __initdata;

static unsigned int bus_nump[BUS_COUNT_MAX] __initdata;

#define BUS_PARM_DESC \
	" config -> id,steps,axis,gpioa,gpiob[,inverted]"

module_param_array(bus0, uint, &bus_nump[0], 0);
MODULE_PARM_DESC(bus0, "bus0" BUS_PARM_DESC);
module_param_array(bus1, uint, &bus_nump[1], 0);
MODULE_PARM_DESC(bus1, "bus1" BUS_PARM_DESC);
module_param_array(bus2, uint, &bus_nump[2], 0);
MODULE_PARM_DESC(bus2, "bus2" BUS_PARM_DESC);
module_param_array(bus3, uint, &bus_nump[3], 0);
MODULE_PARM_DESC(bus3, "bus3" BUS_PARM_DESC);

static struct platform_device *devices[BUS_COUNT_MAX];
static unsigned int nr_devices;

static void rotary_gpio_custom_cleanup(void)
{
	int i;

	for (i = 0; i < nr_devices; i++)
		if (devices[i])
			platform_device_put(devices[i]);
}

static int __init rotary_gpio_custom_add_one(unsigned int id,
					     unsigned int *params)
{
	struct platform_device *pdev;
	struct rotary_encoder_platform_data pdata;
	int err;

	if (!bus_nump[id])
		return 0;

	if (bus_nump[id] < BUS_PARAM_REQUIRED) {
		printk(KERN_ERR PFX "not enough parameters for bus%d\n", id);
		err = -EINVAL;
		goto err;
	}

	pdev = platform_device_alloc("rotary-gpio", params[0]);
	if (!pdev) {
		err = -ENOMEM;
		goto err;
	}

	pdata.steps = params[1];
	pdata.axis = params[2];
	pdata.relative_axis = false;
	pdata.rollover = false;
	pdata.gpio_a = params[3];
	pdata.gpio_b = params[4];

	if (params[5] == 1) {
		pdata.inverted_a = 1;
		pdata.inverted_b = 1;
	} else {
		pdata.inverted_a = 0;
		pdata.inverted_b = 0;
	}

	err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
	if (err)
		goto err_put;

	err = platform_device_add(pdev);
	if (err)
		goto err_put;

	devices[nr_devices++] = pdev;
	return 0;

err_put:
	platform_device_put(pdev);
err:
	return err;
}

static int __init rotary_gpio_custom_probe(void)
{
	int err;

	printk(KERN_INFO DRV_DESC " version " DRV_VERSION "\n");

	err = rotary_gpio_custom_add_one(0, bus0);
	if (err)
		goto err;

	err = rotary_gpio_custom_add_one(1, bus1);
	if (err)
		goto err;

	err = rotary_gpio_custom_add_one(2, bus2);
	if (err)
		goto err;

	err = rotary_gpio_custom_add_one(3, bus3);
	if (err)
		goto err;

	if (!nr_devices) {
		printk(KERN_ERR PFX "no bus parameter(s) specified\n");
		err = -ENODEV;
		goto err;
	}

	return 0;

err:
	rotary_gpio_custom_cleanup();
	return err;
}

#ifdef MODULE
static int __init rotary_gpio_custom_init(void)
{
	return rotary_gpio_custom_probe();
}
module_init(rotary_gpio_custom_init);

static void __exit rotary_gpio_custom_exit(void)
{
	rotary_gpio_custom_cleanup();
}
module_exit(rotary_gpio_custom_exit);
#else
subsys_initcall(rotary_gpio_custom_probe);
#endif /* MODULE*/

MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org >");
MODULE_AUTHOR("Claudio Mignanti <c.mignanti@gmail.com>");
MODULE_DESCRIPTION(DRV_DESC);
MODULE_VERSION(DRV_VERSION);


text:
<?php

/**
 * HTTP client for Thrift
 *
 * @package thrift.transport
 */
class THttpClient extends TTransport {

  /**
   * The host to connect to
   *
   * @var string
   */
  protected $host_;

  /**
   * The port to connect on
   *
   * @var int
   */
  protected $port_;

  /**
   * The URI to request
   *
   * @var string
   */
  protected $uri_;

  /**
   * The scheme to use for the request, i.e. http, https
   *
   * @var string
   */
  protected $scheme_;

  /**
   * Buffer for the HTTP request data
   *
   * @var string
   */
  protected $buf_;

  /**
   * Input socket stream.
   *
   * @var resource
   */
  protected $handle_;

  /**
   * Read timeout
   *
   * @var float
   */
  protected $timeout_;

  /**
   * http headers
   **/
  protected $headers_;

  /**
   * Make a new HTTP client.
   *
   * @param string $host
   * @param int    $port
   * @param string $uri
   */
  public function __construct($host, $port=80, $uri='', $scheme = 'http') {
    if ((strlen($uri) > 0) && ($uri{0} != '/')) {
      $uri = '/'.$uri;
    }
    $this->scheme_ = $scheme;
    $this->host_ = $host;
    $this->port_ = $port;
    $this->uri_ = $uri;
    $this->buf_ = '';
    $this->handle_ = null;
    $this->timeout_ = null;

    $this->headers_ = array();
  }

  /**
   * Set read timeout
   *
   * @param float $timeout
   */
  public function setTimeoutSecs($timeout) {
    $this->timeout_ = $timeout;
  }

  /**
   * Whether this transport is open.
   *
   * @return boolean true if open
   */
  public function isOpen() {
    return true;
  }

  /**
   * Open the transport for reading/writing
   *
   * @throws TTransportException if cannot open
   */
  public function open() {}

  /**
   * Close the transport.
   */
  public function close() {
    if ($this->handle_) {
      @fclose($this->handle_);
      $this->handle_ = null;
    }
  }

  /**
   * Read some data into the array.
   *
   * @param int    $len How much to read
   * @return string The data that has been read
   * @throws TTransportException if cannot read any more data
   */
  public function read($len) {
    $data = @fread($this->handle_, $len);
    if ($data === FALSE || $data === '') {
      $md = stream_get_meta_data($this->handle_);
      if ($md['timed_out']) {
        throw new TTransportException('THttpClient: timed out reading '.$len.' bytes from '.$this->host_.':'.$this->port_.$this->uri_, TTransportException::TIMED_OUT);
      } else {
        throw new TTransportException('THttpClient: Could not read '.$len.' bytes from '.$this->host_.':'.$this->port_.$this->uri_, TTransportException::UNKNOWN);
      }
    }
    return $data;
  }

  /**
   * Writes some data into the pending buffer
   *
   * @param string $buf  The data to write
   * @throws TTransportException if writing fails
   */
  public function write($buf) {
    $this->buf_ .= $buf;
  }

  /**
   * Opens and sends the actual request over the HTTP connection
   *
   * @throws TTransportException if a writing error occurs
   */
  public function flush() {
    // God, PHP really has some esoteric ways of doing simple things.
    $host = $this->host_.($this->port_ != 80 ? ':'.$this->port_ : '');

    $headers = array();
    $defaultHeaders = array('Host' => $host,
      'Accept' => 'application/x-thrift',
      'User-Agent' => 'PHP/THttpClient',
      'Content-Type' => 'application/x-thrift',
      'Content-Length' => strlen($this->buf_));
    foreach (($this->headers_ + $defaultHeaders) as $key => $value) {
      $headers[] = "$key: $value";
    }

    $options = array('method' => 'POST', 'protocol_version' => 1.1,
                     'header' => implode("\r\n", $headers),
                     'max_redirects' => 1,
                     'content' => $this->buf_);
    if ($this->timeout_ > 0) {
      $options['timeout'] = $this->timeout_;
    }
    $this->buf_ = '';

    $contextid = stream_context_create(array('http' => $options));
    $this->handle_ = @fopen($this->scheme_.'://'.$host.$this->uri_, 'r', false, $contextid);

    // Connect failed?
    if ($this->handle_ === FALSE) {
      $this->handle_ = null;
      $error = 'THttpClient: Could not connect to '.$host.$this->uri_;
      throw new TTransportException($error, TTransportException::NOT_OPEN);
    }
  }

  public function addHeaders($headers) {
    $this->headers_ += $headers;
  }

}


text:
<?php

namespace Test\Phinx\Db\Adapter;

use Phinx\Db\Adapter\PdoAdapter;

class PdoAdapterTest extends \PHPUnit_Framework_TestCase
{
    private $adapter;

    public function setUp()
    {
        $this->adapter = $this->getMockForAbstractClass('\Phinx\Db\Adapter\PdoAdapter', array(array('foo' => 'bar')));
    }

    public function tearDown()
    {
        unset($this->adapter);
    }

    public function testOptions()
    {
        $options = $this->adapter->getOptions();
        $this->assertArrayHasKey('foo', $options);
        $this->assertEquals('bar', $options['foo']);
    }

    public function testSchemaTableName()
    {
        $this->adapter->setSchemaTableName('schema_table_test');
        $this->assertEquals('schema_table_test', $this->adapter->getSchemaTableName());
    }
}


text:
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';

import TiThermometer from 'react-icons/lib/ti/thermometer';
import FaTint from 'react-icons/lib/fa/tint';
import FaUser from 'react-icons/lib/fa/user';

import './Status.css';

export default class Status extends PureComponent {
  static propTypes = {
    personsLimit: PropTypes.number.isRequired,
    temperatureThreshold: PropTypes.number.isRequired,
    temperature: PropTypes.number.isRequired,
    humidity: PropTypes.number.isRequired,
    persons: PropTypes.number.isRequired
  }

  render() {
    const { temperature, humidity, persons, personsLimit, temperatureThreshold } = this.props;
    const userClass = (persons > personsLimit) ? 'Status-error' : 'Status-ok';
    return (

<TiThermometer /> {temperature}/{temperatureThreshold} °C

<FaTint /> {humidity} %

<FaUser /> {persons}/{personsLimit}

    );
  }
}


text:
/* File derived from XMLwrapper.h: */
/*
  ZynAddSubFX - a software synthesizer

  XMLwrapper.h - XML wrapper
  Copyright (C) 2003-2005 Nasca Octavian Paul
  Copyright (C) 2009-2009 Mark McCurry
  Author: Nasca Octavian Paul
          Mark McCurry

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License (version 2 or later) for more details.

  You should have received a copy of the GNU General Public License (version 2)
  along with this program; if not, write to the Free Software Foundation,
  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA

*/

#ifndef QT_XML_WRAPPER_H
#define QT_XML_WRAPPER_H

#include "../globals.h"

#include <string>
#include <cstdlib>
#include <cstdio>
#include <cstring>

#define QtXmlWrapper XMLwrapper

struct XmlData;

class QtXmlWrapper
{
public:
	QtXmlWrapper();
	~QtXmlWrapper();

	int saveXMLfile( const std::string & filename ) const;
	int loadXMLfile( const std::string & filename );

	char *getXMLdata() const;
	bool putXMLdata( const char *xmldata );

	void addpar( const std::string & name, int val );
	void addparreal( const std::string & name, float val);
	void addparbool( const std::string & name, int val );
	void addparstr( const std::string & name, const std::string & val );

	void beginbranch( const std::string & name );
	void beginbranch( const std::string & name, int id );
	void endbranch();

	int enterbranch( const std::string & name );
	int enterbranch( const std::string & name, int id );
	void exitbranch();
	int getbranchid( int min, int max ) const;

	int getpar( const std::string & name, int defaultpar, int min, int max ) const;
	int getpar127( const std::string & name, int defaultpar ) const;
	int getparbool( const std::string & name, int defaultpar ) const;

	void getparstr( const std::string & name, char * par, int maxstrlen ) const;
	std::string getparstr( const std::string & name, const std::string & defaultpar ) const;
	float getparreal( const char * name, float defaultpar ) const;

	float getparreal(const char *name, float defaultpar, float min, float max) const;

	bool minimal; /**<false if all parameters will be stored (used only for clipboard)*/

	void setPadSynth( bool enabled );
	bool hasPadSynth() const;

private:
	int dosavefile(const char *filename, int compression, const char *xmldata) const;

	char *doloadfile(const std::string &filename) const;

	struct
	{
		int Major;
		int Minor;
		int Revision;
	} version;

	XmlData * d;

};

#endif


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('chat', '0002_auto_20160819_1126'),
    ]

    operations = [
        migrations.AddField(
            model_name='member',
            name='reply_channel_name',
            field=models.CharField(default='', max_length=128),
            preserve_default=False,
        ),
    ]


text:
package net.imglib2.ops.operation.complex.unary;

import net.imglib2.ops.operation.complex.binary.ComplexDivide;
import net.imglib2.type.numeric.ComplexType;
import net.imglib2.type.numeric.complex.ComplexDoubleType;

//Handbook of Mathematics and Computational Science, Harris & Stocker, Springer, 2006

/**
 * Sets an output complex number to the cotangent of an input complex
 * number.
 *
 * @author Barry DeZonia
 * @deprecated Use net.imagej.ops instead.
 */
@Deprecated
public final class ComplexCot<I extends ComplexType<I>, O extends ComplexType<O>>
	implements ComplexUnaryOperation<I,O>
{
	private final ComplexSin<I,ComplexDoubleType>
		sinFunc = new ComplexSin<I,ComplexDoubleType>();
	private final ComplexCos<I,ComplexDoubleType>
		cosFunc = new ComplexCos<I,ComplexDoubleType>();
	private final ComplexDivide<ComplexDoubleType,ComplexDoubleType,O>
		divFunc = new ComplexDivide<ComplexDoubleType,ComplexDoubleType,O>();

	private final ComplexDoubleType sin = new ComplexDoubleType();
	private final ComplexDoubleType cos = new ComplexDoubleType();

	@Override
	public O compute(I z, O output) {
		sinFunc.compute(z, sin);
		cosFunc.compute(z, cos);
		divFunc.compute(cos, sin, output);
		return output;
	}

	@Override
	public ComplexCot<I,O> copy() {
		return new ComplexCot<I,O>();
	}

}


text:
import React from 'react'

import style from './style.scss'
import { WidthControlled, Nav } from '../index'

type Props = {
	children: any,
	noNav?: boolean,
}

const Page = (props: Props) => (
	<div className={style.container}>
		{!props.noNav && <Nav />}
		<WidthControlled>
			{props.children}
		</WidthControlled>
	</div>
)

export default Page


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="10dp"
    tools:context=".MainActivity">

    <ImageView
        android:id="@+id/img"
        android:layout_width="120dp"
        android:layout_height="120dp"
        android:layout_marginRight="10dp"
        android:src="@drawable/chelsea" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/img"
        android:orientation="vertical">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:fontFamily="sans-serif-medium"
            android:text="Chelsea Islan"
            android:textSize="22sp" />

        <TextView
            android:id="@+id/age"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:text="20 years old" />

        <ImageView
            android:id="@+id/loved"
            android:layout_width="32dp"
            android:layout_height="32dp"
            android:layout_marginTop="10dp"
            android:src="@drawable/ic_favorite_pink_a700_48dp" />
    </LinearLayout>
</RelativeLayout>


text:
<?php
namespace Lonquan\TaobaoSDK\Top\Request;

use Lonquan\TaobaoSDK\Top\RequestCheckUtil;
use Lonquan\TaobaoSDK\Top\RequestInterface;

/**
 * TOP API: alibaba.tianji.distributor.order.submit request
 *
 * @author auto create
 * @since  1.0, 2016.01.04
 */
class AlibabaTianjiDistributorOrderSubmitRequest implements RequestInterface
{
    /**
     * 商品编码,如手机串号
     **/
    private $itemSerialNo;

    /**
     * 淘宝交易订单号
     **/
    private $orderNo;

    /**
     * 供应商产品编码,如SIM卡号
     **/
    private $productSerialNo;

    private $apiParas = [ ];

    public function setItemSerialNo($itemSerialNo)
    {
        $this->itemSerialNo = $itemSerialNo;
        $this->apiParas["item_serial_no"] = $itemSerialNo;
    }

    public function getItemSerialNo()
    {
        return $this->itemSerialNo;
    }

    public function setOrderNo($orderNo)
    {
        $this->orderNo = $orderNo;
        $this->apiParas["order_no"] = $orderNo;
    }

    public function getOrderNo()
    {
        return $this->orderNo;
    }

    public function setProductSerialNo($productSerialNo)
    {
        $this->productSerialNo = $productSerialNo;
        $this->apiParas["product_serial_no"] = $productSerialNo;
    }

    public function getProductSerialNo()
    {
        return $this->productSerialNo;
    }

    public function getApiMethodName()
    {
        return "alibaba.tianji.distributor.order.submit";
    }

    public function getApiParas()
    {
        return $this->apiParas;
    }

    public function check()
    {

        RequestCheckUtil::checkNotNull($this->orderNo, "orderNo");
    }

    public function putOtherTextParam($key, $value)
    {
        $this->apiParas[ $key ] = $value;
        $this->$key = $value;
    }
}