text:
//-----------------------------------------------------------------------
// <copyright file="StreamTcpException.cs" company="Akka.NET Project">
//     Copyright (C) 2009-2020 Lightbend Inc. <http://www.lightbend.com>
//     Copyright (C) 2013-2020 .NET Foundation <https://github.com/akkadotnet/akka.net>
// </copyright>
//-----------------------------------------------------------------------

using System;
using System.Runtime.Serialization;

namespace Akka.Streams
{
    /// <summary>
    /// TBD
    /// </summary>
    public class StreamTcpException : Exception
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="StreamTcpException"/> class.
        /// </summary>
        /// <param name="message">The message that describes the error.</param>
        public StreamTcpException(string message) : base(message)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="StreamTcpException"/> class.
        /// </summary>
        /// <param name="message">The message that describes the error.</param>
        /// <param name="innerException">The exception that is the cause of the current exception.</param>
        public StreamTcpException(string message, Exception innerException) : base(message, innerException)
        {
        }

#if SERIALIZATION
        /// <summary>
        /// Initializes a new instance of the <see cref="StreamTcpException"/> class.
        /// </summary>
        /// <param name="info">The <see cref="SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
        /// <param name="context">The <see cref="StreamingContext" /> that contains contextual information about the source or destination.</param>
        protected StreamTcpException(SerializationInfo info, StreamingContext context) : base(info, context)
        {
        }
#endif
    }

    /// <summary>
    /// TBD
    /// </summary>
    public class BindFailedException : StreamTcpException
    {
        /// <summary>
        /// The single instance of this exception
        /// </summary>
        public static readonly BindFailedException Instance = new BindFailedException();

        private BindFailedException() : base("bind failed")
        {
        }

#if SERIALIZATION
        /// <summary>
        /// Initializes a new instance of the <see cref="BindFailedException"/> class.
        /// </summary>
        /// <param name="info">The <see cref="SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
        /// <param name="context">The <see cref="StreamingContext" /> that contains contextual information about the source or destination.</param>
        protected BindFailedException(SerializationInfo info, StreamingContext context) : base(info, context)
        {
        }
#endif
    }

    /// <summary>
    /// TBD
    /// </summary>
    public class ConnectionException : StreamTcpException
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ConnectionException"/> class.
        /// </summary>
        /// <param name="message">The message that describes the error.</param>
        public ConnectionException(string message) : base(message)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="ConnectionException"/> class.
        /// </summary>
        /// <param name="message">The message that describes the error.</param>
        /// <param name="innerException">The exception that is the cause of the current exception.</param>
        public ConnectionException(string message, Exception innerException) : base(message, innerException)
        {
        }

#if SERIALIZATION
        /// <summary>
        /// Initializes a new instance of the <see cref="ConnectionException"/> class.
        /// </summary>
        /// <param name="info">The <see cref="SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
        /// <param name="context">The <see cref="StreamingContext" /> that contains contextual information about the source or destination.</param>
        protected ConnectionException(SerializationInfo info, StreamingContext context) : base(info, context)
        {
        }
#endif
    }
}


text:
<?php

/*
 * slim-routing (https://github.com/juliangut/slim-routing).
 * Slim framework routing.
 *
 * @license BSD-3-Clause
 * @link https://github.com/juliangut/slim-routing
 * @author Julián Gutiérrez <juliangut@gmail.com>
 */

declare(strict_types=1);

namespace Jgut\Slim\Routing\Tests\Strategy;

use Jgut\Slim\Routing\Strategy\RequestResponse;
use Laminas\Diactoros\ResponseFactory;
use Laminas\Diactoros\ServerRequestFactory;
use PHPUnit\Framework\TestCase;
use Psr\Container\ContainerInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;

/**
 * Default route callback strategy with route parameters as an array of arguments tests.
 */
class RequestResponseTest extends TestCase
{
    public function testDispatch(): void
    {
        $responseFactory = new ResponseFactory();
        $container = $this->getMockBuilder(ContainerInterface::class)
            ->getMock();
        $request = (new ServerRequestFactory())->createServerRequest('GET', '/');
        $response = $this->getMockBuilder(ResponseInterface::class)
            ->getMock();

        $strategy = new RequestResponse([], $responseFactory, $container);

        $callback = function (ServerRequestInterface $request) use ($responseFactory) {
            static::assertEquals('value', $request->getAttribute('param'));

            $response = $responseFactory->createResponse();
            $response->getBody()->write('Return content');

            return $response;
        };

        $return = $strategy($callback, $request, $response, ['param' => 'value']);

        static::assertEquals('Return content', (string) $return->getBody());
    }
}

redpajama_set_name: RedPajamaGithub


text:
@interface DRAppDelegate () {
	DRGetUrlListener *getUrlListener;
}

@end

@implementation DRAppDelegate

@synthesize workQueue, docsetIndexer, preferencesWindowController;

#pragma mark - Application Lifecycle Callbacks

- (void) applicationWillFinishLaunching:(NSNotification *)notification {
	[getUrlListener registerAsEventHandler];
}

- (void) applicationDidFinishLaunching:(NSNotification *)notification {
	LOG_LINE();

	[docsetIndexer startIndex];

	if(DRDashRedirectorIsDefaultBrowser()) {
		[DRBrowserInfoTasks readDefaultBrowser:^(DRBrowserInfo *browserInfo) {
			DRBrowserInfo *currentApp = [DRBrowserInfoTasks currentApp];
			if(![currentApp isEqual:browserInfo]) {
				DRSetPersistedFallbackBrowser(browserInfo);
				[DRBrowserInfoTasks setSystemDefaultBrowser:currentApp];
			}
		}];
	}

}

- (void) applicationDidBecomeActive:(NSNotification*)notification {
	LOG_LINE();

	[getUrlListener applicationReadyToLaunchDashUrl];
}

- (void)applicationWillTerminate:(NSNotification *)notification {
	LOG_LINE();

	if(DRDashRedirectorIsDefaultBrowser())
		[DRBrowserInfoTasks setSystemDefaultBrowser:DRPersistedFallbackBrowser()];
}

#pragma mark - Actions

- (IBAction) openPreferencesPanel:(id)sender {
	LOG_LINE();

	[self.preferencesWindowController showWindow:self];
	[NSApp activateIgnoringOtherApps:YES];
}

#pragma mark - Instance Lifecycle

- (id) init {
	self = [super init];
	if(self) {
		workQueue = [[NSOperationQueue alloc] init];
		docsetIndexer = [[DRDocsetIndexer alloc] initWithWorkQueue:workQueue];
		getUrlListener = [[DRGetUrlListener alloc] initWithDocsetIndexer:self.docsetIndexer];
	}
	return self;
}

- (void) dealloc {
	[workQueue release];
	[docsetIndexer release];
	[getUrlListener release];

	self.preferencesWindowController = nil;

    [super dealloc];
}

@end


text:
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Text Box using textarea</title>
        <script>

        function SendText()
        {
            nocache = "&nocache=" + Math.random() * 1000000;

            try {
                var request = new XMLHttpRequest();
                request.open('POST', document.getElementById("url_form").form_text.value, false);
                request.setRequestHeader('Content-type', 'application/json');
                request.setRequestHeader('Accept', 'text/html');
                request.send(document.getElementById("txt_form").form_text.value);

                var out_win = window.open('','Results','status=0,scrollbars=1, location=0');
                out_win.document.clear
                out_win.document.write(request.responseText);
            } catch (e) {
                alert(e);
                return;
            } finally {
            }
        }
        </script>
    </head>

    <body>
        <form id="url_form" name="frmText1">
            <textarea name="form_text" rows="1" cols="100">/con/c1/data/access</textarea>
        </form>
        <form id="txt_form" name="frmText2">
            <textarea name="form_text" rows="10" cols="100">{
  "AoMeasurement":{},
  "$attributes": {"name":1,"id":1}
}
</textarea>
        </form>
        <input type="submit" value="Send Text" onclick="SendText()" />
    </body>

</html>


text:
//%LICENSE////////////////////////////////////////////////////////////////
//
// Licensed to The Open Group (TOG) under one or more contributor license
// agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
// this work for additional information regarding copyright ownership.
// Each contributor licenses this file to you under the OpenPegasus Open
// Source License; you may not use this file except in compliance with the
// License.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//////////////////////////////////////////////////////////////////////////
//
//%/////////////////////////////////////////////////////////////////////////

UNIX_Role::UNIX_Role(void)
{
}

UNIX_Role::~UNIX_Role(void)
{
}

Boolean UNIX_Role::getInstanceID(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_INSTANCE_ID, getInstanceID());
	return true;
}

String UNIX_Role::getInstanceID() const
{
	return String ("");
}

Boolean UNIX_Role::getCaption(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_CAPTION, getCaption());
	return true;
}

String UNIX_Role::getCaption() const
{
	return String ("");
}

Boolean UNIX_Role::getDescription(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_DESCRIPTION, getDescription());
	return true;
}

String UNIX_Role::getDescription() const
{
	return String ("");
}

Boolean UNIX_Role::getElementName(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_ELEMENT_NAME, getElementName());
	return true;
}

String UNIX_Role::getElementName() const
{
	return String("Role");
}

Boolean UNIX_Role::getCreationClassName(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_CREATION_CLASS_NAME, getCreationClassName());
	return true;
}

String UNIX_Role::getCreationClassName() const
{
	return String("UNIX_Role");
}

Boolean UNIX_Role::getName(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_NAME, getName());
	return true;
}

String UNIX_Role::getName() const
{
	return String ("");
}

Boolean UNIX_Role::getBusinessCategory(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_BUSINESS_CATEGORY, getBusinessCategory());
	return true;
}

String UNIX_Role::getBusinessCategory() const
{
	return String ("");
}

Boolean UNIX_Role::getCommonName(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_COMMON_NAME, getCommonName());
	return true;
}

String UNIX_Role::getCommonName() const
{
	return String ("");
}

Boolean UNIX_Role::getRoleCharacteristics(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_ROLE_CHARACTERISTICS, getRoleCharacteristics());
	return true;
}

Array<Uint16> UNIX_Role::getRoleCharacteristics() const
{
	Array<Uint16> as;

	return as;

}

Boolean UNIX_Role::initialize()
{
	return false;
}

Boolean UNIX_Role::load(int &pIndex)
{
	return false;
}

Boolean UNIX_Role::finalize()
{
	return false;
}

Boolean UNIX_Role::find(Array<CIMKeyBinding> &kbArray)
{
	CIMKeyBinding kb;
	String creationClassNameKey;
	String nameKey;

	for(Uint32 i = 0; i < kbArray.size(); i++)
	{
		kb = kbArray[i];
		CIMName keyName = kb.getName();
		if (keyName.equal(PROPERTY_CREATION_CLASS_NAME)) creationClassNameKey = kb.getValue();
		else if (keyName.equal(PROPERTY_NAME)) nameKey = kb.getValue();
	}

/* EXecute find with extracted keys */

	return false;
}


text:
% This Source Code Form is subject to the terms of the Mozilla Public
% License, v. 2.0. If a copy of the MPL was not distributed with this
% file, You can obtain one at http://mozilla.org/MPL/2.0/.

\documentclass{article}
\usepackage[fancyhdr,pdf]{latex2man}

\input{common.tex}

\begin{document}

\begin{Name}{3}{libunwind}{David Mosberger-Tang}{Programming Library}{Introduction to libunwind}libunwind -- a (mostly) platform-independent unwind API
\end{Name}

\section{Synopsis}

\File{\#include $<$libunwind.h$>$}\\

\noindent
\Type{int} \Func{unw\_getcontext}(\Type{unw\_context\_t~*});\\
\noindent
\Type{int} \Func{unw\_init\_local}(\Type{unw\_cursor\_t~*}, \Type{unw\_context\_t~*});\\
\noindent
\Type{int} \Func{unw\_init\_remote}(\Type{unw\_cursor\_t~*}, \Type{unw\_addr\_space\_t}, \Type{void~*});\\
\noindent
\Type{int} \Func{unw\_step}(\Type{unw\_cursor\_t~*});\\
\noindent
\Type{int} \Func{unw\_get\_reg}(\Type{unw\_cursor\_t~*}, \Type{unw\_regnum\_t}, \Type{unw\_word\_t~*});\\
\noindent
\Type{int} \Func{unw\_get\_fpreg}(\Type{unw\_cursor\_t~*}, \Type{unw\_regnum\_t}, \Type{unw\_fpreg\_t~*});\\
\noindent
\Type{int} \Func{unw\_set\_reg}(\Type{unw\_cursor\_t~*}, \Type{unw\_regnum\_t}, \Type{unw\_word\_t});\\
\noindent
\Type{int} \Func{unw\_set\_fpreg}(\Type{unw\_cursor\_t~*}, \Type{unw\_regnum\_t}, \Type{unw\_fpreg\_t});\\
\noindent
\Type{int} \Func{unw\_resume}(\Type{unw\_cursor\_t~*});\\

\noindent
\Type{unw\_addr\_space\_t} \Var{unw\_local\_addr\_space};\\
\noindent
\Type{unw\_addr\_space\_t} \Func{unw\_create\_addr\_space}(\Type{unw\_accessors\_t}, \Type{int});\\
\noindent
\Type{void} \Func{unw\_destroy\_addr\_space}(\Type{unw\_addr\_space\_t});\\
\noindent
\Type{unw\_accessors\_t} \Func{unw\_get\_accessors}(\Type{unw\_addr\_space\_t});\\
\noindent
\Type{void} \Func{unw\_flush\_cache}(\Type{unw\_addr\_space\_t}, \Type{unw\_word\_t}, \Type{unw\_word\_t});\\
\noindent
\Type{int} \Func{unw\_set\_caching\_policy}(\Type{unw\_addr\_space\_t}, \Type{unw\_caching\_policy\_t});\\

\noindent
\Type{const char *}\Func{unw\_regname}(\Type{unw\_regnum\_t});\\
\noindent
\Type{int} \Func{unw\_get\_proc\_info}(\Type{unw\_cursor\_t~*}, \Type{unw\_proc\_info\_t~*});\\
\noindent
\Type{int} \Func{unw\_get\_save\_loc}(\Type{unw\_cursor\_t~*}, \Type{int}, \Type{unw\_save\_loc\_t~*});\\
\noindent
\Type{int} \Func{unw\_is\_fpreg}(\Type{unw\_regnum\_t});\\
\Type{int} \Func{unw\_is\_signal\_frame}(\Type{unw\_cursor\_t~*});\\
\noindent
\Type{int} \Func{unw\_get\_proc\_name}(\Type{unw\_cursor\_t~*}, \Type{char~*}, \Type{size\_t}, \Type{unw\_word\_t~*});\\

\noindent
\Type{void} \Func{\_U\_dyn\_register}(\Type{unw\_dyn\_info\_t~*});\\
\noindent
\Type{void} \Func{\_U\_dyn\_cancel}(\Type{unw\_dyn\_info\_t~*});\\

\section{Local Unwinding}

\Prog{Libunwind} is very easy to use when unwinding a stack from
within a running program.  This is called \emph{local} unwinding.  Say
you want to unwind the stack while executing in some function
\Func{F}().  In this function, you would call \Func{unw\_getcontext}()
to get a snapshot of the CPU registers (machine-state).  Then you
initialize an \emph{unwind~cursor} based on this snapshot.  This is
done with a call to \Func{unw\_init\_local}().  The cursor now points
to the current frame, that is, the stack frame that corresponds to the
current activation of function \Func{F}().  The unwind cursor can then
be moved ``up'' (towards earlier stack frames) by calling
\Func{unw\_step}().  By repeatedly calling this routine, you can
uncover the entire call-chain that led to the activation of function
\Func{F}().  A positive return value from \Func{unw\_step}() indicates
that there are more frames in the chain, zero indicates that the end
of the chain has been reached, and any negative value indicates that
some sort of error has occurred.

While it is not possible to directly move the unwind cursor in the
``down'' direction (towards newer stack frames), this effect can be
achieved by making copies of an unwind cursor.  For example, a program
that sometimes has to move ``down'' by one stack frame could maintain
two cursor variables: ``\Var{curr}'' and ``\Var{prev}''.  The former
would be used as the current cursor and \Var{prev} would be maintained
as the ``previous frame'' cursor by copying the contents of \Var{curr}
to \Var{prev} right before calling \Func{unw\_step}().  With this
approach, the program could move one step ``down'' simply by copying
back \Var{prev} to \Var{curr} whenever that is necessary.  In the most
extreme case, a program could maintain a separate cursor for each call
frame and that way it could move up and down the callframe-chain at
will.

Given an unwind cursor, it is possible to read and write the CPU
registers that were preserved for the current stack frame (as
identified by the cursor).  \Prog{Libunwind} provides several routines
for this purpose: \Func{unw\_get\_reg}() reads an integer (general)
register, \Func{unw\_get\_fpreg}() reads a floating-point register,
\Func{unw\_set\_reg}() writes an integer register, and
\Func{unw\_set\_fpreg}() writes a floating-point register.  Note that,
by definition, only the \emph{preserved} machine state can be accessed
during an unwind operation.  Normally, this state consists of the
\emph{callee-saved} (``preserved'') registers.  However, in some
special circumstances (e.g., in a signal handler trampoline), even the
\emph{caller-saved} (``scratch'') registers are preserved in the stack
frame and, in those cases, \Prog{libunwind} will grant access to them
as well.  The exact set of registers that can be accessed via the
cursor depends, of course, on the platform.  However, there are two
registers that can be read on all platforms: the instruction pointer
(IP), sometimes also known as the ``program counter'', and the stack
pointer (SP).  In \Prog{libunwind}, these registers are identified by
the macros \Const{UNW\_REG\_IP} and \Const{UNW\_REG\_SP},
respectively.

Besides just moving the unwind cursor and reading/writing saved
registers, \Prog{libunwind} also provides the ability to resume
execution at an arbitrary stack frame.  As you might guess, this is
useful for implementing non-local gotos and the exception handling
needed by some high-level languages such as Java.  Resuming execution
with a particular stack frame simply requires calling
\Func{unw\_resume}() and passing the cursor identifying the target
frame as the only argument.

Normally, \Prog{libunwind} supports both local and remote unwinding
(the latter will be explained in the next section).  However, if you
tell libunwind that your program only needs local unwinding, then a
special implementation can be selected which may run much faster than
the generic implementation which supports both kinds of unwinding.  To
select this optimized version, simply define the macro
\Const{UNW\_LOCAL\_ONLY} before including the headerfile
\File{$<$libunwind.h$>$}.  It is perfectly OK for a single program to
employ both local-only and generic unwinding.  That is, whether or not
\Const{UNW\_LOCAL\_ONLY} is defined is a choice that each source-file
(compilation-unit) can make on its own.  Independent of the setting(s)
of \Const{UNW\_LOCAL\_ONLY}, you'll always link the same library into
the program (normally \Opt{-l}\File{unwind}).  Furthermore, the
portion of \Prog{libunwind} that manages unwind-info for dynamically
generated code is not affected by the setting of
\Const{UNW\_LOCAL\_ONLY}.

If we put all of the above together, here is how we could use
\Prog{libunwind} to write a function ``\Func{show\_backtrace}()''
which prints a classic stack trace:

\begin{verbatim}
#define UNW_LOCAL_ONLY
#include <libunwind.h>

void show_backtrace (void) {
  unw_cursor_t cursor; unw_context_t uc;
  unw_word_t ip, sp;

  unw_getcontext(&uc);
  unw_init_local(&cursor, &uc);
  while (unw_step(&cursor) > 0) {
    unw_get_reg(&cursor, UNW_REG_IP, &ip);
    unw_get_reg(&cursor, UNW_REG_SP, &sp);
    printf ("ip = %lx, sp = %lx\n", (long) ip, (long) sp);
  }
}
\end{verbatim}

\section{Remote Unwinding}

\Prog{Libunwind} can also be used to unwind a stack in a ``remote''
process.  Here, ``remote'' may mean another process on the same
machine or even a process on a completely different machine from the
one that is running \Prog{libunwind}.  Remote unwinding is typically
used by debuggers and instruction-set simulators, for example.

Before you can unwind a remote process, you need to create a new
address-space object for that process.  This is achieved with the
\Func{unw\_create\_addr\_space}() routine.  The routine takes two
arguments: a pointer to a set of \emph{accessor} routines and an
integer that specifies the byte-order of the target process.  The
accessor routines provide \Func{libunwind} with the means to
communicate with the remote process.  In particular, there are
callbacks to read and write the process's memory, its registers, and
to access unwind information which may be needed by \Func{libunwind}.

With the address space created, unwinding can be initiated by a call
to \Func{unw\_init\_remote}().  This routine is very similar to
\Func{unw\_init\_local}(), except that it takes an address-space
object and an opaque pointer as arguments.  The routine uses these
arguments to fetch the initial machine state.  \Prog{Libunwind} never
uses the opaque pointer on its own, but instead just passes it on to
the accessor (callback) routines.  Typically, this pointer is used to
select, e.g., the thread within a process that is to be unwound.

Once a cursor has been initialized with \Func{unw\_init\_remote}(),
unwinding works exactly like in the local case.  That is, you can use
\Func{unw\_step}() to move ``up'' in the call-chain, read and write
registers, or resume execution at a particular stack frame by calling
\Func{unw\_resume}.

\section{Cross-platform and Multi-platform Unwinding}

\Prog{Libunwind} has been designed to enable unwinding across
platforms (architectures).  Indeed, a single program can use
\Prog{libunwind} to unwind an arbitrary number of target platforms,
all at the same time!

We call the machine that is running \Prog{libunwind} the \emph{host}
and the machine that is running the process being unwound the
\emph{target}.  If the host and the target platform are the same, we
call it \emph{native} unwinding.  If they differ, we call it
\emph{cross-platform} unwinding.

The principle behind supporting native, cross-platform, and
multi-platform unwinding is very simple: for native unwinding, a
program includes \File{$<$libunwind.h$>$} and uses the linker switch
\Opt{-l}\File{unwind}.  For cross-platform unwinding, a program
includes \File{$<$libunwind-}\Var{PLAT}\File{.h$>$} and uses the linker
switch \Opt{-l}\File{unwind-}\Var{PLAT}, where \Var{PLAT} is the name
of the target platform (e.g., \File{ia64} for IA-64, \File{hppa-elf}
for ELF-based HP PA-RISC, or \File{x86} for 80386).  Multi-platform
unwinding works exactly like cross-platform unwinding, the only
limitation is that a single source file (compilation unit) can include
at most one \Prog{libunwind} header file.  In other words, the
platform-specific support for each supported target needs to be
isolated in separate source files---a limitation that shouldn't be an
issue in practice.

Note that, by definition, local unwinding is possible only for the
native case.  Attempting to call, e.g., \Func{unw\_local\_init}() when
targeting a cross-platform will result in a link-time error
(unresolved references).

\section{Thread- and Signal-Safety}

All \Prog{libunwind} routines are thread-safe.  What this means is
that multiple threads may use \Prog{libunwind} simulatenously.
However, any given cursor may be accessed by only one thread at
any given time.

To ensure thread-safety, some \Prog{libunwind} routines may have to
use locking.  Such routines \emph{must~not} be called from signal
handlers (directly or indirectly) and are therefore \emph{not}
signal-safe.  The manual page for each \Prog{libunwind} routine
identifies whether or not it is signal-safe, but as a general rule,
any routine that may be needed for \emph{local} unwinding is
signal-safe (e.g., \Func{unw\_step}() for local unwinding is
signal-safe).  For remote-unwinding, \emph{none} of the
\Prog{libunwind} routines are guaranteed to be signal-safe.

\section{Unwinding Through Dynamically Generated Code}

\Func{Libunwind} provides the routines \Func{\_U\_dyn\_register}() and
\Func{\_U\_dyn\_cancel}() to register/cancel the information required to
unwind through code that has been generated at runtime (e.g., by a
just-in-time (JIT) compiler).  It is important to register the
information for \emph{all} dynamically generated code because
otherwise, a debugger may not be able to function properly or
high-level language exception handling may not work as expected.

The interface for registering and canceling dynamic unwind info has
been designed for maximum efficiency, so as to minimize the
performance impact on JIT-compilers.  In particular, both routines are
guaranteed to execute in ``constant time'' (O(1)) and the
data-structure encapsulating the dynamic unwind info has been designed
to facilitate sharing, such that similar procedures can share much of
the underlying information.

For more information on the \Prog{libunwind} support for dynamically
generated code, see \SeeAlso{libunwind-dynamic(3)}.

\section{Caching of Unwind Info}

To speed up execution, \Prog{libunwind} may aggressively cache the
information it needs to perform unwinding.  If a process changes
during its lifetime, this creates a risk of \Prog{libunwind} using
stale data.  For example, this would happen if \Prog{libunwind} were
to cache information about a shared library which later on gets
unloaded (e.g., via \Cmd{dlclose}{3}).

To prevent the risk of using stale data, \Prog{libunwind} provides two
facilities: first, it is possible to flush the cached information
associated with a specific address range in the target process (or the
entire address space, if desired).  This functionality is provided by
\Func{unw\_flush\_cache}().  The second facility is provided by
\Func{unw\_set\_caching\_policy}(), which lets a program
select the exact caching policy in use for a given address-space
object.  In particular, by selecting the policy
\Const{UNW\_CACHE\_NONE}, it is possible to turn off caching
completely, therefore eliminating the risk of stale data alltogether
(at the cost of slower execution).  By default, caching is enabled for
local unwinding only.

\section{Files}

\begin{Description}
\item[\File{libunwind.h}] Headerfile to include for native (same
  platform) unwinding.
\item[\File{libunwind-}\Var{PLAT}\File{.h}] Headerfile to include when
  the unwind target runs on platform \Var{PLAT}.  For example, to unwind
  an IA-64 program, the header file \File{libunwind-ia64.h} should be
  included.
\item[\Opt{-l}\File{unwind}] Linker-switch to add when building a
  program that does native (same platform) unwinding.
\item[\Opt{-l}\File{unwind-}\Var{PLAT}] Linker-switch to add when
  building a program that unwinds a program on platform \Var{PLAT}.
  For example, to (cross-)unwind an IA-64 program, the linker switch
  \File{-lunwind-ia64} should be added.  Note: multiple such switches
  may need to be specified for programs that can unwind programs on
  multiple platforms.
\end{Description}

\section{See Also}

\SeeAlso{libunwind-dynamic(3)},
\SeeAlso{libunwind-ia64(3)},
\SeeAlso{libunwind-ptrace(3)},
\SeeAlso{libunwind-setjmp(3)},
\SeeAlso{unw\_create\_addr\_space(3)},
\SeeAlso{unw\_destroy\_addr\_space(3)},
\SeeAlso{unw\_flush\_cache(3)},
\SeeAlso{unw\_get\_accessors(3)},
\SeeAlso{unw\_get\_fpreg(3)},
\SeeAlso{unw\_get\_proc\_info(3)},
\SeeAlso{unw\_get\_proc\_name(3)},
\SeeAlso{unw\_get\_reg(3)},
\SeeAlso{unw\_getcontext(3)},
\SeeAlso{unw\_init\_local(3)},
\SeeAlso{unw\_init\_remote(3)},
\SeeAlso{unw\_is\_fpreg(3)},
\SeeAlso{unw\_is\_signal\_frame(3)},
\SeeAlso{unw\_regname(3)},
\SeeAlso{unw\_resume(3)},
\SeeAlso{unw\_set\_caching\_policy(3)},
\SeeAlso{unw\_set\_fpreg(3)},
\SeeAlso{unw\_set\_reg(3)},
\SeeAlso{unw\_step(3)},
\SeeAlso{unw\_strerror(3)},
\SeeAlso{\_U\_dyn\_register(3)},
\SeeAlso{\_U\_dyn\_cancel(3)}

\section{Author}

\noindent
David Mosberger-Tang\\
Email: \Email{dmosberger@gmail.com}\\
WWW: \URL{http://www.nongnu.org/libunwind/}.
\LatexManEnd

\end{document}


text:
extern crate iron;
extern crate mount;
extern crate logger;
extern crate staticfile;

use std::fs::File;
use std::io::Read;

use iron::prelude::*;
use iron::mime::Mime;
use iron::status;
use mount::Mount;
use logger::Logger;
use staticfile::Static;

fn main() {
    fn ingredients(_: &mut Request) -> IronResult<Response> {
        let mut json_response = String::new();
        let mut f = File::open("data/ingredients.json").unwrap();
        f.read_to_string(&mut json_response).unwrap();
        let content_type = "application/json".parse::<Mime>().unwrap();
        Ok(Response::with((content_type, status::Ok, json_response)))
    }
    let mut mount = Mount::new();
    mount.mount("/", Static::new("web/"));
    mount.mount("/api/", ingredients);
    let mut chain = Chain::new(mount);
    chain.link(Logger::new(None));
    Iron::new(chain).http("localhost:3000").unwrap();
}


text:
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.table.*;
import javax.swing.event.*;
import java.awt.event.*;
/*
 * Created by Jan Becker on Thu Feb 26 18:11:17 CET 2015
 */

/**
 * @author Jan Becker
 */
public class HF extends JFrame {
    public HF(String nameA, String pwA, int admin) {
        initComponents(nameA);
        initListener();
    }

    protected void initComponents(String name) {
        //BEGIN:initComponents
        tabbedPane1 = new JTabbedPane();
        panel1 = new JPanel();
        textField1 = new JTextField();
        panel2 = new JPanel();
        panel8 = new JPanel();
        panel9 = new JPanel();
        panel10 = new JPanel();
        button1 = new JButton();
        button2 = new JButton();
        button3 = new JButton();
        panel3 = new JPanel();
        panel5 = new JPanel();
        comboBox1 = new JComboBox<>();
        scrollPane2 = new JScrollPane();
        table1 = new JTable();
        label1 = new JLabel();
        label2 = new JLabel();
        label3 = new JLabel();
        label4 = new JLabel();
        label5 = new JLabel();
        label6 = new JLabel();
        label7 = new JLabel();
        label8 = new JLabel();
        scrollPane3 = new JScrollPane();
        table2 = new JTable();
        label9 = new JLabel();
        label10 = new JLabel();
        label11 = new JLabel();
        panel4 = new JPanel();
        panel6 = new JPanel();
        scrollPane1 = new JScrollPane();
        list1 = new JList<>();
        button4 = new JButton();
        button5 = new JButton();
        label12 = new JLabel();
        label13 = new JLabel();
        label14 = new JLabel();
        namexx = name;
        button6 = new JButton();

        //======== this ========
        setContentPane(new BackGroundPane("Daten/HB.jpg",1));
        setTitle("Clashing Tribes \u00a9");
        setDefaultCloseOperation(HIDE_ON_CLOSE);
        setIconImage(new ImageIcon("Daten/HICO2.png").getImage());
        Container contentPane = getContentPane();
        contentPane.setLayout(null);
        //setUndecorated(true);

        //======== tabbedPane1 ========
        {
            tabbedPane1.setFont(tabbedPane1.getFont().deriveFont(tabbedPane1.getFont().getSize() + 4f));
            tabbedPane1.setFocusable(false);

            //======== panel1 ========
            {
                panel1.setBackground(new Color(255, 255, 255, 0));
                panel1.setLayout(null);

                //======== panel8 ========
                {
                    panel8.setMaximumSize(new Dimension(30, 30));
                    panel8.setMinimumSize(new Dimension(30, 30));
                    panel8.setPreferredSize(new Dimension(30, 30));
                    panel8.setBorder(new EtchedBorder(EtchedBorder.RAISED));
                    panel8.setOpaque(false);
                    panel8.setLayout(null);

                    { // compute preferred size
                        Dimension preferredSize = new Dimension();
                        for(int i = 0; i < panel8.getComponentCount(); i++) {
                            Rectangle bounds = panel8.getComponent(i).getBounds();
                            preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                            preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                        }
                        Insets insets = panel8.getInsets();
                        preferredSize.width += insets.right;
                        preferredSize.height += insets.bottom;
                        panel8.setMinimumSize(preferredSize);
                        panel8.setPreferredSize(preferredSize);
                    }
                }
                JPanel bgPanel3 = new BgPanel();
                bgPanel3.setLayout(new BorderLayout());
                bgPanel3.add(panel8, BorderLayout.CENTER);
                panel1.add(bgPanel3);
                bgPanel3.setBounds(-5, -5, 560, 350);

                { // compute preferred size
                    Dimension preferredSize = new Dimension();
                    for(int i = 0; i < panel1.getComponentCount(); i++) {
                        Rectangle bounds = panel1.getComponent(i).getBounds();
                        preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                        preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                    }
                    Insets insets = panel1.getInsets();
                    preferredSize.width += insets.right;
                    preferredSize.height += insets.bottom;
                    panel1.setMinimumSize(preferredSize);
                    panel1.setPreferredSize(preferredSize);
                }
            }
            tabbedPane1.addTab("Stamm  ", new ImageIcon("Daten/spielico.png"), panel1);
            tabbedPane1.setBackgroundAt(0, Color.lightGray);
            tabbedPane1.setForegroundAt(0, Color.black);

            //======== panel2 ========
            {
                panel2.setBackground(new Color(255, 255, 255, 0));
                panel2.setLayout(null);

                //---- button1 ----
                button1.setText("text");
                panel2.add(button1);
                button1.setBounds(new Rectangle(new Point(30, 30), button1.getPreferredSize()));

                //---- button2 ----
                button2.setText("text");
                panel2.add(button2);
                button2.setBounds(new Rectangle(new Point(145, 30), button2.getPreferredSize()));

                //---- button3 ----
                button3.setText("text");
                panel2.add(button3);
                button3.setBounds(new Rectangle(new Point(255, 30), button3.getPreferredSize()));

                { // compute preferred size
                    Dimension preferredSize = new Dimension();
                    for(int i = 0; i < panel2.getComponentCount(); i++) {
                        Rectangle bounds = panel2.getComponent(i).getBounds();
                        preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                        preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                    }
                    Insets insets = panel2.getInsets();
                    preferredSize.width += insets.right;
                    preferredSize.height += insets.bottom;
                    panel2.setMinimumSize(preferredSize);
                    panel2.setPreferredSize(preferredSize);
                }
            }
            tabbedPane1.addTab("Shop  ", new ImageIcon("Daten/shopico.png"), panel2);
            tabbedPane1.setBackgroundAt(1, Color.lightGray);
            tabbedPane1.setForegroundAt(1, Color.black);

            //======== panel3 ========
            {
                panel3.setBackground(new Color(255, 255, 255, 0));
                panel3.setLayout(null);

                //======== panel5 ========
                {
                    panel5.setOpaque(false);
                    panel5.setPreferredSize(new Dimension(11, 11));
                    panel5.setBackground(Color.white);
                    panel5.setBorder(new EtchedBorder(EtchedBorder.RAISED));
                    panel5.setLayout(null);

                    //---- comboBox1 ----
                    comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
                                "(Bitte w\u00e4hlen)",
                                "[ATTACK] - Name1 vs. Name2",
                                "[DEFENSE] - Name1 vs. Name2"
                            }));
                    comboBox1.setFont(comboBox1.getFont().deriveFont(comboBox1.getFont().getSize() + 1f));
                    comboBox1.setBackground(UIManager.getColor("ScrollBar.background"));
                    comboBox1.setForeground(Color.black);
                    comboBox1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                    comboBox1.setFocusable(false);
                    panel5.add(comboBox1);
                    comboBox1.setBounds(95, 30, 410, 25);

                    //======== scrollPane2 ========
                    {
                        objt1 = new Object[][] {{0, 0, 0, 0, 0},{0, 0, 0, 0, 0},};

                        //---- table1 ----
                        table1.setModel(new DefaultTableModel(
                                objt1,
                                new String[] {
                                    "Einheit A", "Einheit B", "Einheit C", "Einheit D", "Einheit E"
                                }
                            ) {
                                Class<?>[] columnTypes = new Class<?>[] {
                                        Integer.class, Integer.class, Integer.class, Integer.class, Integer.class
                                    };
                                boolean[] columnEditable = new boolean[] {
                                        false, false, false, false, false
                                    };
                                @Override
                                public Class<?> getColumnClass(int columnIndex) {
                                    return columnTypes[columnIndex];
                                }

                                @Override
                                public boolean isCellEditable(int rowIndex, int columnIndex) {
                                    return columnEditable[columnIndex];
                                }
                            });
                        {
                            TableColumnModel cm = table1.getColumnModel();
                            cm.getColumn(0).setResizable(false);
                            cm.getColumn(1).setResizable(false);
                            cm.getColumn(2).setResizable(false);
                            cm.getColumn(3).setResizable(false);
                            cm.getColumn(4).setResizable(false);
                        }
                        table1.setGridColor(Color.black);
                        table1.setEnabled(false);
                        table1.setForeground(Color.black);
                        table1.setRowSorter(null);
                        table1.setPreferredSize(new Dimension(375, 31));
                        table1.setBackground(UIManager.getColor("PasswordField.background"));
                        table1.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
                        table1.setFocusable(false);
                        table1.setSelectionForeground(Color.black);
                        table1.getTableHeader().setReorderingAllowed(false);
                        scrollPane2.setViewportView(table1);
                    }
                    panel5.add(scrollPane2);
                    scrollPane2.setBounds(85, 95, 440, 55);

                    //---- label1 ----
                    label1.setText("Einheit:");
                    label1.setForeground(Color.black);
                    //panel5.add(label1);
                    label1.setBounds(30, 95, 50, label1.getPreferredSize().height);

                    //---- label2 ----
                    label2.setText("Gesamt:");
                    label2.setForeground(Color.black);
                    panel5.add(label2);
                    label2.setBounds(30, 115, 50, label2.getPreferredSize().height);

                    //---- label3 ----
                    label3.setText("Tote:");
                    label3.setForeground(Color.black);
                    panel5.add(label3);
                    label3.setBounds(new Rectangle(new Point(30, 135), label3.getPreferredSize()));

                    //---- label4 ----
                    label4.setText("Einheit:");
                    label4.setForeground(Color.black);
                    //panel5.add(label4);
                    label4.setBounds(30, 190, 50, 16);

                    //---- label5 ----
                    label5.setText("Gesamt:");
                    label5.setForeground(Color.black);
                    panel5.add(label5);
                    label5.setBounds(30, 210, 50, 16);

                    //---- label6 ----
                    label6.setText("Tote:");
                    label6.setForeground(Color.black);
                    panel5.add(label6);
                    label6.setBounds(30, 230, 28, 16);

                    //---- label7 ----
                    label7.setText("Angreifer: NAME 1");
                    label7.setForeground(Color.black);
                    label7.setFont(new Font("Distant Galaxy", Font.PLAIN, 17));
                    panel5.add(label7);
                    label7.setBounds(new Rectangle(new Point(85, 70), label7.getPreferredSize()));

                    //---- label8 ----
                    label8.setText("Verteidiger: NAME 2");
                    label8.setForeground(Color.black);
                    label8.setFont(new Font("Distant Galaxy", Font.PLAIN, 17));
                    panel5.add(label8);
                    label8.setBounds(85, 165, 210, 17);

                    //======== scrollPane3 ========
                    {
                        objt2 = new Object[][] {{0, 0, 0, 0, 0},{0, 0, 0, 0, 0},};

                        //---- table2 ----
                        table2.setModel(new DefaultTableModel(
                                objt2,
                                new String[] {
                                    "Einheit A", "Einheit B", "Einheit C", "Einheit D", "Einheit E"
                                }
                            ) {
                                Class<?>[] columnTypes = new Class<?>[] {
                                        Integer.class, Integer.class, Integer.class, Integer.class, Integer.class
                                    };
                                boolean[] columnEditable = new boolean[] {
                                        false, false, false, false, false
                                    };
                                @Override
                                public Class<?> getColumnClass(int columnIndex) {
                                    return columnTypes[columnIndex];
                                }

                                @Override
                                public boolean isCellEditable(int rowIndex, int columnIndex) {
                                    return columnEditable[columnIndex];
                                }
                            });
                        {
                            TableColumnModel cm = table2.getColumnModel();
                            cm.getColumn(0).setResizable(false);
                            cm.getColumn(1).setResizable(false);
                            cm.getColumn(2).setResizable(false);
                            cm.getColumn(3).setResizable(false);
                            cm.getColumn(4).setResizable(false);
                        }
                        table2.setGridColor(Color.black);
                        table2.setEnabled(false);
                        table2.setForeground(Color.black);
                        table2.setRowSorter(null);
                        table2.setPreferredSize(new Dimension(375, 31));
                        table2.setBackground(UIManager.getColor("PasswordField.background"));
                        table2.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
                        table2.setFocusable(false);
                        table2.setSelectionForeground(Color.black);
                        table2.getTableHeader().setReorderingAllowed(false);
                        scrollPane3.setViewportView(table2);
                    }
                    panel5.add(scrollPane3);
                    scrollPane3.setBounds(85, 190, 440, 55);

                    //---- label9 ----
                    label9.setText("Der Angreifer(NAME 1) hat gewonnen und folgendes erbeutet:");
                    label9.setFont(new Font("DokChampa", Font.BOLD, 12));
                    label9.setForeground(Color.black);
                    panel5.add(label9);
                    label9.setBounds(35, 255, 405, 30);

                    //---- label10 ----
                    label10.setText("Gold: 2100");
                    label10.setForeground(Color.black);
                    panel5.add(label10);
                    label10.setBounds(80, 285, 165, label10.getPreferredSize().height);

                    //---- label11 ----
                    label11.setText("Rohstoffe: 4200");
                    label11.setForeground(Color.black);
                    panel5.add(label11);
                    label11.setBounds(80, 305, 165, 16);
                }
                JPanel bgPanel = new BgPanel();
                bgPanel.setLayout(new BorderLayout());
                bgPanel.add(panel5, BorderLayout.CENTER);
                panel3.add(bgPanel);
                bgPanel.setBounds(-5, -5, 560, 350);

                { // compute preferred size
                    Dimension preferredSize = new Dimension();
                    for(int i = 0; i < panel3.getComponentCount(); i++) {
                        Rectangle bounds = panel3.getComponent(i).getBounds();
                        preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                        preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                    }
                    Insets insets = panel3.getInsets();
                    preferredSize.width += insets.right;
                    preferredSize.height += insets.bottom;
                    panel3.setMinimumSize(preferredSize);
                    panel3.setPreferredSize(preferredSize);
                }
            }
            tabbedPane1.addTab("K\u00e4mpfe  ", new ImageIcon("Daten/kampfico.png"), panel3);
            tabbedPane1.setBackgroundAt(2, Color.lightGray);
            tabbedPane1.setForegroundAt(2, Color.black);

            //======== panel4 ========
            {
                panel4.setBackground(new Color(255, 255, 255, 0));
                panel4.setLayout(null);

                //======== panel6 ========
                {
                    panel6.setOpaque(false);
                    panel6.setPreferredSize(new Dimension(11, 11));
                    panel6.setBackground(Color.white);
                    panel6.setBorder(new EtchedBorder(EtchedBorder.RAISED));
                    panel6.setLayout(null);

                    //======== scrollPane1 ========
                    {
                        //---- list1 ----
                        list1.setModel(new AbstractListModel<String>() {
                                String[] values = mysql.gebeNamen(namexx);
                                @Override
                                public int getSize() { return values.length; }

                                @Override
                                public String getElementAt(int i) { return values[i]; }
                            });
                        list1.setFont(list1.getFont().deriveFont(list1.getFont().getSize() + 4f));
                        list1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                        //list1.setDragEnabled(true);
                        list1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
                        list1.setBackground(UIManager.getColor("ScrollBar.background"));
                        list1.setSelectedIndex(0);
                        list1.setBorder(UIManager.getBorder("Tree.editorBorder"));
                        list1.setForeground(Color.black);
                        list1.setFocusable(false);
                        //list1.addListSelectionListener(e -> list1ValueChanged(e));
                        scrollPane1.setViewportView(list1);
                    }
                    panel6.add(scrollPane1);
                    scrollPane1.setBounds(45, 40, 245, 270);

                    //---- button4 ----
                    button4.setText("Angreifen");
                    button4.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                    button4.setForeground(Color.black);
                    button4.setFocusable(false);
                    panel6.add(button4);
                    button4.setBounds(370, 135, 95, 35);

                    //---- button5 ----
                    button5.setText("Unterst\u00fczen");
                    button5.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                    button5.setForeground(Color.black);
                    button5.setFocusable(false);
                    panel6.add(button5);
                    button5.setBounds(365, 190, 105, 35);

                    //---- label12 ----
                    label12.setText("Spieler Aktionen:");
                    label12.setFont(label12.getFont().deriveFont(label12.getFont().getSize() + 8f));
                    label12.setHorizontalAlignment(SwingConstants.CENTER);
                    label12.setForeground(Color.black);
                    panel6.add(label12);
                    label12.setBounds(335, 60, 165, 40);

                    //---- label13 ----
                    label13.setText("("+list1.getSelectedValue()+")");
                    label13.setFont(label13.getFont().deriveFont(label13.getFont().getSize() + 6f));
                    label13.setHorizontalAlignment(SwingConstants.CENTER);
                    label13.setForeground(Color.black);
                    panel6.add(label13);
                    label13.setBounds(335, 85, 165, 40);
                }
                JPanel bgPanel2 = new BgPanel();
                bgPanel2.setLayout(new BorderLayout());
                bgPanel2.add(panel6, BorderLayout.CENTER);
                panel4.add(bgPanel2);
                bgPanel2.setBounds(-5, -5, 560, 350);

                { // compute preferred size
                    Dimension preferredSize = new Dimension();
                    for(int i = 0; i < panel4.getComponentCount(); i++) {
                        Rectangle bounds = panel4.getComponent(i).getBounds();
                        preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                        preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                    }
                    Insets insets = panel4.getInsets();
                    preferredSize.width += insets.right;
                    preferredSize.height += insets.bottom;
                    panel4.setMinimumSize(preferredSize);
                    panel4.setPreferredSize(preferredSize);
                }
            }
            tabbedPane1.addTab("Rangliste ", new ImageIcon("Daten/listeico.png"), panel4);
            tabbedPane1.setBackgroundAt(3, Color.lightGray);
            tabbedPane1.setForegroundAt(3, Color.black);
        }
        contentPane.add(tabbedPane1);
        tabbedPane1.setBounds(115, 75, 555, 400);

        //---- label14 ----
        label14.setText("Login: "+name);
        contentPane.add(label14);
        label14.setBounds(5, 0, 105, 25);

        contentPane.setPreferredSize(new Dimension(775, 550));
        pack();
        setLocationRelativeTo(getOwner());
        setVisible(false);
        setResizable(false);
        //END:initComponents
    }

    protected void initListener()
    {
        //BEGIN:initListener

        //---- list1 ----
        ListSelectionListener listSelectionListener = new ListSelectionListener() {
                public void valueChanged(ListSelectionEvent listSelectionEvent) {
                    label13.setText("("+list1.getSelectedValue()+")");
                }
            };
        list1.addListSelectionListener(listSelectionListener);

        comboBox1.addActionListener (new ActionListener () {
                public void actionPerformed(ActionEvent e) {
                    //---- table1 ----
                    if(comboBox1.getSelectedItem().toString()=="(Bitte wählen)") objt1 = new Object[][] {{0, 0, 0, 0, 0},{0, 0, 0, 0, 0},};
                    else objt1 = new Object[][] {{200, 20, 0, 10, 55},{25, 20, 0, 10, 55},};

                    table1.setModel(new DefaultTableModel(
                            objt1,
                            new String[] {
                                "Einheit A", "Einheit B", "Einheit C", "Einheit D", "Einheit E"
                            }
                        ) {
                            Class<?>[] columnTypes = new Class<?>[] {
                                    Integer.class, Integer.class, Integer.class, Integer.class, Integer.class
                                };
                            boolean[] columnEditable = new boolean[] {
                                    false, false, false, false, false
                                };
                            @Override
                            public Class<?> getColumnClass(int columnIndex) {
                                return columnTypes[columnIndex];
                            }

                            @Override
                            public boolean isCellEditable(int rowIndex, int columnIndex) {
                                return columnEditable[columnIndex];
                            }
                        });

                    //---- table2 ----
                    if(comboBox1.getSelectedItem().toString()=="(Bitte wählen)") objt2 = new Object[][] {{0, 0, 0, 0, 0},{0, 0, 0, 0, 0},};
                    else objt2 = new Object[][] {{25, 20, 0, 10, 55},{25, 20, 0, 10, 55},};

                    table2.setModel(new DefaultTableModel(
                            objt2,
                            new String[] {
                                "Einheit A", "Einheit B", "Einheit C", "Einheit D", "Einheit E"
                            }
                        ) {
                            Class<?>[] columnTypes = new Class<?>[] {
                                    Integer.class, Integer.class, Integer.class, Integer.class, Integer.class
                                };
                            boolean[] columnEditable = new boolean[] {
                                    false, false, false, false, false
                                };
                            @Override
                            public Class<?> getColumnClass(int columnIndex) {
                                return columnTypes[columnIndex];
                            }

                            @Override
                            public boolean isCellEditable(int rowIndex, int columnIndex) {
                                return columnEditable[columnIndex];
                            }
                        });
                }
            });

        //---- this ----
        this.addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent event) {
                    //closeApp();
                    //System.exit(1);
                }
            });

        bgPanelx.addMouseWheelListener(new MouseWheelListener() {
                public void mouseWheelMoved(MouseWheelEvent e) {
                    String message;
                    int notches = e.getWheelRotation();
                    if (notches < 0) {
                        message = "Mouse wheel moved UP "
                        + -notches + " notch(es)\n";
                        bgPanelx.setBounds(0, 0, 507, 306);
                    } else {
                        message = "Mouse wheel moved DOWN "
                        + notches + " notch(es)\n";
                        bgPanelx.setBounds(0, 0, 507, 296);
                    }
                    //System.out.println(message);
                }
            });

        //END:initListener
    }

    private void closeApp()
    {
        int ende = JOptionPane.showConfirmDialog(this, "Soll Clashing Tribes wirklich beendet werden?", "", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
        if(ende == 0) {
            System.exit(1);
        }
    }

    //BEGIN:variables
    static private Canvas canvas;
    private JTabbedPane tabbedPane1;
    private JPanel panel1;
    private JPanel panel8;
    public JPanel panel9;
    private JPanel panel10;
    private JTextField textField1;
    private JPanel panel2;
    private JButton button1;
    private JButton button2;
    private JButton button3;
    private JPanel panel3;
    private JPanel panel5;
    private JComboBox<String> comboBox1;
    private JScrollPane scrollPane2;
    private JTable table1;
    private JLabel label1;
    private JLabel label2;
    private JLabel label3;
    private JLabel label4;
    private JLabel label5;
    private JLabel label6;
    private JLabel label7;
    private JLabel label8;
    private JScrollPane scrollPane3;
    private JTable table2;
    private JLabel label9;
    private JLabel label10;
    private JLabel label11;
    private JPanel panel4;
    private JPanel panel6;
    private JScrollPane scrollPane1;
    private JList<String> list1;
    private JButton button4;
    private JButton button5;
    private JLabel label12;
    private JLabel label13;
    private JLabel label14;
    private String name;
    private MySQL mysql = new MySQL();
    private Object[][] objt1;
    private Object[][] objt2;
    private String namexx;
    private JPanel bgPanelx = new BgPanelx();
    private JButton button6;
    //END:variables
}

class BgPanel extends JPanel {
    Image bg = new ImageIcon("Daten/BG.png").getImage();
    @Override
    public void paintComponent(Graphics g) {
        g.drawImage(bg, 0, 0, getWidth(), getHeight(), this);
    }
}

class BgPanelx extends JPanel {
    Image bg = new ImageIcon("Daten/HB.jpg").getImage();
    @Override
    public void paintComponent(Graphics g) {
        g.drawImage(bg, 0, 0, getWidth(), getHeight(), this);
    }
}


text:
package io.permazen.core.type;

import com.google.common.base.Preconditions;

import io.permazen.util.ByteReader;
import io.permazen.util.ByteWriter;
import io.permazen.util.LongEncoder;
import io.permazen.util.ParseContext;

import java.time.LocalTime;
import java.util.regex.Pattern;

/**
 * Non-null {@link LocalTime} type. Null values are not supported by this class.
 *
 * <p>
 * Binary encoding is via a single {@link LongEncoder}-encoded value representing
 * {@linkplain LocalTime#toNanoOfDay nanoseconds in the day}.
 */
public class LocalTimeType extends NonNullFieldType<LocalTime> {

    static final Pattern PATTERN = Pattern.compile("[0-9]+:[0-9]+(:[0-9]+(\\.[0-9]+)?)?");

    private static final long serialVersionUID = -6138317689607411426L;

    public LocalTimeType() {
        super(LocalTime.class, 0);
    }

// FieldType

    @Override
    public LocalTime read(ByteReader reader) {
        Preconditions.checkArgument(reader != null);
        return LocalTime.ofNanoOfDay(LongEncoder.read(reader));
    }

    @Override
    public void write(ByteWriter writer, LocalTime localTime) {
        Preconditions.checkArgument(localTime != null, "null localTime");
        Preconditions.checkArgument(writer != null);
        LongEncoder.write(writer, localTime.toNanoOfDay());
    }

    @Override
    public void skip(ByteReader reader) {
        Preconditions.checkArgument(reader != null);
        reader.skip(LongEncoder.decodeLength(reader.peek()));
    }

    @Override
    public LocalTime fromParseableString(ParseContext ctx) {
        return LocalTime.parse(ctx.matchPrefix(LocalTimeType.PATTERN).group());
    }

    @Override
    public String toParseableString(LocalTime localTime) {
        return localTime.toString();
    }

    @Override
    public int compare(LocalTime localTime1, LocalTime localTime2) {
        return localTime1.compareTo(localTime2);
    }

    @Override
    public boolean hasPrefix0x00() {
        return false;
    }

    @Override
    public boolean hasPrefix0xff() {
        return false;
    }
}


text:
class Student < ActiveRecord::Base

  has_many :students_tardies
  has_many :tardies, through: :students_tardies

  validates :name,
            length: { minimum: 1 },
            uniqueness: true,
            presence: true

end


text:
from requests import get
from requests.exceptions import Timeout, ConnectionError
from time import time, strftime, asctime, sleep
from sys import stdout
from exceptions import KeyboardInterrupt
from subprocess import check_output
import pymongo  #http://api.mongodb.org/python/current/tutorial.html

try:
	import RPi.GPIO as GPIO		#Raspberry Pi
except ImportError:
	import BBIO.GPIO as GPIO	#Beaglebone Black
	GPIO.BCM = None
	GPIO.setmode = lambda x: None

try:
	from config import *
except ImportError:
	from defaults import *
	print 'Warning! copy defaults.py to config.py and edit that file!'

def _waitForLedFlash():
	while GPIO.input(ldr_gpio_pin) == GPIO.LOW:	#Wait for a pin rising
		sleep(0.01) #minimal sleep
	sleep(0.25)	#debounce sleep
	while GPIO.input(ldr_gpio_pin) == GPIO.HIGH:	#Make really really sure we get a LOW here
		sleep(0.01) #minimal sleep

def	main():
	connection = pymongo.Connection(mongodb_url)
	Wattage = connection.mongolab001db.Wattage
	CurrentWattage = connection.mongolab001db.CurrentWattage

	#simply connect ldr_gpio_pin to 3.3V because we use a pulldown resistor from software

	GPIO.setmode(GPIO.BCM)
	GPIO.setup(ldr_gpio_pin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
	_waitForLedFlash()	#Skip first led flash to get a proper duration for the first one we'll use

	lastWattDataTime = lastPvOutputTime = lastLedFlashTime = time()	#first impression duration will be inaccurate
	nLedFlashes = 0
	watt_data = []

	while True:
		_waitForLedFlash()

		now   = time()
		nowJS = int(now * 1000)	#milliseconds. As in Javascript 'new Date().getTime()'
		watt  = int(3600 / (now - lastLedFlashTime))
		current_usage = '%s : %4d Watt' % (asctime(), watt)
		lastLedFlashTime = now
		nLedFlashes += 1

		print current_usage

		CurrentWattage.update({'userId' : mongodb_userId}, {
			'userId'    : mongodb_userId,		#UNIQUE INDEX
			'createdAt' : nowJS,
			'watt'      : watt},
			upsert = True)

		watt_data.append(watt)
		if mongodb_interval and now >= lastWattDataTime + mongodb_interval:
			interval    = now - lastWattDataTime
			averageWatt = float(sum(watt_data)) / len(watt_data)
			Wattage.insert({
				'userId'      : mongodb_userId,				#INDEX
				'createdAt'   : nowJS,
				'interval'    : interval,				#in seconds
				'kWh'         : averageWatt * interval / 3600 / 1000,	#/ 1000 converts Wh -> kWH
				'averageWatt' : averageWatt,				#during interval (power used)
				'watt'        : watt_data})
			lastWattDataTime = now
			watt_data = []

		if pvoutput_interval and now >= lastPvOutputTime + pvoutput_interval:
			interval     = now - lastPvOutputTime
			watt_average = nLedFlashes * 3600 / interval
		 	#print 'Watt Average %d' % watt_average
			payload = {
				'key' : pvoutput_key,
				'sid' : pvoutput_sid,
				'd'   : strftime('%Y%m%d'),
				't'   : strftime('%H:%M'),
				'v4'  : watt_average
				}
			try:
				get('http://pvoutput.org/service/r2/addstatus.jsp', params=payload, timeout=5.0)
			except ConnectionError:
				print 'Warning: pvoutput update failed'
			except Timeout:
				print 'Warning: pvoutput timed out'
			lastPvOutputTime = now
			nLedFlashes = 0

		stdout.flush()

if __name__ == '__main__':
	try:
		main()
	except KeyboardInterrupt:
		print 'Interrupted by user'
	GPIO.cleanup()


text:
namespace base {
namespace win {

// Utility class to read, write and manipulate the Windows Registry.
// Registry vocabulary primer: a "key" is like a folder, in which there
// are "values", which are <name, data> pairs, with an associated data type.
//
// Note:
// ReadValue family of functions guarantee that the return arguments
// are not touched in case of failure.
class BASE_EXPORT RegKey {
 public:
  // Called from the MessageLoop when the key changes.
  typedef base::Callback<void()> ChangeCallback;

  RegKey();
  explicit RegKey(HKEY key);
  RegKey(HKEY rootkey, const wchar_t* subkey, REGSAM access);
  ~RegKey();

  LONG Create(HKEY rootkey, const wchar_t* subkey, REGSAM access);

  LONG CreateWithDisposition(HKEY rootkey, const wchar_t* subkey,
                             DWORD* disposition, REGSAM access);

  // Creates a subkey or open it if it already exists.
  LONG CreateKey(const wchar_t* name, REGSAM access);

  // Opens an existing reg key.
  LONG Open(HKEY rootkey, const wchar_t* subkey, REGSAM access);

  // Opens an existing reg key, given the relative key name.
  LONG OpenKey(const wchar_t* relative_key_name, REGSAM access);

  // Closes this reg key.
  void Close();

  // Replaces the handle of the registry key and takes ownership of the handle.
  void Set(HKEY key);

  // Transfers ownership away from this object.
  HKEY Take();

  // Returns false if this key does not have the specified value, or if an error
  // occurrs while attempting to access it.
  bool HasValue(const wchar_t* value_name) const;

  // Returns the number of values for this key, or 0 if the number cannot be
  // determined.
  DWORD GetValueCount() const;

  // Determine the nth value's name.
  LONG GetValueNameAt(int index, std::wstring* name) const;

  // True while the key is valid.
  bool Valid() const { return key_ != NULL; }

  // Kill a key and everything that live below it; please be careful when using
  // it.
  LONG DeleteKey(const wchar_t* name);

  // Deletes an empty subkey.  If the subkey has subkeys or values then this
  // will fail.
  LONG DeleteEmptyKey(const wchar_t* name);

  // Deletes a single value within the key.
  LONG DeleteValue(const wchar_t* name);

  // Getters:

  // Returns an int32_t value. If |name| is NULL or empty, returns the default
  // value, if any.
  LONG ReadValueDW(const wchar_t* name, DWORD* out_value) const;

  // Returns an int64_t value. If |name| is NULL or empty, returns the default
  // value, if any.
  LONG ReadInt64(const wchar_t* name, int64_t* out_value) const;

  // Returns a string value. If |name| is NULL or empty, returns the default
  // value, if any.
  LONG ReadValue(const wchar_t* name, std::wstring* out_value) const;

  // Reads a REG_MULTI_SZ registry field into a vector of strings. Clears
  // |values| initially and adds further strings to the list. Returns
  // ERROR_CANTREAD if type is not REG_MULTI_SZ.
  LONG ReadValues(const wchar_t* name, std::vector<std::wstring>* values);

  // Returns raw data. If |name| is NULL or empty, returns the default
  // value, if any.
  LONG ReadValue(const wchar_t* name,
                 void* data,
                 DWORD* dsize,
                 DWORD* dtype) const;

  // Setters:

  // Sets an int32_t value.
  LONG WriteValue(const wchar_t* name, DWORD in_value);

  // Sets a string value.
  LONG WriteValue(const wchar_t* name, const wchar_t* in_value);

  // Sets raw data, including type.
  LONG WriteValue(const wchar_t* name,
                  const void* data,
                  DWORD dsize,
                  DWORD dtype);

  // Starts watching the key to see if any of its values have changed.
  // The key must have been opened with the KEY_NOTIFY access privilege.
  // Returns true on success.
  // To stop watching, delete this RegKey object. To continue watching the
  // object after the callback is invoked, call StartWatching again.
  bool StartWatching(const ChangeCallback& callback);

  HKEY Handle() const { return key_; }

 private:
  class Watcher;

  // Calls RegDeleteKeyEx on supported platforms, alternatively falls back to
  // RegDeleteKey.
  static LONG RegDeleteKeyExWrapper(HKEY hKey,
                                    const wchar_t* lpSubKey,
                                    REGSAM samDesired,
                                    DWORD Reserved);

  // Recursively deletes a key and all of its subkeys.
  static LONG RegDelRecurse(HKEY root_key,
                            const std::wstring& name,
                            REGSAM access);

  HKEY key_;  // The registry key being iterated.
  REGSAM wow64access_;
  scoped_ptr<Watcher> key_watcher_;

  DISALLOW_COPY_AND_ASSIGN(RegKey);
};

// Iterates the entries found in a particular folder on the registry.
class BASE_EXPORT RegistryValueIterator {
 public:
  // Construct a Registry Value Iterator with default WOW64 access.
  RegistryValueIterator(HKEY root_key, const wchar_t* folder_key);

  // Construct a Registry Key Iterator with specific WOW64 access, one of
  // KEY_WOW64_32KEY or KEY_WOW64_64KEY, or 0.
  // Note: |wow64access| should be the same access used to open |root_key|
  // previously, or a predefined key (e.g. HKEY_LOCAL_MACHINE).
  // See http://msdn.microsoft.com/en-us/library/windows/desktop/aa384129.aspx.
  RegistryValueIterator(HKEY root_key,
                        const wchar_t* folder_key,
                        REGSAM wow64access);

  ~RegistryValueIterator();

  DWORD ValueCount() const;

  // True while the iterator is valid.
  bool Valid() const;

  // Advances to the next registry entry.
  void operator++();

  const wchar_t* Name() const { return name_.c_str(); }
  const wchar_t* Value() const { return value_.data(); }
  // ValueSize() is in bytes.
  DWORD ValueSize() const { return value_size_; }
  DWORD Type() const { return type_; }

  int Index() const { return index_; }

 private:
  // Read in the current values.
  bool Read();

  void Initialize(HKEY root_key, const wchar_t* folder_key, REGSAM wow64access);

  // The registry key being iterated.
  HKEY key_;

  // Current index of the iteration.
  int index_;

  // Current values.
  std::wstring name_;
  std::vector<wchar_t> value_;
  DWORD value_size_;
  DWORD type_;

  DISALLOW_COPY_AND_ASSIGN(RegistryValueIterator);
};

class BASE_EXPORT RegistryKeyIterator {
 public:
  // Construct a Registry Key Iterator with default WOW64 access.
  RegistryKeyIterator(HKEY root_key, const wchar_t* folder_key);

  // Construct a Registry Value Iterator with specific WOW64 access, one of
  // KEY_WOW64_32KEY or KEY_WOW64_64KEY, or 0.
  // Note: |wow64access| should be the same access used to open |root_key|
  // previously, or a predefined key (e.g. HKEY_LOCAL_MACHINE).
  // See http://msdn.microsoft.com/en-us/library/windows/desktop/aa384129.aspx.
  RegistryKeyIterator(HKEY root_key,
                      const wchar_t* folder_key,
                      REGSAM wow64access);

  ~RegistryKeyIterator();

  DWORD SubkeyCount() const;

  // True while the iterator is valid.
  bool Valid() const;

  // Advances to the next entry in the folder.
  void operator++();

  const wchar_t* Name() const { return name_; }

  int Index() const { return index_; }

 private:
  // Read in the current values.
  bool Read();

  void Initialize(HKEY root_key, const wchar_t* folder_key, REGSAM wow64access);

  // The registry key being iterated.
  HKEY key_;

  // Current index of the iteration.
  int index_;

  wchar_t name_[MAX_PATH];

  DISALLOW_COPY_AND_ASSIGN(RegistryKeyIterator);
};

}  // namespace win
}  // namespace base

#endif  // BASE_WIN_REGISTRY_H_


text:
using EventCentric.Utils;
using System;
using System.Configuration;

namespace EventCentric.Config
{
    public class EventStoreConfig : ConfigurationSection, IEventStoreConfig
    {
        private EventStoreConfig() { }

        public static IEventStoreConfig GetConfig()
        {
            var config = ConfigurationManager.GetSection("eventStoreConfig") as EventStoreConfig;
            Ensure.NotNull(config, "Event Store configuration");
            return config;
        }

        [ConfigurationProperty("connectionString", IsRequired = true)]
        public string ConnectionString => this["connectionString"] as string;

        [ConfigurationProperty("pushMaxCount", IsRequired = true)]
        public int PushMaxCount => Convert.ToInt32(this["pushMaxCount"]);

        [ConfigurationProperty("longPollingTimeout", IsRequired = true)]
        public double LongPollingTimeout => Convert.ToDouble(this["longPollingTimeout"]);

        [ConfigurationProperty("token", IsRequired = true)]
        public string Token => this["token"] as string;
    }
}


text:
module TwentyfourSevenOffice
  module Services
    class Product < Service
      wsdl "https://api.24sevenoffice.com/Logistics/Product/V001/ProductService.asmx?WSDL"

      api_operation :get_products,
                    input_data_types: { search_params: ProductSearchParameters, return_properties: Array[String] }

      api_operation :save_products,
                    input_data_types: { products: Array[Product] }

      def where(query = {})
        search_params = TwentyfourSevenOffice::DataTypes::ProductSearchParameters.new(query)
        products = get_products(search_params: search_params, return_properties: return_props)
        as_array(products)
      end

      def all
        search_params = TwentyfourSevenOffice::DataTypes::ProductSearchParameters.new(
          date_changed: DateTime.new(1970, 1, 1)
        )
        products = get_products(search_params: search_params, return_properties: return_props)
        as_array(products)
      end

      private

      def return_props
        ::TwentyfourSevenOffice::DataTypes::Product.xml_attribute_names
      end
    end
  end
end


text:
'''Loop forever taking a snap shot from a camera and uploading to the cloud.
'''

import camupload
from time import sleep
from datetime import datetime

HOUR_START = 8
HOUR_END = 18
IDLE_TIME_SECONDS = 60 * 60  # 60 min

def todayAt(today, hr, min=0, sec=0, micros=0):
    '''Inspired from:
    http://stackoverflow.com/a/9716793
    '''
    return today.replace(hour=hr, minute=min, second=sec, microsecond=micros)

def run():
    '''Returns status code
    '''
    while True:
        now = datetime.now()
        if now >= todayAt(now, HOUR_START) and now < todayAt(now, HOUR_END):
            camupload.run()
        m, s = divmod(IDLE_TIME_SECONDS, 60)
        h, m = divmod(m, 60)
        print '%s: wait %d hours, %02d minutes, %02d seconds' % \
                                                   (now, h, m, s)
        sleep(IDLE_TIME_SECONDS)
    return 0

if __name__ == "__main__":
    exit(run())