text:
<?php

namespace Nord\ImageManipulationService\Services;

use GuzzleHttp\Client as GuzzleClient;
use League\Flysystem\FilesystemInterface;
use League\Glide\Server;
use Nord\ImageManipulationService\Exceptions\ImageUploadException;
use Nord\ImageManipulationService\Helpers\FilePathHelper;
use Nord\ImageManipulationService\Helpers\MimeTypeHelper;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\Response;

/**
 * Class ImageManipulationService
 * @package Nord\ImageManipulationService\Services
 */
class ImageManipulationService
{

    /**
     * @var Server
     */
    private $glideServer;

    /**
     * @var PresetService
     */
    private $presetService;

    /**
     * @var FilePathHelper
     */
    private $filePathHelper;

    /**
     * @var GuzzleClient
     */
    private $guzzleClient;

    /**
     * @var MimeTypeHelper
     */
    private $mimeTypeHelper;

    /**
     * ImageManipulationService constructor.
     *
     * @param Server         $glideServer
     * @param PresetService  $presetService
     * @param FilePathHelper $filePathHelper
     * @param GuzzleClient   $guzzleClient
     * @param MimeTypeHelper $mimeTypeHelper
     */
    public function __construct(
        Server $glideServer,
        PresetService $presetService,
        FilePathHelper $filePathHelper,
        GuzzleClient $guzzleClient,
        MimeTypeHelper $mimeTypeHelper
    ) {
        $this->glideServer    = $glideServer;
        $this->presetService  = $presetService;
        $this->filePathHelper = $filePathHelper;
        $this->guzzleClient   = $guzzleClient;
        $this->mimeTypeHelper = $mimeTypeHelper;
    }

    /**
     * Returns the CDN base URL if defined, otherwise null
     *
     * @return string|null
     */
    public function getCdnBaseUrl(): ?string
    {
        $url = env('CDN_BASEURL');

        return !empty($url) ? $url : null;
    }

    /**
     * @param string $path
     * @param string $preset
     *
     * @return Response
     */
    public function getPresetImageResponse(string $path, string $preset): Response
    {
        $params = $this->presetService->getPresetParameters($preset);

        return $this->glideServer->getImageResponse($path, $params);
    }

    /**
     * @param string $path
     *
     * @return Response
     */
    public function getOriginalImageResponse(string $path): Response
    {
        // Bypass Glide and return the image from the source filesystem directly
        $sourceFilesystem = $this->glideServer->getSource();

        return $this->glideServer->getResponseFactory()->create($sourceFilesystem, $path);
    }

    /**
     * @param string $path
     * @param array  $parameters
     *
     * @return Response
     */
    public function getCustomImageResponse(string $path, array $parameters): Response
    {
        return $this->glideServer->getImageResponse($path, $parameters);
    }

    /**
     * Stores the uploaded file with the specified path. The filename and extension is taken from the uploaded file.
     *
     * @param UploadedFile $file
     * @param string       $path
     * @param string|null  $mimeType
     *
     * @return string
     */
    public function storeUploadedFile(UploadedFile $file, string $path, ?string $mimeType = null): string
    {
        // Get stream to the file contents
        $stream = $this->getStreamFromFile($file->getRealPath());

        // Determine the path to the file
        $filePath = $this->filePathHelper->determineFilePath($path,
            (string)$file->getClientOriginalName(),
            $file->getClientOriginalExtension());

        // Store
        $this->storeFileFromStream($filePath, $stream, $mimeType);

        return $filePath;
    }

    /**
     * Stores the file from the specified URL, using the specified path and filename
     *
     * @param string      $url
     * @param string      $path
     * @param string      $filename
     * @param string|null $mimeType
     *
     * @return string
     */
    public function storeUrlFile($url, string $path, string $filename, ?string $mimeType = null): string
    {
        // Get stream to the file contents
        $stream = $this->getStreamFromUrl($url);

        // Determine the path to the file
        $filePath = $this->filePathHelper->determineFilePath($path,
            $filename,
            $this->filePathHelper->getFileExtension($filename));

        // Store
        $this->storeFileFromStream($filePath, $stream, $mimeType);

        return $filePath;
    }

    /**
     * @return int
     */
    public function getStoredImagesCount(): int
    {
        return count($this->getFilesystem()->listContents('/', true));
    }

    /**
     * @return FilesystemInterface
     */
    private function getFilesystem(): FilesystemInterface
    {
        return $this->glideServer->getSource();
    }

    /**
     * Attempts to open a resource to the file at the specified path
     *
     * @param string $filePath
     *
     * @return resource
     *
     * @throws ImageUploadException
     */
    private function getStreamFromFile(string $filePath)
    {
        $stream = fopen($filePath, 'r+');

        if ($stream === false) {
            throw new ImageUploadException('Failed to open stream to uploaded file');
        }

        return $stream;
    }

    /**
     * Attempts to grab the contents of the specified URL and return it as a stream resource
     *
     * @param string $url
     *
     * @return resource
     *
     * @throws ImageUploadException
     */
    private function getStreamFromUrl(string $url)
    {
        // Try to grab the response body stream as a resource
        try {
            $response = $this->guzzleClient->get($url);
            $resource = $response->getBody()->detach();

            if ($resource === null) {
                throw new \RuntimeException('Could not open resource');
            }

            return $resource;
        } catch (\Exception $e) {
            throw new ImageUploadException('Failed to retrieve image from URL: ' . $e->getMessage(), $e);
        }
    }

    /**
     * Attempts to store the specified stream as a file at the specified file path
     *
     * @param string      $filePath
     * @param resource    $stream
     * @param string|null $mimeType
     *
     * @throws ImageUploadException
     */
    private function storeFileFromStream(string $filePath, $stream, ?string $mimeType = null)
    {
        try {
            $config = [];

            // Try to determine the MIME type if it isn't specified
            $mimeType = $mimeType ?? $this->mimeTypeHelper->guessMimeTypeFromStream($stream);

            if ($mimeType !== null) {
                // League-specific thing, will get converted to the right options down the line
                $config['mimetype'] = $mimeType;
            }

            $this->getFilesystem()->writeStream($filePath, $stream, $config);
            fclose($stream);
        } catch (\Exception $e) {
            throw new ImageUploadException('Failed to upload image: ' . $e->getMessage(), $e);
        }
    }

}


text:
layout: post
title: Ready for Anything
authors: David Allen

---

- **Book Title**: Ready for Anything – 52 Productivity Principles for Work and life
- **Author**: David Allen
- **Year written/published**: 2003
- **Book Source**: [Google Books](http://books.google.com/books?id=YoXiB9Og6QYC&dq=david+allen+52), [Library](http://vistaweb.nlb.gov.sg/cgi-bin/cw_cgi?resultsScreen+6516+1+2+1)
- **Some extracts**:

Some of the principles…

1. leaning up create new directions
2. You can only feel good about what you're not doing when you know what you're not doing
3. Knowing your commitments creates better choices
4. Getting to where you're going requires knowing where you are
9. If it's on your mind, it's probably not getting done
10. Creativity shows up when there's space
11. You won't see how to do it until you see yourself doing it
18. The clearer your purpose, the more ways to fulfil it
19. Perspective is the most valuable commodity on the planet
29. You system has to be better than your mind for your mind to let go
36. Prime our principles instead of policing your policies.
37. Use our mind to think about work instead of thinking of it.
41. Too controlled is out of control
42. The longer your horizon, the smoother your moves.
47. You speed up by slowing down.
49. Small things, done consistently create major project
52. It' easier to move when you are in motion

Bottom up approach:

1. What are your current tasks?
2. What are your current projects?
3. What are your current areas of responsibility?
4. How are your job, personal affairs going to change in the next year?
5. How are your organisation, your personal life going to change?
6. Why are you on the planet? are we holding somethings from ourselves?

> A fundamental principle is at work here. All of us, personally and organizationally, may be unconsciously holding back new and better things from ourselves because we feel that we won't be able to handle them successfully or sufficiently. Most of us think that we want MORE of many things. More money, more clients, more responsibility, more fun, more time. But do we really? I've learned that when I consciously want is only a fraction of what directs my creative energies. .. I didn't recognize them in the moment; and even if I did, I found subtle ways to push them away.

too much of organizing?

> Uncaptured, unclarified and therefore unmanaged things that you have agreed to won a piece of you and give you no rest. Naming your stuff gives you power over it. The best and most productive way to do your work is to be its master and not its slave.

Seeing yourself doing it...

> Your brain's pattern-recognition mechanism is triggered by the images you identify with and the focus you hold. You see the outcome first, and then you are consciously made conscious of information. Whether it's how to catch a ball, create a company, or care for your parents, the vision come first. If you won't see yourself having or doing something until you see how to do it, you'll never recognise the methods, though hey are all around you. Notice what you notice and how you make that happen.

form and functions... inner partnership:

1. My in-baskets
2. my projects and someday/maybe lists
3. my next action lists 4. weekly review

redpajama_set_name: RedPajamaGithub


text:
from six import text_type

from security_monkey.views import AuthenticatedService
from security_monkey.views import REVISION_COMMENT_FIELDS
from security_monkey.datastore import ItemRevisionComment
from security_monkey import db, rbac

from flask_restful import marshal
from flask_login import current_user
import datetime

class RevisionCommentGet(AuthenticatedService):
    decorators = [
        rbac.allow(["Comment"], ["GET"])
    ]

    def __init__(self):
        super(RevisionCommentGet, self).__init__()

    def get(self, revision_id, comment_id):
        """
            .. http:get:: /api/1/revisions/<int:revision_id>/comments/<int:comment_id>

            Get a specific Revision Comment

            **Example Request**:

            .. sourcecode:: http

                GET /api/1/revisions/1141/comments/22 HTTP/1.1
                Host: example.com
                Accept: application/json

            **Example Response**:

            .. sourcecode:: http

                HTTP/1.1 200 OK
                Vary: Accept
                Content-Type: application/json

                {
                    'id': 22,
                    'revision_id': 1141,
                    "date_created": "2013-10-04 22:01:47",
                    'text': 'This is a Revision Comment.'
                }

            :statuscode 200: no error
            :statuscode 404: Revision Comment with given ID not found.
            :statuscode 401: Authentication Error. Please Login.
        """
        query = ItemRevisionComment.query.filter(ItemRevisionComment.id == comment_id)
        query = query.filter(ItemRevisionComment.revision_id == revision_id)
        irc = query.first()

        if irc is None:
            return {"status": "Revision Comment Not Found"}, 404

        revision_marshaled = marshal(irc.__dict__, REVISION_COMMENT_FIELDS)
        revision_marshaled = dict(
            list(revision_marshaled.items()) +
            list({'user': irc.user.email}.items())
        )

        return revision_marshaled, 200

class RevisionCommentDelete(AuthenticatedService):
    decorators = [
        rbac.allow(["Comment"], ["DELETE"])
    ]

    def __init__(self):
        super(RevisionCommentDelete, self).__init__()

    def delete(self, revision_id, comment_id):
        """
            .. http:delete:: /api/1/revisions/<int:revision_id>/comments/<int:comment_id>

            Delete a specific Revision Comment

            **Example Request**:

            .. sourcecode:: http

                DELETE /api/1/revisions/1141/comments/22 HTTP/1.1
                Host: example.com
                Accept: application/json

            **Example Response**:

            .. sourcecode:: http

                HTTP/1.1 200 OK
                Vary: Accept
                Content-Type: application/json

                {
                    'status': "deleted"
                }

            :statuscode 202: Comment Deleted
            :statuscode 404: Revision Comment with given ID not found.
            :statuscode 401: Authentication Error. Please Login.
        """
        query = ItemRevisionComment.query.filter(ItemRevisionComment.id == comment_id)
        query = query.filter(ItemRevisionComment.revision_id == revision_id)
        irc = query.first()

        if irc is None:
            return {"status": "Revision Comment Not Found"}, 404

        query.delete()
        db.session.commit()

        return {"status": "deleted"}, 202

class RevisionCommentPost(AuthenticatedService):
    decorators = [
        rbac.allow(["Comment"], ["POST"])
    ]

    def post(self, revision_id):
        """
            .. http:post:: /api/1/revisions/<int:revision_id>/comments

            Create a new Revision Comment.

            **Example Request**:

            .. sourcecode:: http

                POST /api/1/revisions/1141/comments HTTP/1.1
                Host: example.com
                Accept: application/json

                {
                    "text": "This is a Revision Comment."
                }

            **Example Response**:

            .. sourcecode:: http

                HTTP/1.1 201 OK
                Vary: Accept
                Content-Type: application/json

                {
                    'id': 22,
                    'revision_id': 1141,
                    "date_created": "2013-10-04 22:01:47",
                    'text': 'This is a Revision Comment.'
                }

            :statuscode 201: Revision Comment Created
            :statuscode 401: Authentication Error. Please Login.
        """
        self.reqparse.add_argument('text', required=False, type=text_type, help='Must provide comment', location='json')
        args = self.reqparse.parse_args()

        irc = ItemRevisionComment()
        irc.user_id = current_user.id
        irc.revision_id = revision_id
        irc.text = args['text']
        irc.date_created = datetime.datetime.utcnow()

        db.session.add(irc)
        db.session.commit()
        db.session.refresh(irc)

        revision_marshaled = marshal(irc.__dict__, REVISION_COMMENT_FIELDS)
        revision_marshaled = dict(
            list(revision_marshaled.items()) +
            list({'user': irc.user.email}.items())
        )
        return revision_marshaled, 200


text:
import { Router } from 'express';
import { getPets, createPet, updatePet, deletePet, getPet } from '../controllers/pets';
const router = new Router();
import { isAuthenticated } from '../express/protectRoutes';

router.get('/', getPets);
router.post('/', isAuthenticated, createPet);
router.put('/', isAuthenticated, updatePet);
router.delete('/', isAuthenticated, deletePet);
router.get('/:_id', getPet);

export default router;


text:
"""Helper script for running end-to-end tests."""

import logging
import sys

from absl import app
from absl import flags

# We need to import the server_plugins module before other server init modules.
# pylint: disable=unused-import,g-bad-import-order
from grr_response_server import server_plugins
# pylint: disable=unused-import,g-bad-import-order

from grr_response_core import config
from grr_response_core.config import contexts
from grr_response_server import server_startup
from grr_response_test.end_to_end_tests import runner

flags.DEFINE_string("api_endpoint", "http://localhost:8000",
                    "GRR API endpoint.")

flags.DEFINE_string("api_user", "admin", "Username for GRR API.")

flags.DEFINE_string("api_password", "", "Password for GRR API.")

flags.DEFINE_string("client_id", "", "Id for client to run tests against.")

flags.DEFINE_list(
    "run_only_tests", [],
    "(Optional) comma-separated list of tests to run (skipping all others).")

flags.DEFINE_list("skip_tests", [],
                  "(Optional) comma-separated list of tests to skip.")

flags.DEFINE_list(
    name="manual_tests",
    default=[],
    help="(optional) A comma-separated list of manual tests to run.",
)

# We use a logging Filter to exclude noisy unwanted log output.
flags.DEFINE_list("filenames_excluded_from_log", ["connectionpool.py"],
                  "Files whose log messages won't get printed.")

flags.DEFINE_bool("upload_test_binaries", True,
                  "Whether to upload executables needed by some e2e tests.")

flags.DEFINE_list(
    "ignore_test_context", False,
    "When set, run_end_to_end_tests doesn't load the config with a "
    "default 'Test Context' added.")

class E2ELogFilter(logging.Filter):
  """Logging filter that excludes log messages for particular files."""

  def filter(self, record):
    return record.filename not in flags.FLAGS.filenames_excluded_from_log

def main(argv):
  del argv  # Unused.

  if not flags.FLAGS.ignore_test_context:
    config.CONFIG.AddContext(contexts.TEST_CONTEXT,
                             "Context for running tests.")

  server_startup.Init()
  for handler in logging.getLogger().handlers:
    handler.addFilter(E2ELogFilter())
    handler.setLevel(logging.INFO)

  test_runner = runner.E2ETestRunner(
      api_endpoint=flags.FLAGS.api_endpoint,
      api_user=flags.FLAGS.api_user,
      api_password=flags.FLAGS.api_password,
      run_only_tests=flags.FLAGS.run_only_tests,
      skip_tests=flags.FLAGS.skip_tests,
      manual_tests=flags.FLAGS.manual_tests,
      upload_test_binaries=flags.FLAGS.upload_test_binaries)
  test_runner.Initialize()

  results, _ = test_runner.RunTestsAgainstClient(flags.FLAGS.client_id)
  # Exit with a non-0 error code if one of the tests failed.
  for r in results.values():
    if r.errors or r.failures:
      sys.exit(1)

if __name__ == "__main__":
  app.run(main)


text:
package org.apache.s2graph.core.storage

import org.apache.hadoop.hbase.util.Bytes
import org.apache.s2graph.core.QueryParam
import org.apache.s2graph.core.mysqls.{LabelMeta, Label}
import org.apache.s2graph.core.types.{HBaseType, InnerVal, InnerValLike, InnerValLikeWithTs}
import org.apache.s2graph.core.utils.logger

object StorageDeserializable {
  /** Deserializer */
  def bytesToLabelIndexSeqWithIsInverted(bytes: Array[Byte], offset: Int): (Byte, Boolean) = {
    val byte = bytes(offset)
    val isInverted = if ((byte & 1) != 0) true else false
    val labelOrderSeq = byte >> 1
    (labelOrderSeq.toByte, isInverted)
  }

  def bytesToKeyValues(bytes: Array[Byte],
                       offset: Int,
                       length: Int,
                       schemaVer: String,
                       label: Label): (Array[(LabelMeta, InnerValLike)], Int) = {
    var pos = offset
    val len = bytes(pos)
    pos += 1
    val kvs = new Array[(LabelMeta, InnerValLike)](len)
    var i = 0
    while (i < len) {
      val k = label.labelMetaMap(bytes(pos))
      pos += 1
      val (v, numOfBytesUsed) = InnerVal.fromBytes(bytes, pos, 0, schemaVer)
      pos += numOfBytesUsed
      kvs(i) = (k -> v)
      i += 1
    }
    val ret = (kvs, pos)
    //    logger.debug(s"bytesToProps: $ret")
    ret
  }

  def bytesToKeyValuesWithTs(bytes: Array[Byte],
                             offset: Int,
                             schemaVer: String,
                             label: Label): (Array[(LabelMeta, InnerValLikeWithTs)], Int) = {
    var pos = offset
    val len = bytes(pos)
    pos += 1
    val kvs = new Array[(LabelMeta, InnerValLikeWithTs)](len)
    var i = 0
    while (i < len) {
      val k = label.labelMetaMap(bytes(pos))
      pos += 1
      val (v, numOfBytesUsed) = InnerValLikeWithTs.fromBytes(bytes, pos, 0, schemaVer)
      pos += numOfBytesUsed
      kvs(i) = (k -> v)
      i += 1
    }
    val ret = (kvs, pos)
    //    logger.debug(s"bytesToProps: $ret")
    ret
  }

  def bytesToProps(bytes: Array[Byte],
                   offset: Int,
                   schemaVer: String): (Array[(LabelMeta, InnerValLike)], Int) = {
    var pos = offset
    val len = bytes(pos)
    pos += 1
    val kvs = new Array[(LabelMeta, InnerValLike)](len)
    var i = 0
    while (i < len) {
      val k = LabelMeta.empty
      val (v, numOfBytesUsed) = InnerVal.fromBytes(bytes, pos, 0, schemaVer)
      pos += numOfBytesUsed
      kvs(i) = (k -> v)
      i += 1
    }
    //    logger.error(s"bytesToProps: $kvs")
    val ret = (kvs, pos)

    ret
  }

  def bytesToLong(bytes: Array[Byte], offset: Int): Long = Bytes.toLong(bytes, offset)

  def bytesToInt(bytes: Array[Byte], offset: Int): Int = Bytes.toInt(bytes, offset)
}

trait StorageDeserializable[E] {
  def fromKeyValues[T: CanSKeyValue](checkLabel: Option[Label], kvs: Seq[T], version: String, cacheElementOpt: Option[E]): Option[E] = {
    try {
      Option(fromKeyValuesInner(checkLabel, kvs, version, cacheElementOpt))
    } catch {
      case e: Exception =>
        logger.error(s"${this.getClass.getName} fromKeyValues failed.", e)
        None
    }
  }
  def fromKeyValuesInner[T: CanSKeyValue](checkLabel: Option[Label], kvs: Seq[T], version: String, cacheElementOpt: Option[E]): E
}


text: FROM eoger/brouter:onbuild


text:
var http = require('http'),
    url = require('url');

function start(route, handle) {
  function onRequest(request, response) {
    var pathname = url.parse(request.url).pathname;
    route(handle, pathname, response, request);
  }

  http.createServer(onRequest).listen(8888);
  console.warn('Server has started at localhost:8888...');
}

exports.start = start;


text:
using Generator.Web.UI.Client.Interface.Pages;

namespace Generator.Web.UI.Client.Interface
{
    public interface IApp
    {
        ICreateCustomerPage NavigateToCreateCustomerPage();
    }
}


text:
Public Class Desktop
    Public StartOpen As Boolean = False
    Public ButtonOn As Integer = "6"

    Private Sub StartButton_Click(sender As Object, e As EventArgs) Handles StartButton.Click
        If StartOpen = False Then
            StartPanel.Visible = True
            StartPanel.Location = New Point(StartButton.Location.X, StartButton.Location.Y - StartPanel.Height)
            StartOpen = True
        Else
            StartPanel.Visible = False
            StartOpen = False
        End If

    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles shutdownButton.Click
        Application.Exit()

    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles FBrowser_btn.Click
        If FunkyBrowser.Visible = False Then
            SetupTaskBar("Funky Browser")
            FunkyBrowser.Show()
            StartPanel.Visible = False
            StartOpen = False
        Else
            FileBrowser.Focus()
        End If
    End Sub

    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles myComputer_btn.Click
        If FileBrowser.Visible = False Then
            SetupTaskBar("File Browser")
            FileBrowser.Show()
            StartPanel.Visible = False
            StartOpen = False
        Else
            FileBrowser.Focus()
        End If
    End Sub

    '' Button6 - Button14 works as the buttons the start menu - for example the web browser being open etc.

    Public Function SetupTaskBar(ByVal nameofwindow As String)
        If ButtonOn = "13" Then
            SendNum(13, nameofwindow)
        End If
        If ButtonOn = "12" Then
            SendNum(12, nameofwindow)
        End If
        If ButtonOn = "11" Then
            SendNum(11, nameofwindow)
        End If
        If ButtonOn = "10" Then
            SendNum(10, nameofwindow)
        End If
        If ButtonOn = "9" Then
            SendNum(9, nameofwindow)
        End If
        If ButtonOn = "8" Then
            SendNum(8, nameofwindow)
        End If
        If ButtonOn = "7" Then
            SendNum(7, nameofwindow)
        End If
        If ButtonOn = "6" Then
            SendNum(6, nameofwindow)
        End If
    End Function

    Public Function SetupClosing(ByVal nameofwindow As String)
        If Button6.Text = nameofwindow Then
            RollbackTaskbar(6)
        End If
        If Button7.Text = nameofwindow Then
            RollbackTaskbar(7)
        End If
        If Button8.Text = nameofwindow Then
            RollbackTaskbar(8)
        End If
        If Button9.Text = nameofwindow Then
            RollbackTaskbar(9)
        End If
        If Button10.Text = nameofwindow Then
            RollbackTaskbar(10)
        End If
        If Button11.Text = nameofwindow Then
            RollbackTaskbar(11)
        End If
        If Button12.Text = nameofwindow Then
            RollbackTaskbar(12)
        End If
        If Button13.Text = nameofwindow Then
            RollbackTaskbar(13)
        End If
        If Button14.Text = nameofwindow Then
            RollbackTaskbar(14)
        End If
    End Function

    Public Function SendNum(ByVal numsend As Integer, ByVal nameofwindow As String)
        If numsend = "6" Then
            Button6.Text = nameofwindow
            Button6.Visible = True
            ButtonOn = ButtonOn + 1
        End If
        If numsend = "7" Then
            Button7.Text = nameofwindow
            Button7.Visible = True
            ButtonOn = ButtonOn + 1
        End If
        If numsend = "8" Then
            Button8.Text = nameofwindow
            Button8.Visible = True
            ButtonOn = ButtonOn + 1
        End If
        If numsend = "9" Then
            Button9.Text = nameofwindow
            Button9.Visible = True
            ButtonOn = ButtonOn + 1
        End If
        If numsend = "10" Then
            Button10.Text = nameofwindow
            Button10.Visible = True
            ButtonOn = ButtonOn + 1
        End If
        If numsend = "11" Then
            Button11.Text = nameofwindow
            Button11.Visible = True
            ButtonOn = ButtonOn + 1
        End If
        If numsend = "12" Then
            Button12.Text = nameofwindow
            Button12.Visible = True
            ButtonOn = ButtonOn + 1
        End If
        If numsend = "13" Then
            Button13.Text = nameofwindow
            Button13.Visible = True
            ButtonOn = ButtonOn + 1
        End If
    End Function

    Public Function RollbackTaskbar(ByVal buttonrolledback As Integer)
        If buttonrolledback = 6 Then
            Button6.Visible = False
            ButtonOn = 6
        End If
        If buttonrolledback = 7 Then
            Button7.Visible = False
            ButtonOn = ButtonOn - 1
        End If
        If buttonrolledback = 8 Then
            Button8.Visible = False
            ButtonOn = ButtonOn - 1
        End If
        If buttonrolledback = 9 Then
            Button9.Visible = False
            ButtonOn = ButtonOn - 1
        End If
        If buttonrolledback = 10 Then
            Button10.Visible = False
            ButtonOn = ButtonOn - 1
        End If
        If buttonrolledback = 11 Then
            Button11.Visible = False
            ButtonOn = ButtonOn - 1
        End If
        If buttonrolledback = 12 Then
            Button12.Visible = False
            ButtonOn = ButtonOn - 1
        End If
        If buttonrolledback = 13 Then
            Button13.Visible = False
            ButtonOn = ButtonOn - 1
        End If
        If buttonrolledback = 14 Then
            Button14.Visible = False
            ButtonOn = ButtonOn - 1
        End If
    End Function

    Private Sub Desktop_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.FormBorderStyle = FormBorderStyle.None
        Me.WindowState = FormWindowState.Maximized

        userName.Text = My.Settings.Username

        DesktopBackground.ImageLocation = My.Settings.Custom_Background_Location
    End Sub

    Private Sub DesktopBackground_Click(sender As Object, e As EventArgs) Handles DesktopBackground.Click
        If StartOpen = True Then
            StartPanel.Visible = False
            StartOpen = False
        End If
    End Sub

    Private Sub TimeTimer_Tick(sender As Object, e As EventArgs) Handles TimeTimer.Tick
        Time.Text = DateAndTime.Now.ToString
    End Sub

    Private Sub Panel1_Click(sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.Click
        If e.Button = MouseButtons.Right Then
            TaskBarRightclick.Show(Me, New Point(Cursor.Position.X, Cursor.Position.Y))
        End If
    End Sub

    Private Sub TaskManagerToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles TaskManagerToolStripMenuItem.Click
        If TaskManager.Visible = False Then
            SetupTaskBar("Task Manager")
            TaskManager.Show()
            StartPanel.Visible = False
            StartOpen = False
        Else
            TaskManager.Focus()
        End If
    End Sub

    Private Sub aboutButton_Click(sender As Object, e As EventArgs) Handles aboutButton.Click
        If AboutFunDesktopOS.Visible = False Then
            SetupTaskBar("About")
            AboutFunDesktopOS.Show()
            StartPanel.Visible = False
            StartOpen = False
        Else
            AboutFunDesktopOS.Focus()
        End If
    End Sub

    Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
        FocusWindow(Button6.Text, 6)
    End Sub

    Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
        FocusWindow(Button7.Text, 7)
    End Sub

    Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
        FocusWindow(Button8.Text, 8)
    End Sub

    Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
        FocusWindow(Button9.Text, 9)
    End Sub

    Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
        FocusWindow(Button10.Text, 10)
    End Sub

    Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
        FocusWindow(Button11.Text, 11)
    End Sub

    Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click
        FocusWindow(Button12.Text, 12)
    End Sub

    Private Sub Button13_Click(sender As Object, e As EventArgs) Handles Button13.Click
        FocusWindow(Button13.Text, 13)
    End Sub

    Private Sub Button14_Click(sender As Object, e As EventArgs) Handles Button14.Click
        FocusWindow(Button14.Text, 14)
    End Sub

    Public Function FocusWindow(ByVal ButtonText As String, ByVal Button As Integer)
        If ButtonText = "File Browser" Then
            If FileBrowser.WindowState = FormWindowState.Minimized Then
                FileBrowser.WindowState = FormWindowState.Normal
            Else
                FileBrowser.Focus()
            End If
        ElseIf ButtonText = "Funky Browser"
            If FunkyBrowser.WindowState = FormWindowState.Minimized Then
                FunkyBrowser.WindowState = FormWindowState.Normal
            Else
                FunkyBrowser.Focus()
            End If
        ElseIf ButtonText = "Task Manager"
            If TaskManager.WindowState = FormWindowState.Minimized Then
                TaskManager.WindowState = FormWindowState.Normal
            Else
                TaskManager.Focus()
            End If
        ElseIf ButtonText = "About"
            If AboutFunDesktopOS.WindowState = FormWindowState.Minimized Then
                AboutFunDesktopOS.WindowState = FormWindowState.Normal
            Else
                AboutFunDesktopOS.Focus()
            End If
        ElseIf ButtonText = "Settings"
            If Settings.WindowState = FormWindowState.Minimized Then
                Settings.WindowState = FormWindowState.Normal
            Else
                Settings.Focus()
            End If
        End If
    End Function

    Private Sub startSettings_Click(sender As Object, e As EventArgs) Handles startSettings.Click
        If Settings.Visible = False Then
            SetupTaskBar("Settings")
            Settings.Show()
            StartPanel.Visible = False
            StartOpen = False
        Else
            Settings.Focus()
        End If
    End Sub
End Class


text:
<Type Name="ICCKeypadDelegate" FullName="Cocos2D.ICCKeypadDelegate">
  <TypeSignature Language="C#" Value="public interface ICCKeypadDelegate" />
  <TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract ICCKeypadDelegate" />
  <AssemblyInfo>
    <AssemblyName>cocos2d-xna</AssemblyName>
    <AssemblyVersion>2.0.3.0</AssemblyVersion>
  </AssemblyInfo>
  <Interfaces />
  <Docs>
    To be added.
    <remarks>To be added.</remarks>
  </Docs>
  <Members>
    <Member MemberName="KeyBackClicked">
      <MemberSignature Language="C#" Value="public void KeyBackClicked ();" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void KeyBackClicked() cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.3.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="KeyMenuClicked">
      <MemberSignature Language="C#" Value="public void KeyMenuClicked ();" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void KeyMenuClicked() cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.3.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
  </Members>
</Type>


text:
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import java.io.*;

public class FileChooser
{

	////////////////////////////////Fields ///////////////////////////////////

	/** Represents a dialog box to select a file to be opened. */
	public static final String OPEN = "Open";

	/** Represents a dialog box to select a file to be saved. */
	public static final String SAVE = "Save";

	/** The last file obtained... as a seed to future searches */
	public static String LAST_FILE = "";

	////////////////////////////////// Methods ////////////////////////////////

	/**
	 * Allows the user to pick a file and return the full file name as a
	 * string. If the user did not pick a file, then the file name will be
	 * null.
	 *
	 * @param diagBoxType Type of dialog box to open.
	 *
	 * @return The full filename of the picked file, or null.
	 */
	public static String pickAFile(String diagBoxType) {
		JFileChooser fileChooser = null;

		// Start the filename off as null.
		String fileName = null;

		// Get the current media directory.
		String mediaDir = LAST_FILE; // was ""; this should use the last directory...

		/*
		 * Create a file for this and check that the directory exists and if it
		 * does, set the file chooser to use it.
		 */
		try {
			File file = new File(mediaDir);
			if (file.exists())
				fileChooser = new JFileChooser(file);
		} catch (Exception ex) {
		}

		// If no file chooser exists yet, create one
		if (fileChooser == null) {
			fileChooser = new JFileChooser();
		}
		/*
		 * Create a JFrame to be the parent of the file chooser open dialog;
		 * without this, the dialog may not be seen.
		 */
		JFrame frame = new JFrame();

		// Get the return value from choosing a file.
		int returnVal = (diagBoxType == FileChooser.OPEN) ? fileChooser
				.showOpenDialog(frame) : fileChooser.showSaveDialog(frame);

		/*
		 * If the return value says the user picked a file, return the
		 * corresponding file name.
		 */
		if (returnVal == JFileChooser.APPROVE_OPTION) {
			fileName = fileChooser.getSelectedFile().getPath();
		}
		LAST_FILE = fileName;
		return fileName;
	}

} // End of FileChooser class.


text:
<?php
namespace Chamilo\Core\Repository\Package;

use Chamilo\Core\Repository\Quota\Rights\Rights;
use Chamilo\Libraries\Translation\Translation;

/**
 *
 * @package repository.install
 */
/**
 * This installer can be used to create the storage structure for the repository.
 */
class Installer extends \Chamilo\Configuration\Package\Action\Installer
{

    public function extra()
    {
        // Create a root rights location for the quota requests
        if (! Rights::getInstance()->create_quota_root())
        {
            return false;
        }
        else
        {
            $this->add_message(self::TYPE_NORMAL, Translation::get('QuotaLocationCreated'));
        }

        return true;
    }
}


text:
package com.intellij.xdebugger.impl.breakpoints;

import com.intellij.configurationStore.ComponentSerializationUtil;
import com.intellij.configurationStore.XmlSerializer;
import com.intellij.featureStatistics.FeatureUsageTracker;
import com.intellij.icons.AllIcons;
import com.intellij.ide.ui.UISettings;
import com.intellij.openapi.actionSystem.ActionGroup;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.DefaultActionGroup;
import com.intellij.openapi.editor.markup.GutterDraggableObject;
import com.intellij.openapi.editor.markup.GutterIconRenderer;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.JDOMUtil;
import com.intellij.openapi.util.NlsSafe;
import com.intellij.openapi.util.UserDataHolderBase;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.pom.Navigatable;
import com.intellij.ui.ColorUtil;
import com.intellij.ui.ExperimentalUI;
import com.intellij.ui.JBColor;
import com.intellij.ui.LayeredIcon;
import com.intellij.ui.scale.JBUIScale;
import com.intellij.xdebugger.XDebugSession;
import com.intellij.xdebugger.XDebuggerBundle;
import com.intellij.xdebugger.XExpression;
import com.intellij.xdebugger.XSourcePosition;
import com.intellij.xdebugger.breakpoints.SuspendPolicy;
import com.intellij.xdebugger.breakpoints.XBreakpoint;
import com.intellij.xdebugger.breakpoints.XBreakpointProperties;
import com.intellij.xdebugger.breakpoints.XBreakpointType;
import com.intellij.xdebugger.impl.DebuggerSupport;
import com.intellij.xdebugger.impl.XDebugSessionImpl;
import com.intellij.xdebugger.impl.XDebuggerSupport;
import com.intellij.xdebugger.impl.XDebuggerUtilImpl;
import com.intellij.xdebugger.impl.actions.EditBreakpointAction;
import com.intellij.xdebugger.impl.settings.XDebuggerSettingManagerImpl;
import com.intellij.xml.CommonXmlStrings;
import com.intellij.xml.util.XmlStringUtil;
import org.jdom.Element;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.util.List;
import java.util.Objects;

public class XBreakpointBase<Self extends XBreakpoint
, P extends XBreakpointProperties, S extends BreakpointState> extends UserDataHolderBase implements XBreakpoint
, Comparable<Self> {
  @NonNls private static final String BR_NBSP = "
" + CommonXmlStrings.NBSP;
  private final XBreakpointType<Self, P> myType;
  private final @Nullable P myProperties;
  protected final S myState;
  private final XBreakpointManagerImpl myBreakpointManager;
  private Icon myIcon;
  private CustomizedBreakpointPresentation myCustomizedPresentation;
  private boolean myConditionEnabled = true;
  private XExpression myCondition;
  private boolean myLogExpressionEnabled = true;
  private XExpression myLogExpression;
  private volatile boolean myDisposed;

  public XBreakpointBase(final XBreakpointType<Self, P> type, XBreakpointManagerImpl breakpointManager, final @Nullable P properties, final S state) {
    myState = state;
    myType = type;
    myProperties = properties;
    myBreakpointManager = breakpointManager;
    initExpressions();
  }

  protected XBreakpointBase(final XBreakpointType<Self, P> type, XBreakpointManagerImpl breakpointManager, S breakpointState) {
    myState = breakpointState;
    myType = type;
    myBreakpointManager = breakpointManager;
    myProperties = type.createProperties();
    if (myProperties != null) {
      ComponentSerializationUtil.loadComponentState(myProperties, myState.getPropertiesElement());
    }
    initExpressions();
  }

  private void initExpressions() {
    myConditionEnabled = myState.isConditionEnabled();
    BreakpointState.Condition condition = myState.getCondition();
    myCondition = condition != null ? condition.toXExpression() : null;
    myLogExpressionEnabled = myState.isLogExpressionEnabled();
    BreakpointState.LogExpression expression = myState.getLogExpression();
    myLogExpression = expression != null ? expression.toXExpression() : null;
  }

  public final Project getProject() {
    return myBreakpointManager.getProject();
  }

  protected XBreakpointManagerImpl getBreakpointManager() {
    return myBreakpointManager;
  }

  public final void fireBreakpointChanged() {
    clearIcon();
    myBreakpointManager.fireBreakpointChanged(this);
  }

  @Override
  public XSourcePosition getSourcePosition() {
    return getType().getSourcePosition(this);
  }

  @Override
  public Navigatable getNavigatable() {
    XSourcePosition position = getSourcePosition();
    if (position == null) {
      return null;
    }
    return position.createNavigatable(getProject());
  }

  @Override
  public boolean isEnabled() {
    return myState.isEnabled();
  }

  @Override
  public void setEnabled(final boolean enabled) {
    if (enabled != isEnabled()) {
      myState.setEnabled(enabled);
      fireBreakpointChanged();
    }
  }

  @Override
  @NotNull
  public SuspendPolicy getSuspendPolicy() {
    return myState.getSuspendPolicy();
  }

  @Override
  public void setSuspendPolicy(@NotNull SuspendPolicy policy) {
    if (myState.getSuspendPolicy() != policy) {
      myState.setSuspendPolicy(policy);
      if (policy == SuspendPolicy.NONE) {
        FeatureUsageTracker.getInstance().triggerFeatureUsed("debugger.breakpoint.non.suspending");
      }
      fireBreakpointChanged();
    }
  }

  @Override
  public boolean isLogMessage() {
    return myState.isLogMessage();
  }

  @Override
  public void setLogMessage(final boolean logMessage) {
    if (logMessage != isLogMessage()) {
      myState.setLogMessage(logMessage);
      fireBreakpointChanged();
    }
  }

  @Override
  public boolean isLogStack() {
    return myState.isLogStack();
  }

  @Override
  public void setLogStack(final boolean logStack) {
    if (logStack != isLogStack()) {
      myState.setLogStack(logStack);
      fireBreakpointChanged();
    }
  }

  public boolean isConditionEnabled() {
    return myConditionEnabled;
  }

  public void setConditionEnabled(boolean conditionEnabled) {
    if (myConditionEnabled != conditionEnabled) {
      myConditionEnabled = conditionEnabled;
      fireBreakpointChanged();
    }
  }

  public boolean isLogExpressionEnabled() {
    return myLogExpressionEnabled;
  }

  public void setLogExpressionEnabled(boolean logExpressionEnabled) {
    if (myLogExpressionEnabled != logExpressionEnabled) {
      myLogExpressionEnabled = logExpressionEnabled;
      fireBreakpointChanged();
    }
  }

  @Override
  public String getLogExpression() {
    XExpression expression = getLogExpressionObject();
    return expression != null ? expression.getExpression() : null;
  }

  @Override
  public void setLogExpression(@Nullable final String expression) {
    if (!Objects.equals(getLogExpression(), expression)) {
      myLogExpression = XExpressionImpl.fromText(expression);
      fireBreakpointChanged();
    }
  }

  public XExpression getLogExpressionObjectInt() {
    return myLogExpression;
  }

  @Nullable
  @Override
  public XExpression getLogExpressionObject() {
    return myLogExpressionEnabled ? myLogExpression : null;
  }

  @Override
  public void setLogExpressionObject(@Nullable XExpression expression) {
    if (!Comparing.equal(myLogExpression, expression)) {
      myLogExpression = expression;
      fireBreakpointChanged();
    }
  }

  @Override
  public String getCondition() {
    XExpression expression = getConditionExpression();
    return expression != null ? expression.getExpression() : null;
  }

  @Override
  public void setCondition(@Nullable final String condition) {
    if (!Objects.equals(condition, getCondition())) {
      myCondition = XExpressionImpl.fromText(condition);
      fireBreakpointChanged();
    }
  }

  public XExpression getConditionExpressionInt() {
    return myCondition;
  }

  @Nullable
  @Override
  public XExpression getConditionExpression() {
    return myConditionEnabled ? myCondition : null;
  }

  @Override
  public void setConditionExpression(@Nullable XExpression condition) {
    if (!Comparing.equal(condition, myCondition)) {
      myCondition = condition;
      fireBreakpointChanged();
    }
  }

  @Override
  public long getTimeStamp() {
    return myState.getTimeStamp();
  }

  public boolean isValid() {
    return true;
  }

  @Override
  @Nullable
  public P getProperties() {
    return myProperties;
  }

  @Override
  @NotNull
  public XBreakpointType<Self,P> getType() {
    return myType;
  }

  public S getState() {
    Object propertiesState = myProperties == null ? null : myProperties.getState();
    Element element = propertiesState == null ? null : XmlSerializer.serialize(propertiesState);
    Element propertiesElement = element == null ? null : JDOMUtil.internElement(element);
    myState.setCondition(BreakpointState.Condition.create(!myConditionEnabled, myCondition));
    myState.setLogExpression(BreakpointState.LogExpression.create(!myLogExpressionEnabled, myLogExpression));
    myState.setPropertiesElement(propertiesElement);
    return myState;
  }

  public XBreakpointDependencyState getDependencyState() {
    return myState.getDependencyState();
  }

  public void setDependencyState(XBreakpointDependencyState state) {
    myState.setDependencyState(state);
  }

  @Nullable
  public String getGroup() {
    return myState.getGroup();
  }

  public void setGroup(String group) {
    myState.setGroup(StringUtil.nullize(group));
  }

  @NlsSafe
  public String getUserDescription() {
    return myState.getDescription();
  }

  public void setUserDescription(String description) {
    myState.setDescription(StringUtil.nullize(description));
  }

  public final void dispose() {
    myDisposed = true;
    doDispose();
  }

  protected void doDispose() {
  }

  public boolean isDisposed() {
    return myDisposed;
  }

  @Override
  public String toString() {
    return "XBreakpointBase(type=" + myType + ")";
  }

  @Nullable
  protected GutterDraggableObject createBreakpointDraggableObject() {
    return null;
  }

  protected List<? extends AnAction> getAdditionalPopupMenuActions(XDebugSession session) {
    return getType().getAdditionalPopupMenuActions((Self)this, session);
  }

  @NotNull
  @Nls
  public String getDescription() {
    StringBuilder builder = new StringBuilder();
    builder.append(CommonXmlStrings.HTML_START).append(CommonXmlStrings.BODY_START);
    builder.append(XBreakpointUtil.getDisplayText(this));

    String errorMessage = getErrorMessage();
    if (!StringUtil.isEmpty(errorMessage)) {
      builder.append(BR_NBSP);
      builder.append("");
      builder.append(errorMessage);
      builder.append("");
    }

    if (getSuspendPolicy() == SuspendPolicy.NONE) {
      builder.append(BR_NBSP).append(XDebuggerBundle.message("xbreakpoint.tooltip.suspend.policy.none"));
    }
    else if (getType().isSuspendThreadSupported()) {
      builder.append(BR_NBSP);
      //noinspection EnumSwitchStatementWhichMissesCases
      switch (getSuspendPolicy()) {
        case ALL -> builder.append(XDebuggerBundle.message("xbreakpoint.tooltip.suspend.policy.all"));
        case THREAD -> builder.append(XDebuggerBundle.message("xbreakpoint.tooltip.suspend.policy.thread"));
      }
    }

    String condition = getCondition();
    if (!StringUtil.isEmpty(condition)) {
      builder.append(BR_NBSP);
      builder.append(XDebuggerBundle.message("xbreakpoint.tooltip.condition"));
      builder.append(CommonXmlStrings.NBSP);
      builder.append(XmlStringUtil.escapeString(condition));
    }

    if (isLogMessage()) {
      builder.append(BR_NBSP).append(XDebuggerBundle.message("xbreakpoint.tooltip.log.message"));
    }

    if (isLogStack()) {
      builder.append(BR_NBSP).append(XDebuggerBundle.message("xbreakpoint.tooltip.log.stack"));
    }

    String logExpression = getLogExpression();
    if (!StringUtil.isEmpty(logExpression)) {
      builder.append(BR_NBSP);
      builder.append(XDebuggerBundle.message("xbreakpoint.tooltip.log.expression"));
      builder.append(CommonXmlStrings.NBSP);
      builder.append(XmlStringUtil.escapeString(logExpression));
    }

    XBreakpoint<?> masterBreakpoint = getBreakpointManager().getDependentBreakpointManager().getMasterBreakpoint(this);
    if (masterBreakpoint != null) {
      builder.append(BR_NBSP);
      String str = XDebuggerBundle.message("xbreakpoint.tooltip.depends.on");
      builder.append(str);
      builder.append(CommonXmlStrings.NBSP);
      builder.append(XBreakpointUtil.getShortText(masterBreakpoint));
    }

    builder.append(CommonXmlStrings.BODY_END).append(CommonXmlStrings.HTML_END);
    //noinspection HardCodedStringLiteral
    return builder.toString();
  }

  protected void updateIcon() {
    final Icon icon = calculateSpecialIcon();
    setIcon(icon != null ? icon : getType().getEnabledIcon());
  }

  protected void setIcon(Icon icon) {
    if (!XDebuggerUtilImpl.isEmptyExpression(getConditionExpression())) {
      LayeredIcon newIcon = new LayeredIcon(2);
      newIcon.setIcon(icon, 0);
      int hShift = ExperimentalUI.isNewUI() ? 5 : 10;
      newIcon.setIcon(AllIcons.Debugger.Question_badge, 1, hShift, 6);
      myIcon = JBUIScale.scaleIcon(newIcon);
    }
    else {
      myIcon = icon;
    }
  }

  @Nullable
  protected final Icon calculateSpecialIcon() {
    XDebugSessionImpl session = getBreakpointManager().getDebuggerManager().getCurrentSession();
    if (!isEnabled()) {
      // disabled icon takes precedence to other to visually distinguish it and provide feedback then it is enabled/disabled
      // (e.g. in case of mute-mode we would like to differentiate muted but enabled breakpoints from simply disabled ones)
      if (session == null || !session.areBreakpointsMuted()) {
        return getType().getDisabledIcon();
      }
      else {
        return getType().getMutedDisabledIcon();
      }
    }

    if (session == null) {
      if (getBreakpointManager().getDependentBreakpointManager().getMasterBreakpoint(this) != null) {
        return getType().getInactiveDependentIcon();
      }
    }
    else {
      if (session.areBreakpointsMuted()) {
        return getType().getMutedEnabledIcon();
      }
      if (session.isInactiveSlaveBreakpoint(this)) {
        return getType().getInactiveDependentIcon();
      }
      CustomizedBreakpointPresentation presentation = session.getBreakpointPresentation(this);
      if (presentation != null) {
        Icon icon = presentation.getIcon();
        if (icon != null) {
          return icon;
        }
      }
    }

    if (getSuspendPolicy() == SuspendPolicy.NONE) {
      return getType().getSuspendNoneIcon();
    }

    if (myCustomizedPresentation != null) {
      final Icon icon = myCustomizedPresentation.getIcon();
      if (icon != null) {
        return icon;
      }
    }
    return null;
  }

  public Icon getIcon() {
    if (myIcon == null) {
      updateIcon();
    }
    return myIcon;
  }

  @Nullable
  public String getErrorMessage() {
    final XDebugSessionImpl currentSession = getBreakpointManager().getDebuggerManager().getCurrentSession();
    if (currentSession != null) {
      CustomizedBreakpointPresentation presentation = currentSession.getBreakpointPresentation(this);
      if (presentation != null) {
        final String message = presentation.getErrorMessage();
        if (message != null) return message;
      }
    }
    return myCustomizedPresentation != null ? myCustomizedPresentation.getErrorMessage() : null;
  }

  CustomizedBreakpointPresentation getCustomizedPresentation() {
    return myCustomizedPresentation;
  }

  public void setCustomizedPresentation(CustomizedBreakpointPresentation presentation) {
    myCustomizedPresentation = presentation;
  }

  @NotNull
  public GutterIconRenderer createGutterIconRenderer() {
    return new BreakpointGutterIconRenderer();
  }

  public void clearIcon() {
    myIcon = null;
  }

  @Override
  public int compareTo(@NotNull Self self) {
    return myType.getBreakpointComparator().compare((Self)this, self);
  }

  protected class BreakpointGutterIconRenderer extends GutterIconRenderer implements DumbAware {
    @Override
    @NotNull
    public Icon getIcon() {
      return XBreakpointBase.this.getIcon();
    }

    @NotNull
    @Override
    public String getAccessibleName() {
      // [tav] todo: add "hit" state
      return XDebuggerBundle.message("accessible.name.icon.0.1.2", getType().getTitle(),
                                     getCondition() != null ? " " + XDebuggerBundle.message("accessible.name.icon.conditional") : "",
                                     !isEnabled() ? " " + XDebuggerBundle.message("accessible.name.icon.disabled") : "");
    }

    @Override
    @Nullable
    public AnAction getClickAction() {
      if (Registry.is("debugger.click.disable.breakpoints")) {
        return new ToggleBreakpointGutterIconAction(XBreakpointBase.this);
      } else {
        return new RemoveBreakpointGutterIconAction(XBreakpointBase.this);
      }
    }

    @Override
    @Nullable
    public AnAction getMiddleButtonClickAction() {
      if (!Registry.is("debugger.click.disable.breakpoints")) {
        return new ToggleBreakpointGutterIconAction(XBreakpointBase.this);
      } else {
        return new RemoveBreakpointGutterIconAction(XBreakpointBase.this);
      }
    }

    @Nullable
    @Override
    public AnAction getRightButtonClickAction() {
      return new EditBreakpointAction.ContextAction(this, XBreakpointBase.this, DebuggerSupport.getDebuggerSupport(XDebuggerSupport.class));
    }

    @Nullable
    @Override
    public ActionGroup getPopupMenuActions() {
      return new DefaultActionGroup(getAdditionalPopupMenuActions(getBreakpointManager().getDebuggerManager().getCurrentSession()));
    }

    @NotNull
    @Override
    public Alignment getAlignment() {
      return ExperimentalUI.isNewUI() && isBreakPointsOnLineNumbers() ? Alignment.LINE_NUMBERS : Alignment.RIGHT;
    }

    private static boolean isBreakPointsOnLineNumbers() {
      return XDebuggerSettingManagerImpl.getInstanceImpl().getGeneralSettings().isBreakpointsOnLineNumbers()
             && !UISettings.getInstance().getPresentationMode()
             && !Registry.is("editor.distraction.free.mode");
    }

    @Override
    @Nullable
    public String getTooltipText() {
      return getDescription();
    }

    @Override
    public GutterDraggableObject getDraggableObject() {
      return createBreakpointDraggableObject();
    }

    private XBreakpointBase<?,?,?> getBreakpoint() {
      return XBreakpointBase.this;
    }
    @Override
    public boolean equals(Object obj) {
      return obj instanceof XLineBreakpointImpl.BreakpointGutterIconRenderer
             && getBreakpoint() == ((XLineBreakpointImpl.BreakpointGutterIconRenderer)obj).getBreakpoint()
             && Comparing.equal(getIcon(), ((XLineBreakpointImpl.BreakpointGutterIconRenderer)obj).getIcon());
    }

    @Override
    public int hashCode() {
      return getBreakpoint().hashCode();
    }
  }
}


text:
<?php
// Copyright (c) Isaac Gouy 2009-2010
ob_start('ob_gzhandler');
require_once('config.php');
$T = 'all'; $L = 'scala'; $metaRobots = '';
require_once(LIB_PATH.'compare.php');
?>


text:
package org.wildfly.common.codec;

import org.wildfly.common.iteration.ByteIterator;
import org.wildfly.common.iteration.CodePointIterator;

/**
 * A base-64 alphabet.
 *
 * @see ByteIterator#base64Encode(Base64Alphabet)
 * @see CodePointIterator#base64Decode(Base64Alphabet)
 */
public abstract class Base64Alphabet extends Alphabet {

    /**
     * Construct a new instance.
     *
     * @param littleEndian {@code true} if the alphabet is little-endian (LSB first), {@code false} otherwise
     */
    protected Base64Alphabet(final boolean littleEndian) {
        super(littleEndian);
    }

    /**
     * Encode the given 6-bit value to a code point.
     *
     * @param val the 6-bit value
     * @return the Unicode code point
     */
    public abstract int encode(int val);

    /**
     * Decode the given code point.  If the code point is not valid, -1 is returned.
     *
     * @param codePoint the code point
     * @return the decoded 6-bit value or -1 if the code point is not valid
     */
    public abstract int decode(int codePoint);

    /**
     * The standard RFC 4648 base-64 alphabet.
     */
    public static final Base64Alphabet STANDARD = new Base64Alphabet(false) {
        public int encode(final int val) {
            if (val <= 25) {
                return 'A' + val;
            } else if (val <= 51) {
                return 'a' + val - 26;
            } else if (val <= 61) {
                return '0' + val - 52;
            } else if (val == 62) {
                return '+';
            } else {
                assert val == 63;
                return '/';
            }
        }

        public int decode(final int codePoint) throws IllegalArgumentException {
            if ('A' <= codePoint && codePoint <= 'Z') {
                return codePoint - 'A';
            } else if ('a' <= codePoint && codePoint <= 'z') {
                return codePoint - 'a' + 26;
            } else if ('0' <= codePoint && codePoint <= '9') {
                return codePoint - '0' + 52;
            } else if (codePoint == '+') {
                return 62;
            } else if (codePoint == '/') {
                return 63;
            } else {
                return -1;
            }
        }
    };
}


text:
id: RHEL-07-020152
status: implemented
tag: packages
---

The STIG requires that repository XML files are verified during ``yum`` runs.

.. warning::

    This setting is disabled by default because it can cause issues with CentOS
    systems and prevent them from retrieving repository information. Deployers
    who choose to enable this setting should test it thoroughly on
    non-production environments before applying it to production systems.

Deployers can override this default and opt in for the change by setting the
following Ansible variable:

.. code-block:: yaml

    security_enable_gpgcheck_repo: yes


text:
/**
 * Definition for undirected graph.
 * class UndirectedGraphNode {
 *     int label;
 *     List<UndirectedGraphNode> neighbors;
 *     UndirectedGraphNode(int x) { label = x; neighbors = new ArrayList<UndirectedGraphNode>(); }
 * };
 */
public class Solution {
	private HashMap<Integer, UndirectedGraphNode> map = new HashMap<>();
	public UndirectedGraphNode cloneGraph(UndirectedGraphNode node) {
        return clone(node);
    }

    private UndirectedGraphNode cloneNode(UndirectedGraphNode node){
    	if(node == null){
    		return null;
    	}
    	if(map.containsKey(node.label)){
    		return map.get(node.label);
    	}

    	UndirectedGraphNode clone = new UndirectedGraphNode(node.label);
    	map.put(node.label,clone);
    	for(UndirectedGraphNode neigh:node.neighbors){
    		clone.neighbors.add(cloneNode(neigh));
    	}
    	return clone;
    }
}


text:
  $(function() {
    $('#datetimepicker2').datetimepicker({
      language: 'en',
      pick12HourFormat: true
    });
  });


text:
import { extend } from 'lodash';
import path from 'path';
import default_options from './default-options';
import Base from '../base';
import fs from 'fs-extra-promisify';

/// @name Folder
/// @page api
/// @description This is used to output data to the Folder
export default class Folder extends Base {
  ///# @name constructor
  ///# @arg {object} options - The base options
  ///# @arg {object} output_options - The output options
  constructor(options = {}, output_options = {}) {
    super(options);
    this.output_options = extend({}, default_options, output_options);

    this.prepared = false;
  }

  ///# @name prepare
  ///# @description
  ///# This is used to prepare the saving functionality that is determined by the
  ///# options that were passed to the constructor.
  ///# It sets a variable of `this.preparing` that ultimately calls `this.setup` that returns a promise.
  ///# This way when you go to save data it, that function will know if the setup is complete or not and
  ///# wait for it to be done before it starts saving data.
  ///# @returns {promise} - The setup function that was called
  ///# @async
  prepare() {
    this.preparing = true;
    this.preparing = this.setup();
    return this.preparing;
  }

  ///# @name setup
  ///# @description
  ///# This is used to setup the saving function that will be used.
  async setup() {
    // if this.prepare hasn't been called then run it first.
    if (this.preparing == null) {
      return this.prepare();
    }

    // Resolve the output path to make sure it's absolute
    this.output_options.output = this.resolvePaths(this.output_options.output)[0];

    // Ensure there is a directory to write to. This way we can use `fs.writeFile`
    // instead of `fs.outputFile` which has extra checks that we can skip over
    await fs.ensureDir(this.output_options.output);

    this.prepared = true;
  }

  ///# @name output
  ///# @description
  ///# This is used to output the data that's passed to it
  ///# @arg {string} id - The id to use for this data
  ///# @arg {object, array, string} data - The data that you want to be saved
  ///# @async
  async output(id, data) {
    if (this.prepared !== true) {
      if (this.preparing == null) {
        this.prepare();
      }
      await this.preparing;
    }

    return fs.writeFile(path.join(this.output_options.output, `${id}.${this.output_options.format}`), data);
  }
}


text:
"""Test to demonstrate basic Keras training with a variety of strategies."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import glob
import os

import tensorflow.compat.v2 as tf

ds_combinations = tf.__internal__.distribute.combinations

# Note: Strategy combinations are not (yet) public APIs, so they are subject
# to API changes and backward-compatibility is not guaranteed.
# TODO(b/188763034): Proceed to export the strategy combinations as public APIs.
STRATEGIES = [
    ds_combinations.default_strategy,
    ds_combinations.mirrored_strategy_with_cpu_1_and_2,
    ds_combinations.mirrored_strategy_with_two_gpus,
    ds_combinations.tpu_strategy,
    ds_combinations.cloud_tpu_strategy,
    ds_combinations.parameter_server_strategy_3worker_2ps_cpu,
    ds_combinations.parameter_server_strategy_3worker_2ps_1gpu,
    ds_combinations.multi_worker_mirrored_2x1_cpu,
    ds_combinations.multi_worker_mirrored_2x2_gpu,
    ds_combinations.central_storage_strategy_with_two_gpus,
]

@ds_combinations.generate(
    tf.__internal__.test.combinations.combine(strategy=STRATEGIES, mode="eager")
)
class DistributedTrainingTest(tf.test.TestCase):
    """Test to demonstrate basic Keras training with a variety of strategies."""

    def testKerasTrainingAPI(self, strategy):
        if not tf.__internal__.tf2.enabled() and isinstance(
            strategy, tf.distribute.experimental.ParameterServerStrategy
        ):
            self.skipTest(
                "Parameter Server strategy with dataset creator need to be run "
                "when eager execution is enabled."
            )

        # A `dataset_fn` is required for `Model.fit` to work across all
        # strategies.
        def dataset_fn(input_context):
            batch_size = input_context.get_per_replica_batch_size(
                global_batch_size=64
            )
            x = tf.random.uniform((10, 10))
            y = tf.random.uniform((10,))
            dataset = (
                tf.data.Dataset.from_tensor_slices((x, y)).shuffle(10).repeat()
            )
            dataset = dataset.shard(
                input_context.num_input_pipelines,
                input_context.input_pipeline_id,
            )
            return dataset.batch(batch_size).prefetch(2)

        with strategy.scope():
            model = tf.keras.Sequential([tf.keras.layers.Dense(10)])
            optimizer = tf.keras.optimizers.SGD()
            model.compile(optimizer, loss="mse", steps_per_execution=5)

        x = tf.keras.utils.experimental.DatasetCreator(dataset_fn)

        logdir = os.path.join(self.get_temp_dir(), "logdir")
        model.fit(
            x,
            epochs=2,
            steps_per_epoch=20,
            callbacks=[
                tf.keras.callbacks.TensorBoard(
                    logdir,
                    update_freq=5,
                    write_steps_per_second=True,
                )
            ],
        )

        events_got = []
        for event_file in glob.glob(logdir + "/train/events.out.*"):
            for event in tf.compat.v1.train.summary_iterator(event_file):
                if not event.summary:
                    continue
                for value in event.summary.value:
                    if value.tag != "batch_loss":
                        continue
                    events_got += [event.step]

        # total steps = epochs * steps_per_epoch
        events_expected = [5, 10, 15, 20, 25, 30, 35, 40]

        if isinstance(
            strategy, tf.distribute.experimental.ParameterServerStrategy
        ):
            # Metrics are not logged with this strategy as they are not
            # immediately available on batch end
            events_expected = []
        if (
            strategy.cluster_resolver
            and strategy.cluster_resolver.task_type == "worker"
        ):
            # The below assertion is run by both chief and workers when using
            # `tf.distribute.MultiWorkerMirroredStrategy`, but only the chief
            # will log events.
            events_expected = []

        self.assertEqual(events_got, events_expected)

if __name__ == "__main__":
    tf.__internal__.distribute.multi_process_runner.test_main()


text: <h1 th:text="${message}">Text inside tag will be replaced by ${message}</h1>


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE locale SYSTEM "../../../../../lib/pkp/dtd/locale.dtd">

<locale name="de_DE" full_name="Deutsch (Deutschland))">
	<message key="plugins.importexport.datacite.displayName">DataCite-Export/Registrierungs-Plug-In</message>
	<message key="plugins.importexport.datacite.description">Exportieren oder registrieren Sie Metadaten zu Ausgaben, Artikeln, Fahnen und Zusatzdateien im DataCite-Format.</message>

	<message key="plugins.importexport.datacite.intro"><![CDATA[
		Wenn Sie DOI bei DataCite registrieren möchten, kontaktieren Sie bitte die/den
		Bevollmächtigte/n über die
		DataCite-Homepage, die/der Sie an Ihr lokales DataCite-Mitglied verweisen wird.
		Nachdem Sie Kontakt zu der Mitgliedsorganisation hergestellt haben, wird Ihnen ein
		Zugang zum DataCite-Dienst zum Ausstellen persistenter Kennungen (DOI) und zur
		Registrierung zugehöriger Metadaten ermöglicht. Wenn Sie über keinen eigenen Benutzer/innennamen und
		Passwort verfügen, werden Sie immerhin in der Lage sein, in das DataCite-XML-Format zu exportieren, aber Sie
		können Ihre DOI nicht aus OJS heraus bei DataCite registrieren.
		Bitte beachten Sie, dass das Passwort im Klartext, d.h. unverschlüsselt, gespeichert werden
		wird, da der DataCite-Registrierungs-Dienst dies erfordert.
	]]></message>

	<message key="plugins.importexport.datacite.settings.description"><![CDATA[Bitte konfigurieren Sie das DataCite-Export-Plug-In, bevor Sie es das erste Mal benutzen.]]></message>

	<message key="plugins.importexport.datacite.settings.form.description">Bitte konfigurieren Sie das DataCite-Export-Plug-In:</message>
	<message key="plugins.importexport.datacite.settings.form.username">Benutzer/innenname (symbol)</message>
	<message key="plugins.importexport.datacite.settings.form.usernameRequired">Bitte geben Sie den Benutzer/innennamen (symbol), den Sie von DataCite erhalten haben. Der Benutzer/innenname darf keinen Doppelpunkt enthalten.</message>

	<message key="plugins.importexport.datacite.export.suppFiles">Ausgewählte Zusatzdateien exportieren</message>
	<message key="plugins.importexport.datacite.export.selectSuppFile">Wählen Sie Zusatzdateien aus</message>
	<message key="plugins.importexport.datacite.export.noSuppFiles">Keinen Zusatzdateien sind momentan DOI zugewiesen.</message>

	<message key="plugins.importexport.datacite.export.error.suppFileNotFound">Keine Zusatzdateien passen zu der angegebenen ID: {$param}.</message>

	<message key="plugins.importexport.datacite.cliUsage"><![CDATA[Verwendung:
{$scriptName} {$pluginName} export xmlFileName journal_path {issues|articles|galleys|suppfiles} objectId1 [objectId2] ...
{$scriptName} {$pluginName} register journal_path {issues|articles|galleys|suppfiles} objectId1 [objectId2] ...
]]></message>
</locale>


text:
import React from 'react';
import { mount } from 'enzyme';
import { IntlProvider } from 'react-intl';
import { ApolloProvider } from 'react-apollo';

import SubscriptionCard from '../SubscriptionCard';

import initClient from '../../lib/initClient';

const apolloClient = initClient();

describe('SubscriptionCard.test.js', () => {
  const mountComponent = props =>
    mount(
      <IntlProvider locale="en">
        <ApolloProvider client={apolloClient}>
          <SubscriptionCard {...props} />
        </ApolloProvider>
      </IntlProvider>,
    );

  const defaultValues = {
    slug: 'userSlug',
    paymentMethods: [],
    subscription: {
      interval: 'month',
      totalAmount: 1000,
      currency: 'USD',
      isSubscriptionActive: true,
      collective: {
        backgroundImage: null,
        slug: 'collectiveSlug',
      },
    },
  };

  it("doesn't display actions when not logged in", () => {
    const values = Object.assign({}, defaultValues, { paymentMethodInUse: {} });
    const component = mountComponent(values);

    expect(component.find('.actions').length).toEqual(0);
  });

  // TODO: skipping these tests to get subscriptions out in time
  it.skip('displays actions when logged in for this user', () => {});

  it.skip('displays past-due status when subscription is past-due', () => {});

  it.skip('displays cancel buttons when Cancel Contribution is selected', () => {});

  it.skip('reverts back to normal state when Cancel action is canceled', () => {});

  it.skip('displays paymentmethod options when Update Payment Method is selected', () => {});
});


text:
Pigeon
===============

[![Build Status](https://travis-ci.org/larablocks/pigeon.svg)](https://travis-ci.org/larablocks/pigeon)
[![Latest Stable Version](https://poser.pugx.org/larablocks/pigeon/version)](https://packagist.org/packages/larablocks/pigeon)
[![License](https://poser.pugx.org/larablocks/pigeon/license)](https://packagist.org/packages/larablocks/pigeon)

A more flexible email message builder for Laravel 5 including chained methods, reusable message type configurations, and email layout and template view management.

> Note: All Larablocks packages will have releases in line with the major Laravel framework version release.
(Ex. Pigeon 5.4.* is tested to work with Laravel 5.4.* while Pigeon 5.1.* is tested to worked with Laravel 5.1.*)

## Installation

Add `larablocks/pigeon` as a requirement to `composer.json`:

```javascript
{
    "require": {
        "larablocks/pigeon": "~5.4"
    }
}
```

Update your packages with `composer update` or install with `composer install`.

## Laravel Integration

To wire this up in your Laravel project you need to add the service provider. Open `app.php`, and add a new item to the providers array.

```php
Larablocks\Pigeon\PigeonServiceProvider::class,
```

Then you may add a Facade for more convenient usage. In your `app.php` config file add the following line to the `aliases` array.

```php
'Pigeon' => Larablocks\Pigeon\Pigeon::class,
```

Note: The Pigeon facade will load automatically, so you don't have to add it to the `app.php` file but you may still want
to keep record of the alias.

To publish the default config file `config/pigeon.php` along with the default email view files use the artisan command:

`php artisan vendor:publish --provider="Larablocks\Pigeon\PigeonServiceProvider"`

If you wish to not publish the view files and only publish the config then use the artisan command:

`php artisan vendor:publish --provider="Larablocks\Pigeon\PigeonServiceProvider" --tag="config"`

## Usage as a Facade

```php
Pigeon::
```

### Setting the General Message Properties

Pigeon will load all properties set in the `default` area of your config before you construct your message.

####Set message addresses:

All these address add methods can be used with any of the address add functions (to, cc, bcc, replyTo, from, sender)

Add a single address with no name
```php
Pigeon::to('john.doe@domain.com')
Pigeon::cc('john.doe@domain.com')
Pigeon::bcc('john.doe@domain.com')
Pigeon::replyTo('john.doe@domain.com')
Pigeon::from('john.doe@domain.com')
Pigeon::sender('john.doe@domain.com')
```

Add a single address with name
```php
Pigeon::to('john.doe@domain.com', 'John Doe')
....
```

Add array of addresses with no names
```php
Pigeon::to(['john.doe@domain.com', 'jane.doe@domain.com'])
...
```

Add array of addresses some with names, some without names
```php
Pigeon::to(['john.doe@domain.com' => 'John Doe', 'jane.doe@domain.com'])
...
```

####Set Subject:
```php
Pigeon::subject('My Subject')
```

####File Attachments:

Attach a single file with no options
```php
Pigeon::attach('/path/to/file/attachment')
```

Attach a single file with options
```php
Pigeon::attach('/path/to/file/attachment', ['as' => 'Attachment', 'mime' => 'jpg'])
```

Attach an array of files
```php
Pigeon::attach([
    [
     'path' => '/path/to/file/attachment1'
     'options' => []
    ],
    [
     'path' => '/path/to/file/attachment2'
     'options' => ['as' => 'Attachment 2', 'mime' => 'pdf']
    ]
])
```

### Setting the Message View Properties

####Set layout view file:
```php
Pigeon::layout('emails.layouts.my_layout_view')
```

####Set template view file:
```php
Pigeon::template('emails.templates.my_template_view')
```

####Passing View Variables:

Passing simple variables:
```php
Pigeon::pass([
 'stringVariable' => 'test string',
 'intVariable' => 2,
 'boolVariable' => true
])
```

Passing object variables:
```php
$user = new User();
$user->first_name = 'John';
$user->last_name = 'Doe';
Pigeon::pass([
 'userObjectVariable' => $user
])
```

If ```pass()``` is used more than once it will merge previously passed variables with the current passed set.

>Note: Make sure all variables pre-defined in your layout and template view files are passed to your Pigeon message.

####Clearing View Variables:

Clear all previously passed view variables

```php
Pigeon::clear()
```

### Custom Messages Types

Custom message types will be configured in the `config/pigeon.php` file. In this file you can find examples on how
to properly set up a custom message type.

#### Default:

Set your defaults for all messages sent with Pigeon in ```config\pigeon.php```

```php
'default' => [
    'to' => [],
    'cc' => [],
    'bcc' => [],
    'replyTo' => [],
    'from' => [], // if nothing is entered here, your mail.php default will still be used
    'sender' => [],
    'attachments' => [],
    'subject' => 'Pigeon Delivery',
    'layout' => 'emails.layouts.default',
    'template' => 'emails.templates.default',
    'message_variables' => []
]
```

####Load Custom Message:

Set your defaults for a particular message type to be sent with Pigeon in ```config\pigeon.php```

```php
'custom_message_type' => [
    'from' => ['from@myapp.com' => 'My Custom App'],
    'subject' => 'My Pigeon Custom Message',
    'layout' => 'emails.layouts.default',
    'template' => 'emails.templates.default'
]
```

This will load all the message properties from your config defined for `custom_message_type`.

```php
Pigeon::type('custom_message_type');
```

#### Order of Loading:

Default -> Custom Message (if set and loaded) -> Properties set with individual Pigeon functions

### Sending the Message

####Send Message:
```php
Pigeon::send();
```

####Send Raw Message:

Pass a string as a param for the send() function and it will use the string as a raw message send and will ignore any
view files or view variables assigned.

```php
Pigeon::send('This is my raw message');
```

### Example - Using it all together

```php
Pigeon::to(['john.doe@domain.com', 'jane.doe@domain.com'])
->cc('fred.doe@domain.com')
->bcc('george.doe@domain.com')
->subject('This is the Subject')
->attach('/path/to/file/attachment')
->layout('emails.layouts.my_layout_view')
->template('emails.templates.my_template_view')
->pass(['firstVariable' => 'test string', 'secondVariable' => 2, 'thirdVariable' => true])
->send();
```

### Example - Simple call

```php
Pigeon::to('me@domain.com')->subject('Testing Pigeon')->send('Sending myself a quick raw message');
```

### Example - Sending a custom message

```php
Pigeon::type('custom_message_type')->to('me@domain.com')->send();
```

## Usage as a Passed Dependency

To pass Pigeon as a dependency will will pass the interface `Larablocks\Pigeon\PigeonInterface`. For now the only library
that implements this interface is `Larablocks\Pigeon\IlluminateMailer` provided by Laravel but we want to allow for other mailing libraries to be used in the future.
The `config/pigeon.php` config file for Pigeon automatically sets IlluminateMailer as the default mailer library for you.

```php
'library' => 'IlluminateMailer',
```

###Passing Pigeon to a constructor:
```php
public function __construct(Larablocks\Pigeon\PigeonInterface $pigeon)
{
$this->pigeon = $pigeon;
}
```

###Starting a new default message:

```php
$this->pigeon->to('me@domain.com')->subject('Pigeon Raw Test Message')->send('Sending myself a quick raw message');
```

###Starting a new custom message type:
```php
$this->pigeon->type('custom_message_type')->to('me@domain.com')->send();
```

## License

Pigeon is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)


text:
/* the wifi-cc3000 library is bundled in with Tessel's firmware,
 * so there's no need for an npm install. It's similar
 * to how require('tessel') works.
 */

var wifi = require('wifi-cc3000');
var Class = require('./base/Class');
var _ = require('underscore');

module.exports = new (Class.inherit({

    initialize: function() {
        Class.prototype.initialize.apply(this, arguments);
        this.config = require('./wifi/configuration');
    },

    setup: function(callback) {
        this.callback = callback;

        wifi.on('disconnect', _.bind(onDisconnect, this));
        wifi.on('timeout', _.bind(onTimeout, this));
        wifi.on('error', onError);

        this.connect(this.config.getNextEntry());
    },

    connect: function(hotspot) {
        if(wifi.isEnabled()) {
            if(!wifi.isConnected()) {
                hotspot.connect(this.callback);
            } else {
                var info = wifi.connection();
                alreadyConnected(this.config.search(info.ssid), info, this.callback);
            }
        } else {
            wifi.enable(_.bind(function() {
                this.connect(hotspot);
            }, this));
        }
    },

    isBusy: function() {
        return wifi.isBusy();
    },

    disconnect: function() {
        // Only works when process keeps alive (e.g. process.ref())
        wifi.disconnect();
    },

    destroy: function() {
        Class.prototype.destroy.apply(this, arguments);
    }
}))();

function alreadyConnected(hotspot, info, callback) {
    console.log('wifi is already connected to', info.ssid);

    if(hotspot) {
        hotspot.update({info: info});
        callback(hotspot);
    } else {
        console.log('wifi is not authorized. register it in config/default.json');
    }
}

function onDisconnect(err, data) {
    console.log("disconnect emitted", err, data);
    var hotspot = this.config.getEntry();
    hotspot.reset(this.callback);
}

function onTimeout(err) {
    console.log("timeout emitted");
    wifi.reset(_.bind(function() {
        this.connect(this.config.getNextEntry());
    }, this));
}

function onError(err) {
    console.log("error emitted", err);
}


text:
var sys = require('sys');

var url = {
  regular: function (post) { return post['@'].url; },
  link: function (post) { return post['link-url']; },
  photo: function (post) {
    var tumblelog = post.tumblelog['@'].url.replace(/\/$/, ''),
        generic = post['photo-url'][0]['#'],
        link = post['photo-link-url'];
    if (!link || tumblelog == link.replace(/\/$/, '')) {
      return generic;
    };
    return link;
  },
  video: function (post) {
    var link = post['video-source'];
    return (link.indexOf('http') == 0) ? link : url.regular(post);
  }
};

var getUrl = function (post) {
  switch (post['@'].type) {
    case 'link':
      return url.link(post);
    case 'photo':
      return url.photo(post);
    case 'video':
      return url.video(post);
  }
  return url.regular(post);
};

var title = {
  none: getUrl,
  regular: function (post) {
    var t = post['regular-title'];
    return (t) ? t : title.none(post);
  },
  link: function (post) {
    var t = post['link-text'];
    return (t) ? t : title.none(post);
  },
  conversation: function (post) {
    var t = post['conversation-title'];
    return (t) ? t : title.none(post);
  },
  video: function (post) {
    var t = post['video-title'];
    return (t) ? t : title.none(post);
  }
};

var getTitle = function (post) {
  switch (post['@'].type) {
    case 'regular':
      return title.regular(post);
    case 'link':
      return title.link(post);
    case 'conversation':
      return title.conversation(post);
    case 'video':
      return title.video(post);
  }
  return title.none(post);
};

exports.serialize = function (post) {
  return { url: getUrl(post), title: getTitle(post) };
};


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>BICORDER: C12832A_config Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

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

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

BICORDER
    v0.0.1

LPC824 based sensor box thingy

Main Page

Data Structures

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Data Structures

Data Structure Index

Data Fields

C12832A_config Struct Reference

#include <eGFX_Driver_C12832A_LPC824.h>

Data Fields

LPC_SPI_T * 	lpc_spi

uint8_t 	a0_pin

uint8_t 	rst_pin

uint8_t 	ssel_num

Detailed Description

The C12832A object

Definition at line 89 of file eGFX_Driver_C12832A_LPC824.h.

The documentation for this struct was generated from the following file:

eGFX_Driver_C12832A_LPC824.h

<address class="footer">
Generated on Tue Jul 5 2016 22:07:43 for BICORDER by

 1.8.11
</address>


text:
    #pragma warning (push)
    #pragma warning (disable: 4100 4702)
#endif

#include <grpcpp/grpcpp.h>
#include <grpcpp/impl/codegen/rpc_method.h>
#include <grpcpp/impl/codegen/rpc_service_method.h>
#include <grpcpp/impl/codegen/service_type.h>

#ifdef _MSC_VER
    #pragma warning (pop)
#endif

#include <boost/assert.hpp>

namespace bond { namespace ext { namespace gRPC { namespace detail {

struct io_manager_tag;

/// @brief Base class that all Bond gRPC++ services implement.
///
/// @note This class is for use by generated and helper code only.
///
/// Helper class that codegen uses to generate abstract service classes,
/// which a bond::ext::gRPC::server then hosts multiple services.
template <typename TThreadPool>
class service : private grpc::Service
{
public:
    virtual ~service() { }

    /// @brief Starts the service.
    ///
    /// @note This method is for use by generated and helper code only.
    ///
    /// Typical implementations call queue_receive on all the methods in the
    /// service to kick of the process of receiving messages.
    virtual void start(grpc::ServerCompletionQueue* cq, std::shared_ptr<TThreadPool> threadPool) = 0;

    /// @brief Starts the receive process for a method.
    ///
    /// @note This method is for use by generated and helper code only.
    ///
    /// When a request for the method has been received, \p tag will be
    /// added to \p cq.
    ///
    /// @param methodIndex the index of the method (indices are assigned by
    /// the order in which the methods are registered via calls to
    /// AddMethod)
    ///
    /// @param context a fresh grpc::ServerContext for the call to populate
    ///
    /// @param request pointer to a request object to populate
    ///
    /// @param responseStream pointer to a response stream to populate
    ///
    /// @param cq the completion queue to notify when a call has been
    /// received
    ///
    /// @param tag the io_manager_tag to include with the completion queue
    /// notification
    template <typename TRequest>
    void queue_receive(
        int methodIndex,
        grpc::ServerContext* context,
        TRequest* request,
        grpc::internal::ServerAsyncStreamingInterface* responseStream,
        grpc::ServerCompletionQueue* cq,
        io_manager_tag* tag)
    {
        RequestAsyncUnary(
            methodIndex,
            context,
            request,
            responseStream,
            cq,
            cq,
            tag);
    }

    /// @brief Provides access to the raw grpc::Service type.
    ///
    /// @note This method is for use by generated and helper code only.
    grpc::Service* grpc_service()
    {
        return this;
    }

protected:
    /// @brief Registers a method name for dispatch to this service.
    ///
    /// @note This method is for use by generated and helper code only.
    ///
    /// The order in which methods are registered assigned the method index,
    /// which is used elsewhere.
    void AddMethod(const char* methodName)
    {
        BOOST_ASSERT(methodName);

        // ownership of the service method is transfered to grpc::Service
        AddMethod(
            new grpc::internal::RpcServiceMethod(
                methodName,
                grpc::internal::RpcMethod::NORMAL_RPC,
                nullptr)); // nullptr indicates async handler
    }

private:
    using grpc::Service::AddMethod;
};

} } } } //namespace bond::ext::gRPC::detail


text:
Examples
========

Examples using the dlw package.

.. toctree::
	:maxdepth: 2

	output_paper


text:
package de.tu_darmstadt.smastra.markers.elements.extras;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * This is the Container for Extras to add.
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Extras {

    /**
     * This are the extra Broadcasts to bundle in.
     */
    ExtraBroadcast[] broadcasts() default {};

    /**
     * This are the extra Services to bundle in.
     */
    ExtraBroadcast[] services() default {};

    /**
     * This are the extra Libs to bundle in.
     */
    ExtraLibrary[] libraries() default {};

    /**
     * This are extra Permissions needed.
     */
    ExtraPermission[] permissions() default {};
}


text:
#include "GrConvolutionEffect.h"
#include "gl/GrGLEffect.h"
#include "gl/GrGLSL.h"
#include "gl/GrGLTexture.h"
#include "GrTBackendEffectFactory.h"

// For brevity
typedef GrGLUniformManager::UniformHandle UniformHandle;

class GrGLConvolutionEffect : public GrGLEffect {
public:
    GrGLConvolutionEffect(const GrBackendEffectFactory&, const GrDrawEffect&);

    virtual void emitCode(GrGLShaderBuilder*,
                          const GrDrawEffect&,
                          EffectKey,
                          const char* outputColor,
                          const char* inputColor,
                          const TransformedCoordsArray&,
                          const TextureSamplerArray&) SK_OVERRIDE;

    virtual void setData(const GrGLUniformManager& uman, const GrDrawEffect&) SK_OVERRIDE;

    static inline EffectKey GenKey(const GrDrawEffect&, const GrGLCaps&);

private:
    int width() const { return Gr1DKernelEffect::WidthFromRadius(fRadius); }
    bool useBounds() const { return fUseBounds; }
    Gr1DKernelEffect::Direction direction() const { return fDirection; }

    int                 fRadius;
    bool                fUseBounds;
    Gr1DKernelEffect::Direction    fDirection;
    UniformHandle       fKernelUni;
    UniformHandle       fImageIncrementUni;
    UniformHandle       fBoundsUni;

    typedef GrGLEffect INHERITED;
};

GrGLConvolutionEffect::GrGLConvolutionEffect(const GrBackendEffectFactory& factory,
                                             const GrDrawEffect& drawEffect)
    : INHERITED(factory) {
    const GrConvolutionEffect& c = drawEffect.castEffect<GrConvolutionEffect>();
    fRadius = c.radius();
    fUseBounds = c.useBounds();
    fDirection = c.direction();
}

void GrGLConvolutionEffect::emitCode(GrGLShaderBuilder* builder,
                                     const GrDrawEffect&,
                                     EffectKey key,
                                     const char* outputColor,
                                     const char* inputColor,
                                     const TransformedCoordsArray& coords,
                                     const TextureSamplerArray& samplers) {
    SkString coords2D = builder->ensureFSCoords2D(coords, 0);
    fImageIncrementUni = builder->addUniform(GrGLShaderBuilder::kFragment_Visibility,
                                             kVec2f_GrSLType, "ImageIncrement");
    if (this->useBounds()) {
        fBoundsUni = builder->addUniform(GrGLShaderBuilder::kFragment_Visibility,
                                         kVec2f_GrSLType, "Bounds");
    }
    fKernelUni = builder->addUniformArray(GrGLShaderBuilder::kFragment_Visibility,
                                          kFloat_GrSLType, "Kernel", this->width());

    builder->fsCodeAppendf("\t\t%s = vec4(0, 0, 0, 0);\n", outputColor);

    int width = this->width();
    const GrGLShaderVar& kernel = builder->getUniformVariable(fKernelUni);
    const char* imgInc = builder->getUniformCStr(fImageIncrementUni);

    builder->fsCodeAppendf("\t\tvec2 coord = %s - %d.0 * %s;\n", coords2D.c_str(), fRadius, imgInc);

    // Manually unroll loop because some drivers don't; yields 20-30% speedup.
    for (int i = 0; i < width; i++) {
        SkString index;
        SkString kernelIndex;
        index.appendS32(i);
        kernel.appendArrayAccess(index.c_str(), &kernelIndex);
        builder->fsCodeAppendf("\t\t%s += ", outputColor);
        builder->fsAppendTextureLookup(samplers[0], "coord");
        if (this->useBounds()) {
            const char* bounds = builder->getUniformCStr(fBoundsUni);
            const char* component = this->direction() == Gr1DKernelEffect::kY_Direction ? "y" : "x";
            builder->fsCodeAppendf(" * float(coord.%s >= %s.x && coord.%s <= %s.y)",
                component, bounds, component, bounds);
        }
        builder->fsCodeAppendf(" * %s;\n", kernelIndex.c_str());
        builder->fsCodeAppendf("\t\tcoord += %s;\n", imgInc);
    }

    SkString modulate;
    GrGLSLMulVarBy4f(&modulate, 2, outputColor, inputColor);
    builder->fsCodeAppend(modulate.c_str());
}

void GrGLConvolutionEffect::setData(const GrGLUniformManager& uman,
                                    const GrDrawEffect& drawEffect) {
    const GrConvolutionEffect& conv = drawEffect.castEffect<GrConvolutionEffect>();
    GrTexture& texture = *conv.texture(0);
    // the code we generated was for a specific kernel radius
    SkASSERT(conv.radius() == fRadius);
    float imageIncrement[2] = { 0 };
    float ySign = texture.origin() != kTopLeft_GrSurfaceOrigin ? 1.0f : -1.0f;
    switch (conv.direction()) {
        case Gr1DKernelEffect::kX_Direction:
            imageIncrement[0] = 1.0f / texture.width();
            break;
        case Gr1DKernelEffect::kY_Direction:
            imageIncrement[1] = ySign / texture.height();
            break;
        default:
            GrCrash("Unknown filter direction.");
    }
    uman.set2fv(fImageIncrementUni, 1, imageIncrement);
    if (conv.useBounds()) {
        const float* bounds = conv.bounds();
        if (Gr1DKernelEffect::kY_Direction == conv.direction() &&
            texture.origin() != kTopLeft_GrSurfaceOrigin) {
            uman.set2f(fBoundsUni, 1.0f - bounds[1], 1.0f - bounds[0]);
        } else {
            uman.set2f(fBoundsUni, bounds[0], bounds[1]);
        }
    }
    uman.set1fv(fKernelUni, this->width(), conv.kernel());
}

GrGLEffect::EffectKey GrGLConvolutionEffect::GenKey(const GrDrawEffect& drawEffect,
                                                    const GrGLCaps&) {
    const GrConvolutionEffect& conv = drawEffect.castEffect<GrConvolutionEffect>();
    EffectKey key = conv.radius();
    key <<= 2;
    if (conv.useBounds()) {
        key |= 0x2;
        key |= GrConvolutionEffect::kY_Direction == conv.direction() ? 0x1 : 0x0;
    }
    return key;
}

///////////////////////////////////////////////////////////////////////////////

GrConvolutionEffect::GrConvolutionEffect(GrTexture* texture,
                                         Direction direction,
                                         int radius,
                                         const float* kernel,
                                         bool useBounds,
                                         float bounds[2])
    : Gr1DKernelEffect(texture, direction, radius), fUseBounds(useBounds) {
    SkASSERT(radius <= kMaxKernelRadius);
    SkASSERT(NULL != kernel);
    int width = this->width();
    for (int i = 0; i < width; i++) {
        fKernel[i] = kernel[i];
    }
    memcpy(fBounds, bounds, sizeof(fBounds));
}

GrConvolutionEffect::GrConvolutionEffect(GrTexture* texture,
                                         Direction direction,
                                         int radius,
                                         float gaussianSigma,
                                         bool useBounds,
                                         float bounds[2])
    : Gr1DKernelEffect(texture, direction, radius), fUseBounds(useBounds) {
    SkASSERT(radius <= kMaxKernelRadius);
    int width = this->width();

    float sum = 0.0f;
    float denom = 1.0f / (2.0f * gaussianSigma * gaussianSigma);
    for (int i = 0; i < width; ++i) {
        float x = static_cast<float>(i - this->radius());
        // Note that the constant term (1/(sqrt(2*pi*sigma^2)) of the Gaussian
        // is dropped here, since we renormalize the kernel below.
        fKernel[i] = sk_float_exp(- x * x * denom);
        sum += fKernel[i];
    }
    // Normalize the kernel
    float scale = 1.0f / sum;
    for (int i = 0; i < width; ++i) {
        fKernel[i] *= scale;
    }
    memcpy(fBounds, bounds, sizeof(fBounds));
}

GrConvolutionEffect::~GrConvolutionEffect() {
}

const GrBackendEffectFactory& GrConvolutionEffect::getFactory() const {
    return GrTBackendEffectFactory<GrConvolutionEffect>::getInstance();
}

bool GrConvolutionEffect::onIsEqual(const GrEffect& sBase) const {
    const GrConvolutionEffect& s = CastEffect<GrConvolutionEffect>(sBase);
    return (this->texture(0) == s.texture(0) &&
            this->radius() == s.radius() &&
            this->direction() == s.direction() &&
            this->useBounds() == s.useBounds() &&
            0 == memcmp(fBounds, s.fBounds, sizeof(fBounds)) &&
            0 == memcmp(fKernel, s.fKernel, this->width() * sizeof(float)));
}

///////////////////////////////////////////////////////////////////////////////

GR_DEFINE_EFFECT_TEST(GrConvolutionEffect);

GrEffectRef* GrConvolutionEffect::TestCreate(SkRandom* random,
                                             GrContext*,
                                             const GrDrawTargetCaps&,
                                             GrTexture* textures[]) {
    int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx :
                                      GrEffectUnitTest::kAlphaTextureIdx;
    Direction dir = random->nextBool() ? kX_Direction : kY_Direction;
    int radius = random->nextRangeU(1, kMaxKernelRadius);
    float kernel[kMaxKernelWidth];
    for (size_t i = 0; i < SK_ARRAY_COUNT(kernel); ++i) {
        kernel[i] = random->nextSScalar1();
    }
    float bounds[2];
    for (size_t i = 0; i < SK_ARRAY_COUNT(bounds); ++i) {
        bounds[i] = random->nextF();
    }

    bool useBounds = random->nextBool();
    return GrConvolutionEffect::Create(textures[texIdx],
                                       dir,
                                       radius,
                                       kernel,
                                       useBounds,
                                       bounds);
}