text:
<!DOCTYPE html>

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>LinkUp - Multipurpose HTML Template</title>
<link rel="icon" type="image/png" href="images/favicon.png" />

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

Home

 Features

Camera Slider

Elastic Slider

Slidorion Slider

Accordion Slider

Static Image

Video Style

 Typography

Headings

Drop Caps

Highlights

Layouts

Lists Style

Float Images

Buttons

Tabs, Tables, Quotes

 Pages

Left + Content

Content + Right

Full Width Page

 Portfolio

Sortable + 4 Columns

Sortable + 3 Columns

Standard + 4 Columns

Standard + 3 Columns

Gallery

Project Item 1

Project Item 2

Blog

Blog Style 1

Blog Style 2

Blog Post

Contact Us

Page With Sidebar

			: Content + Right Sidebar

Some Title

				It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.
					The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text.

				It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.
				The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English.
				Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text.

				It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.
				The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English.
				Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text.

Search

				<form method="get" id="searchform" action="http://html.color-theme.com/linkup">
					<fieldset>
						<input type="text" name="s" id="s" value="To search type and hit enter" onfocus="if(this.value=='To search type and hit enter')this.value='';" onblur="if(this.value=='')this.value='To search type and hit enter';">
					</fieldset>
				</form>

Categories

Post With Gallery

Quote Post

Audio Post

Post With Link

Post With Featured Image

Recent Comments

zerge on Post With Gallery

dimetrio on Quote Post

ikea on Audio Post

kseniya on Post With Link

kolyan on Post With Featured Image

Recent Posts

Getting Good with Git

Theme Tumblr Like a Pro

Post with Slideshow

Simple Text Post

Corporate Motivation Audio Theme

Contact Info

Pinup is an American multinational compane that designs
			and markets consumer electronics, computer software, and personal computers.

				12345 / Some Street
New York, USA
				phone: +1 (44)  123-45-67
				support@color-theme.com

Twitter Feed

Flickr Photos

We are a group of designers combining our skills to create traditional
			and new creative websites for your communicational issues.

Home

Features

Typography

Pages

Portfolio

Blog

© Copyright © 2013.Company name All rights reserved.网页模板


text:
import socket, serial, thread, time, os, sys

s = socket.socket()         # Create a socket object
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)

myIP='127.0.0.1'            # Adresse des eigenen Rechners
port = 12345                # Reserve a port for your service.
s.bind((myIP, port))        # Bind to the port
s.listen(5)                 # Now wait for client connection.
responseString = 0
responseReadyToBeRead = 0
awaitingResponse = 0
repeatAction = 0
## Get packets from client here and differentiate between commands, exit flags etc.
def tcp_receive():
    data = c.recv( 1024 )
    global response, awaitingResponse, responseReadyToBeRead, repeatAction
    if(data):
        splitted_msg = data.split(' ')
        # Do the message parsing and react accordingly
        if (splitted_msg[0] == "command"):
            print "[Interface] Received a command: ", data

            if (splitted_msg[1] == "update"):
                uart_command = []
                uart_command.append("0 X 5")
                print "[Interface]  Writing the command on UART: ", ''.join(uart_command), "\n"
                port.write(''.join(uart_command))
                response = ""
                elapsed = 0
                start = time.clock()
                while not responseReadyToBeRead:
                    awaitingResponse = 1
                    elapsed = (time.clock() - start)
                    if (repeatAction == 1):
                        print "Action had to be repeated!"
                        port.write(''.join(uart_command))
                        repeatAction = 0
                    if elapsed >= 4:
                        tcp_send("PROBLEM")
                        responseReadyToBeRead = 1
                    pass

                responseReadyToBeRead = 0
                awaitingResponse = 0

            if (splitted_msg[1] == "info"):
                uart_command = []
                uart_command.append("0 ")
                uart_command.append(splitted_msg[2])
                uart_command.append(" 1")
                print "Writing the command on UART: ", ''.join(uart_command)
                print "\n"
                port.write(''.join(uart_command))
                response = ""
                elapsed = 0
                start = time.clock()
                while not responseReadyToBeRead:
                    awaitingResponse = 1
                    elapsed = (time.clock() - start)
                    if (repeatAction == 1):
                        print "Action had to be repeated!"
                        port.write(''.join(uart_command))
                        repeatAction = 0
                    if elapsed >= 4:
                        tcp_send("PROBLEM")
                        responseReadyToBeRead = 1
                    pass

                responseReadyToBeRead = 0
                awaitingResponse = 0
                #print ("[Interface] Response sent to GUI: ", response)

            if (splitted_msg[1] == "disable"):
                uart_command = []
                uart_command.append("0 ")
                uart_command.append(splitted_msg[2])
                uart_command.append(" 2")
                print "Writing the command on UART: ", ''.join(uart_command)
                print "\n"
                port.write(''.join(uart_command))
                response = "DISABLED"
                tcp_send(response)
                print ("[Interface] Response sent to GUI: ", response)

            if (splitted_msg[1] == "enable"):
                uart_command = []
                uart_command.append("0 ")
                uart_command.append(splitted_msg[2])
                uart_command.append(" 3")
                print "Writing the command on UART: ", ''.join(uart_command)
                print "\n"
                port.write(''.join(uart_command))
                response = "ENABLED"
                tcp_send(response)
                print ("[Interface] Response sent to GUI: ", response)

        elif (splitted_msg[0] == "quit"):
            s.close()
            os._exit(0)

def tcp_send(message):
    c.send( message )

def initialise_uart():
    global port
    port = serial.Serial(sys.argv[1], baudrate=115200, timeout=0.001)

def write_uart(message):
    port.write(message)

def read_uart():
    rcv = port.read(1)
    return rcv

def UART_r():
    global response, responseReadyToBeRead, awaitingResponse, repeatAction
    # UART RECEIVE PART
    while(True):
        uart_response = []
        uart_part = read_uart()
        while(uart_part and uart_part != 'Q'):
            uart_response.append(uart_part)
            uart_part = read_uart()

        if (uart_response):
            uart_response = ''.join(uart_response)
            print ("[Commander] UART: ",  uart_response)

        # Command response information:
        if "ROUTING INFO" in uart_response:
                response = ""
                print "[Interface] ROUTING INFO in der Nachricht vorhanden!"
                arrayOfNumbersInString = [int(s) for s in uart_response.split() if s.isdigit()]
                response = "RESPONSE "
                response = response + str(arrayOfNumbersInString[len(arrayOfNumbersInString)-1]) + " "
                if(awaitingResponse):
                    responseReadyToBeRead = 1
                    print ("[Interface] Got this route response: ", response)
                    tcp_send(response)
                    print ("[Interface] Response sent to GUI: ", response)
                    awaitingResponse = 0
                else:
                    print ("[Interface] Got this eventful route response: ", response)
                    response = "ROUTVENT " + response
                    tcp_send(response)
                    print ("[Interface] ROUTVENT sent to GUI: ", response)
                    awaitingResponse = 0
        if "RESPONSE INFO" in uart_response:
                response = ""
                print "[Interface] RESPONSE INFO in der Nachricht vorhanden!"
                arrayOfNumbersInString = [int(s) for s in uart_response.split() if s.isdigit()]
                response = "RESPONSE "
                for i in arrayOfNumbersInString:
                    response = response + str(i) + " "
                if(awaitingResponse):
                    responseReadyToBeRead = 1
                    print ("[Interface] Got this info response: ", response)
                    tcp_send(response)
                    print ("[Interface] Response sent to GUI: ", response)
                    awaitingResponse = 0
                else:
                    print ("[Interface] Got this eventful info response: ", response)
                    response = "EVENT " + response
                    tcp_send(response)
                    print ("[Interface] Event sent to GUI: ", response)
        if "WARNING INFO" in uart_response:
                response = ""
                print "[Interface] Got a warning from a node."
                arrayOfNumbersInString = [int(s) for s in uart_response.split() if s.isdigit()]
                print arrayOfNumbersInString
                response = str(arrayOfNumbersInString[1])
                response = "WARNVENT " + response
                tcp_send(response)
                print ("[Interface] WARNVENT sent to GUI: ", response)
        elif "PROBLEM" in uart_response:
                response = "PROBLEM"
                if(awaitingResponse):
                    print ("[Interface] Got a command parsing error. Execute action again!")
                    repeatAction = 1
        # Event information
        elif "EVENT INFO" in uart_response:
                pass

def TCP_rw_UART_w():
    while(1):
        tcp_receive()

def create_Threads():
    # Create two threads as follows
    try:
        thread.start_new_thread( UART_r, () )
        thread.start_new_thread( TCP_rw_UART_w, () )
    except:
        print "Error: unable to start thread"

##### BEGIN HERE #####
initialise_uart()
print "[Interface] Waiting for a device to connect..."
c, addr = s.accept()     # Establish connection with client.
print '[Interface] Got connection from', addr

create_Threads()

while True:
    pass

redpajama_set_name: RedPajamaGithub


text:
package console

import (
	"fmt"
	"strings"

	"github.com/peterh/liner"
)

// Stdin holds the stdin line reader (also using stdout for printing prompts).
// Only this reader may be used for input because it keeps an internal buffer.
var Stdin = newTerminalPrompter()

// UserPrompter defines the methods needed by the console to promt the user for
// various types of inputs.
type UserPrompter interface {
	// PromptInput displays the given prompt to the user and requests some textual
	// data to be entered, returning the input of the user.
	PromptInput(prompt string) (string, error)

	// PromptPassword displays the given prompt to the user and requests some textual
	// data to be entered, but one which must not be echoed out into the terminal.
	// The method returns the input provided by the user.
	PromptPassword(prompt string) (string, error)

	// PromptConfirm displays the given prompt to the user and requests a boolean
	// choice to be made, returning that choice.
	PromptConfirm(prompt string) (bool, error)

	// SetHistory sets the the input scrollback history that the prompter will allow
	// the user to scoll back to.
	SetHistory(history []string)

	// AppendHistory appends an entry to the scrollback history. It should be called
	// if and only if the prompt to append was a valid command.
	AppendHistory(command string)

	// SetWordCompleter sets the completion function that the prompter will call to
	// fetch completion candidates when the user presses tab.
	SetWordCompleter(completer WordCompleter)
}

// WordCompleter takes the currently edited line with the cursor position and
// returns the completion candidates for the partial word to be completed. If
// the line is "Hello, wo!!!" and the cursor is before the first '!', ("Hello,
// wo!!!", 9) is passed to the completer which may returns ("Hello, ", {"world",
// "Word"}, "!!!") to have "Hello, world!!!".
type WordCompleter func(line string, pos int) (string, []string, string)

// terminalPrompter is a UserPrompter backed by the liner package. It supports
// prompting the user for various input, among others for non-echoing password
// input.
type terminalPrompter struct {
	*liner.State
	warned     bool
	supported  bool
	normalMode liner.ModeApplier
	rawMode    liner.ModeApplier
}

// newTerminalPrompter creates a liner based user input prompter working off the
// standard input and output streams.
func newTerminalPrompter() *terminalPrompter {
	p := new(terminalPrompter)
	// Get the original mode before calling NewLiner.
	// This is usually regular "cooked" mode where characters echo.
	normalMode, _ := liner.TerminalMode()
	// Turn on liner. It switches to raw mode.
	p.State = liner.NewLiner()
	rawMode, err := liner.TerminalMode()
	if err != nil || !liner.TerminalSupported() {
		p.supported = false
	} else {
		p.supported = true
		p.normalMode = normalMode
		p.rawMode = rawMode
		// Switch back to normal mode while we're not prompting.
		normalMode.ApplyMode()
	}
	p.SetCtrlCAborts(true)
	p.SetTabCompletionStyle(liner.TabPrints)
	p.SetMultiLineMode(true)
	return p
}

// PromptInput displays the given prompt to the user and requests some textual
// data to be entered, returning the input of the user.
func (p *terminalPrompter) PromptInput(prompt string) (string, error) {
	if p.supported {
		p.rawMode.ApplyMode()
		defer p.normalMode.ApplyMode()
	} else {
		// liner tries to be smart about printing the prompt
		// and doesn't print anything if input is redirected.
		// Un-smart it by printing the prompt always.
		fmt.Print(prompt)
		prompt = ""
		defer fmt.Println()
	}
	return p.State.Prompt(prompt)
}

// PromptPassword displays the given prompt to the user and requests some textual
// data to be entered, but one which must not be echoed out into the terminal.
// The method returns the input provided by the user.
func (p *terminalPrompter) PromptPassword(prompt string) (passwd string, err error) {
	if p.supported {
		p.rawMode.ApplyMode()
		defer p.normalMode.ApplyMode()
		return p.State.PasswordPrompt(prompt)
	}
	if !p.warned {
		fmt.Println("!! Unsupported terminal, password will be echoed.")
		p.warned = true
	}
	// Just as in Prompt, handle printing the prompt here instead of relying on liner.
	fmt.Print(prompt)
	passwd, err = p.State.Prompt("")
	fmt.Println()
	return passwd, err
}

// PromptConfirm displays the given prompt to the user and requests a boolean
// choice to be made, returning that choice.
func (p *terminalPrompter) PromptConfirm(prompt string) (bool, error) {
	input, err := p.Prompt(prompt + " [y/N] ")
	if len(input) > 0 && strings.ToUpper(input[:1]) == "Y" {
		return true, nil
	}
	return false, err
}

// SetHistory sets the the input scrollback history that the prompter will allow
// the user to scoll back to.
func (p *terminalPrompter) SetHistory(history []string) {
	p.State.ReadHistory(strings.NewReader(strings.Join(history, "\n")))
}

// AppendHistory appends an entry to the scrollback history. It should be called
// if and only if the prompt to append was a valid command.
func (p *terminalPrompter) AppendHistory(command string) {
	p.State.AppendHistory(command)
}

// SetWordCompleter sets the completion function that the prompter will call to
// fetch completion candidates when the user presses tab.
func (p *terminalPrompter) SetWordCompleter(completer WordCompleter) {
	p.State.SetWordCompleter(liner.WordCompleter(completer))
}


text:
from linklist import *

class Solution:
    def insertionSortList(self, head):
        dumm = head
        while head:
            val, head, prev = head.val, head.next, dumm
            while val >= prev.val:
                prev = prev.next
            while prev != head:
                prev.val, prev, val = val, prev.next, prev.val
        return dumm

sol = Solution()
nodeStringList = [
        '[4,2,1,3]',
        '[-1,5,3,4,0]',
        '[3,2]',
        '[23]',
        '[]'
]
for nodeString in nodeStringList:
    head = linkListBuilder(nodeString)
    traverse(head)
    traverse(sol.insertionSortList(head))


text:
from idlelib.delegator import Delegator
from idlelib.redirector import WidgetRedirector

class Percolator:

    def __init__(self, text):
        # XXX would be nice to inherit from Delegator
        self.text = text
        self.redir = WidgetRedirector(text)
        self.top = self.bottom = Delegator(text)
        self.bottom.insert = self.redir.register("insert", self.insert)
        self.bottom.delete = self.redir.register("delete", self.delete)
        self.filters = []

    def close(self):
        while self.top is not self.bottom:
            self.removefilter(self.top)
        self.top = None
        self.bottom.setdelegate(None)
        self.bottom = None
        self.redir.close()
        self.redir = None
        self.text = None

    def insert(self, index, chars, tags=None):
        # Could go away if inheriting from Delegator
        self.top.insert(index, chars, tags)

    def delete(self, index1, index2=None):
        # Could go away if inheriting from Delegator
        self.top.delete(index1, index2)

    def insertfilter(self, filter):
        # Perhaps rename to pushfilter()?
        assert isinstance(filter, Delegator)
        assert filter.delegate is None
        filter.setdelegate(self.top)
        self.top = filter

    def removefilter(self, filter):
        # XXX Perhaps should only support popfilter()?
        assert isinstance(filter, Delegator)
        assert filter.delegate is not None
        f = self.top
        if f is filter:
            self.top = filter.delegate
            filter.setdelegate(None)
        else:
            while f.delegate is not filter:
                assert f is not self.bottom
                f.resetcache()
                f = f.delegate
            f.setdelegate(filter.delegate)
            filter.setdelegate(None)

def _percolator(parent):  # htest #
    import tkinter as tk

    class Tracer(Delegator):
        def __init__(self, name):
            self.name = name
            Delegator.__init__(self, None)

        def insert(self, *args):
            print(self.name, ": insert", args)
            self.delegate.insert(*args)

        def delete(self, *args):
            print(self.name, ": delete", args)
            self.delegate.delete(*args)

    box = tk.Toplevel(parent)
    box.title("Test Percolator")
    x, y = map(int, parent.geometry().split('+')[1:])
    box.geometry("+%d+%d" % (x, y + 175))
    text = tk.Text(box)
    p = Percolator(text)
    pin = p.insertfilter
    pout = p.removefilter
    t1 = Tracer("t1")
    t2 = Tracer("t2")

    def toggle1():
        (pin if var1.get() else pout)(t1)
    def toggle2():
        (pin if var2.get() else pout)(t2)

    text.pack()
    var1 = tk.IntVar(parent)
    cb1 = tk.Checkbutton(box, text="Tracer1", command=toggle1, variable=var1)
    cb1.pack()
    var2 = tk.IntVar(parent)
    cb2 = tk.Checkbutton(box, text="Tracer2", command=toggle2, variable=var2)
    cb2.pack()

if __name__ == "__main__":
    from unittest import main
    main('idlelib.idle_test.test_percolator', verbosity=2, exit=False)

    from idlelib.idle_test.htest import run
    run(_percolator)


text:
Prolog/CHR module to translate an XML Schema into equivalent JSON Schema.

## Installation

All you need is [SWI-Prolog](http://www.swi-prolog.org/). See there for installation instructions.

### Pre-Compilation

It is possible to create a pre-compiled file which increases the tool's performance significantly. The command line interface is compiled using swipl's [`-c` option](http://www.swi-prolog.org/pldoc/doc_for?object=section%282,%272.10%27,swi%28%27/doc/Manual/compilation.html%27%29%29):

```bash
swipl -g main -o cli.exe -c cli.pl
```

*The `.exe` suffix is chosen for compatibility with Windows systems. See [issue #51](https://github.com/fnogatz/xsd2json/issues/51) for more details.*

## Usage as CLI

`xsd2json` provides a command line interface. You can directly execute it via

```bash
swipl -g main cli.pl -- /path/to/your.xsd
```

Call with `--help` instead of the XSD path to get more options.

After the pre-compilation step mentioned before, the created executable can be called via:

```bash
./cli.exe /path/to/your.xsd
```

### Synopsis

```
USAGE: xsd2json [options] <path>

convert a XSD file into equivalent JSON schema

Options:
--whitespace   -s  atom=remove    whitespace handling, one of
                                      remove   :  clean whitespace  [default]
                                      preserve :  keep whitespace
--indentation  -i  integer=2      set indentation level
                                    use 0 for single-line output
--trace        -t  boolean=false  run with activated tracing
--version      -v  boolean=false  show xsd2json version information
--debug-info       boolean=false  show information usually needed for debugging
--help         -h  boolean=false  display this help
```

## Usage with SWI-Prolog

The `xsd2json.pl` module provides a predicate `xsd2json/2` which can be used to convert a given XSD file into the equivalent JSON Schema. Call it via `swipl -s xsd2json.pl` followed by

```prolog
xsd2json('/path/to/your.xsd',JSON)
```

This binds the `JSON` variable to the created JSON Schema. If you want a pretty output, simply call instead:

```prolog
use_module(library(http/json)).

xsd2json('/path/to/your.xsd',JSON),
  json_write(user_output,JSON).
```

This will print the produced JSON Schema in front of the content of the CHR constraint store, so make sure to scroll up if needed.


text:
package com.huawei.streaming.udfs;

import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 获取一年的第几个星期
 *
 */
@UDFAnnotation(name = "weekofyear")
public class WeekOfYear extends UDF
{
    /**
     * 注释内容
     */
    private static final long serialVersionUID = -5028072424388328846L;

    private static final Logger LOG = LoggerFactory.getLogger(WeekOfYear.class);

    private SimpleDateFormat formatter1 = null;

    private SimpleDateFormat formatter2 = null;

    private Calendar calendar = null;

    /**
     * <默认构造函数>
     * @param config udf函数中需要的参数,这些参数要在cql中通过全局变量进行设置。
     */
    public WeekOfYear(Map<String, String> config)
    {
        super(config);
    }

    /**
     * 计算函数
     * @param dateString the dateString in the format of "yyyy-MM-dd HH:mm:ss" or yyyy-MM-dd".
     * @return week number of year. null if the dateString is not a valid date string
     */
    public Integer evaluate(String dateString)
    {
        if (dateString == null) {
            return null;
        }

        initDateFormat();
        try {
            Date date = null;
            if (dateString.length() > UDFConstants.DATE_FORMAT.length())
            {
                date = formatter1.parse(dateString);
            }
            else
            {
                date = formatter2.parse(dateString);
            }
            calendar.setTime(date);
            return calendar.get(Calendar.WEEK_OF_YEAR);
        } catch (ParseException e) {
            LOG.warn(EVALUATE_IGNORE_MESSAGE);
            return null;
        }
    }

    /**
     * 返回指定日期属于全年的周数
     * @param d date类型时间
     * @return 该日期在全年中所在的周数
     */
    public Integer evaluate(java.sql.Date d) {
        if (d == null) {
            return null;
        }
        initDateFormat();
        calendar.setTime(d);
        return calendar.get(Calendar.WEEK_OF_YEAR);
    }

    /**
     * 返回指定日期属于全年的周数
     * @param t timestamp类型时间参数
     * @return 该日期在全年中所在的周数
     */
    public Integer evaluate(Timestamp t) {
        if (t == null) {
            return null;
        }
        initDateFormat();
        calendar.setTime(t);
        return calendar.get(Calendar.WEEK_OF_YEAR);
    }

    private  void initDateFormat()
    {
        if (formatter1 != null)
        {
            return;
        }

        formatter1 = new SimpleDateFormat(UDFConstants.TIMESTAMP_FORMAT);
        formatter2 = new SimpleDateFormat(UDFConstants.DATE_FORMAT);
        calendar = Calendar.getInstance();
        calendar.setFirstDayOfWeek(Calendar.MONDAY);
        calendar.setMinimalDaysInFirstWeek(4);
            /*
             * 设置时间严格匹配
             */
        formatter1.setLenient(false);
        formatter2.setLenient(false);
    }

}


text:
package org.jasig.cas.support.wsfederation;

import org.jasig.cas.authentication.AuthenticationHandler;
import org.jasig.cas.authentication.principal.PrincipalResolver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;
import java.util.Map;

/**
 * Initializes the CAS root servlet context to make sure
 * ADFS validation can be activated and authentication handlers injected.
 * @author Misagh Moayyed
 * @since 4.2
 */
@WebListener
@Component
public class WsFedServletContextListener implements ServletContextListener, ApplicationContextAware {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    @Qualifier("adfsAuthNHandler")
    private AuthenticationHandler adfsAuthNHandler;

    @Autowired
    @Qualifier("adfsPrincipalResolver")
    private PrincipalResolver adfsPrincipalResolver;

    @Override
    public void contextInitialized(final ServletContextEvent sce) {
        logger.info("Initializing WsFed servlet context...");
    }

    @Override
    public void contextDestroyed(final ServletContextEvent sce) {}

    @Override
    public void setApplicationContext(final ApplicationContext applicationContext) throws BeansException {
        try {
            if (applicationContext.getParent() == null) {
                logger.info("Initializing WsFed root application context");

                final Map<AuthenticationHandler, PrincipalResolver> authenticationHandlersResolvers =
                        applicationContext.getBean("authenticationHandlersResolvers", Map.class);
                authenticationHandlersResolvers.put(adfsAuthNHandler, adfsPrincipalResolver);

                logger.info("Initialized WsFed root application context successfully");
            } else {
                logger.info("Initializing WsFed application context");

                logger.info("Initialized WsFed application context successfully");
            }
        } catch (final Exception e) {
            logger.error(e.getMessage(), e);
        }
    }
}


text:
from aatest.events import EV_REQUEST_ARGS, NoSuchEvent

__author__ = 'roland'

def restore_operation(conv, webio, sh):
    cls = conv.events.last('operation').data
    oper = cls(conv=conv, webio=webio, sh=sh)

    try:
        req_args = conv.events.last_item(EV_REQUEST_ARGS)
    except NoSuchEvent:
        req_args = {}

    try:
        _req_cls = oper.req_cls
    except AttributeError:
        pass
    else:
        oper.request_inst = _req_cls(conv, req_args, binding=oper._binding)

    try:
        outs = conv.events.last_item('outstanding')
    except NoSuchEvent:
        pass
    else:
        oper.response_args = {"outstanding": outs}
    return oper


text:
// Copyright Naked Objects Group Ltd, 45 Station Road, Henley on Thames, UK, RG9 1AT
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and limitations under the License.

using System;

namespace NakedFunctions {
    /// <summary>
    ///     Indicates that a collection property, or all the collection properties of a class, are to rendered 'opened' by
    ///     default
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Method)]
    public class RenderEagerlyAttribute : Attribute { }
}


text:
/*!
	@file
	@author		Evmenov Georgiy
	@date		03/2008
*/
/*
	This file is part of MyGUI.

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

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

	You should have received a copy of the GNU Lesser General Public License
	along with MyGUI.  If not, see <http://www.gnu.org/licenses/>.
*/
#include "MyGUI_Precompiled.h"
#include "MyGUI_ControllerPosition.h"
#include "MyGUI_Gui.h"
#include "MyGUI_InputManager.h"
#include "MyGUI_WidgetManager.h"
#include "MyGUI_Widget.h"
#include "MyGUI_ActionController.h"

namespace MyGUI
{

	ControllerPosition::ControllerPosition() :
		mTime(1),
		mElapsedTime(0),
		mCalcPosition(false),
		mCalcSize(false)
	{
	}

	ControllerPosition::~ControllerPosition()
	{
	}

	void ControllerPosition::setCoord(const IntCoord& _destCoord)
	{
		mDestCoord = _destCoord;
		mCalcPosition = true;
		mCalcSize = true;
	}

	void ControllerPosition::setSize(const IntSize& _destSize)
	{
		mDestCoord.width = _destSize.width;
		mDestCoord.height = _destSize.height;
		mCalcPosition = false;
		mCalcSize = true;
	}

	void ControllerPosition::setPosition(const IntPoint& _destPoint)
	{
		mDestCoord.left = _destPoint.left;
		mDestCoord.top = _destPoint.top;
		mCalcPosition = true;
		mCalcSize = false;
	}

	void ControllerPosition::prepareItem(Widget* _widget)
	{
		MYGUI_DEBUG_ASSERT(mTime > 0, "Time must be > 0");

		mStartCoord = _widget->getCoord();

		// вызываем пользовательский делегат для подготовки
		eventPreAction(_widget);
	}

	bool ControllerPosition::addTime(Widget* _widget, float _time)
	{
		mElapsedTime += _time;

		if (mElapsedTime < mTime)
		{
			IntCoord coord;
			eventFrameAction(mStartCoord, mDestCoord, coord, mElapsedTime / mTime);
			if (mCalcPosition)
			{
				if (mCalcSize) _widget->setCoord(coord);
				else _widget->setPosition(coord.point());
			}
			else if (mCalcSize) _widget->setSize(coord.size());

			// вызываем пользовательский делегат обновления
			eventUpdateAction(_widget);

			return true;
		}

		// поставить точно в конец
		IntCoord coord;
		eventFrameAction(mStartCoord, mDestCoord, coord, 1.0f);
		if (mCalcPosition)
		{
			if (mCalcSize) _widget->setCoord(coord);
			else _widget->setPosition(coord.point());
		}
		else if (mCalcSize) _widget->setSize(coord.size());

		// вызываем пользовательский делегат обновления
		eventUpdateAction(_widget);

		// вызываем пользовательский делегат пост обработки
		eventPostAction(_widget);

		return false;
	}

	void ControllerPosition::setProperty(const std::string& _key, const std::string& _value)
	{
		if (_key == "Time")
			setTime(utility::parseValue<float>(_value));
		else if (_key == "Coord")
			setCoord(utility::parseValue<IntCoord>(_value));
		else if (_key == "Size")
			setSize(utility::parseValue<IntSize>(_value));
		else if (_key == "Position")
			setPosition(utility::parseValue<IntPoint>(_value));
		else if (_key == "Function")
			setFunction(_value);
	}

	void ControllerPosition::setFunction(const std::string& _value)
	{
		if (_value == "Inertional")
			setAction(MyGUI::newDelegate(action::inertionalMoveFunction));
		else if (_value == "Accelerated")
			setAction(MyGUI::newDelegate(action::acceleratedMoveFunction<30>));
		else if (_value == "Slowed")
			setAction(MyGUI::newDelegate(action::acceleratedMoveFunction<4>));
		else if (_value == "Jump")
			setAction(MyGUI::newDelegate(action::jumpMoveFunction<5>));
	}

	void ControllerPosition::setTime(float _value)
	{
		mTime = _value;
	}

	void ControllerPosition::setAction(FrameAction::IDelegate* _value)
	{
		eventFrameAction = _value;
	}

} // namespace MyGUI


text:
{% for hidden in form.hidden_fields %}
    {{ hidden }}
{% endfor %}
{% for field in form.visible_fields %}

    {% include "bs3_forms/form_widget.html" with field=field %}

{% endfor %}


text:
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion

class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('core', '0002_comment_postgcp'),
    ]

    operations = [
        migrations.CreateModel(
            name='ProfileGCP',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('id_user', models.IntegerField()),
                ('bio', models.TextField(blank=True)),
                ('profileimg', models.TextField(default='blank-profile-picture.png')),
                ('location', models.CharField(blank=True, max_length=100)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]


text:
export * from './custom-error-handler';
export * from './helpers';
export * from './md-renderer';
export * from './spec-manager';
export { default as JsonPointer } from './JsonPointer';


text:
class vmLineEdit;

namespace Ui
{
	class SimpleCalculator;
}

class SimpleCalculator : public QDialog
{

public:
	virtual ~SimpleCalculator ();
	void showCalc ( const QPoint&, vmLineEdit* line = nullptr, QWidget* parentWindow = nullptr );
	void showCalc ( const QString& input, const QPoint &, vmLineEdit* line = nullptr, QWidget* parentWindow = nullptr );

	inline const QString getResult () const { return mStrResult; }

private:
	explicit SimpleCalculator ();
	static SimpleCalculator* s_instance;
	friend SimpleCalculator* CALCULATOR ();
	void calculate ();
	void relevantKeyPressed ( const QKeyEvent* qe );
	void btnCopyResultClicked ();

	QString mStrResult;
	vmLineEdit* txtReceiveResult;
	Ui::SimpleCalculator *ui;
};

inline SimpleCalculator *CALCULATOR ()
{
	if ( SimpleCalculator::s_instance == nullptr )
		SimpleCalculator::s_instance = new SimpleCalculator;
	return SimpleCalculator::s_instance;
}

#endif // SIMPLECALCULATOR_H


text:
namespace arg3
{
    namespace game
    {
        class area;

        class world : public record<world>
        {
           public:
#ifndef SWIG
            constexpr static const char *const TABLE_NAME = "worlds";
            constexpr static const char *const COL_PORT = "port";
            constexpr static const char *const COL_NAME = "name";
            constexpr static const char *const COL_WS_PORT = "websocket_port";
            constexpr static const char *const COL_DB_NAME = "db_name";
#endif
            typedef list<area_ptr>::const_iterator const_iterator;
            typedef list<area_ptr>::iterator iterator;

            world();
            ~world();
            world(const world &world);
            world(world &&world);
            world &operator=(const world &world);
            world &operator=(world &&world);

            int port() const;
            void set_port(int value);

            int websocket_port() const;
            void set_websocket_port(int value);

            string db_name() const;
            void set_db_name(const string &value);

            string name() const;
            void set_name(const string &value);

            static world_ptr create_default();

            void from_storage(const storage &obj);
            void to_storage(storage_builder &obj) const;

            bool save();

            void add(area_ptr area);

            const_iterator begin() const;
            const_iterator end() const;
            iterator begin();
            iterator end();

            template <typename T>
            location_ptr find_location(const string &name, const T &value)
            {
                for (auto area : areas_) {
                    auto loc = area->find_location(name, value);

                    if (loc != nullptr) {
                        return loc;
                    }
                }
                return nullptr;
            }

           private:
            list<area_ptr> areas_;
        };
    }
}

#endif