text:
namespace password_manager {
namespace mac {
namespace ui {
const CGFloat kDesiredBubbleWidth = 370;
const CGFloat kFramePadding = 16;
const CGFloat kRelatedControlHorizontalPadding = 2;
const CGFloat kUnrelatedControlVerticalPadding = 20;
}  // namespace ui
}  // namespace mac
}  // namespace password_manager

// Handles user interaction with the content view.
@protocol ManagePasswordsBubbleContentViewDelegate<NSObject>

// The user performed an action that should dismiss the bubble.
- (void)viewShouldDismiss;

@end

// Base class for a state of the password management bubble.
@interface ManagePasswordsBubbleContentViewController : NSViewController {
  id<ManagePasswordsBubbleContentViewDelegate> delegate_;  // Weak.
}
- (id)initWithDelegate:(id<ManagePasswordsBubbleContentViewDelegate>)delegate;
- (NSButton*)addButton:(NSString*)title
                toView:(NSView*)view
                target:(id)target
                action:(SEL)action;
- (NSTextField*)addTitleLabel:(NSString*)title toView:(NSView*)view;
- (NSTextField*)addLabel:(NSString*)title toView:(NSView*)view;
- (void)bubbleWillDisappear;

@property(nonatomic, assign)
    id<ManagePasswordsBubbleContentViewDelegate> delegate;

@end

#endif  // CHROME_BROWSER_UI_COCOA_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_CONTENT_VIEW_CONTROLLER_H_

redpajama_set_name: RedPajamaGithub


text:
<html>
<head>
	<?php session_start(); ?>

	<link rel = "stylesheet" type = "text/css" href = "<?php echo asseturl();?>css/bootstrap.css" />
	<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Lato">
	<link rel="stylesheet" type="text/css" href="<?php echo asseturl();?>css/main.css">
	<link rel="icon" href="<?php echo assetUrl() . 'img/icon.png'?>">
	<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
	<script src = "<?php echo assetUrl();?>js/jquery-1.12.3.min.js"></script>
	<script src="<?php echo assetUrl();?>js/jquery.animate-colors.js"></script>
	<script src = "<?php echo assetUrl();?>ckeditor/ckeditor.js"></script>
	<script src = "<?php echo asseturl();?>js/bootstrap.js"></script>
	<script src = "<?php echo asseturl();?>js/app.js"></script>
	<script src = "https://apis.google.com/js/client.js?onload=init"></script>
	<script>
		var table = "<?php echo $table; ?>";
		var ajaxMethod = "<?php echo $ajaxMethod; ?>";
		var controller = "<?php echo $controller; ?>";
		var baseUrl = "<?php echo base_url(); ?>";
	</script>
	<script src = "<?php echo assetUrl();?>js/main.js"></script>

	<title>PetKnow</title>
</head>

<body>

	<div class = "mother-container">
		<?php $this->load->view('navbar') ?>


text:
using ::testing::SaveArg;
using ::testing::_;

namespace ui {

WaylandTest::WaylandTest()
    : window(&delegate, &connection, gfx::Rect(0, 0, 800, 600)) {}

WaylandTest::~WaylandTest() {}

void WaylandTest::SetUp() {
  ASSERT_TRUE(server.Start());
  ASSERT_TRUE(connection.Initialize());
  EXPECT_CALL(delegate, OnAcceleratedWidgetAvailable(_, _))
      .WillOnce(SaveArg<0>(&widget));
  ASSERT_TRUE(window.Initialize());
  ASSERT_NE(widget, gfx::kNullAcceleratedWidget);

  // Wait for the client to flush all pending requests from initialization.
  base::RunLoop().RunUntilIdle();

  // Pause the server after it has responded to all incoming events.
  server.Pause();

  surface = server.GetObject<wl::MockSurface>(widget);
  ASSERT_TRUE(surface);

  initialized = true;
}

void WaylandTest::TearDown() {
  if (initialized)
    Sync();
}

void WaylandTest::Sync() {
  // Resume the server, flushing its pending events.
  server.Resume();

  // Wait for the client to finish processing these events.
  base::RunLoop().RunUntilIdle();

  // Pause the server, after it has finished processing any follow-up requests
  // from the client.
  server.Pause();
}

}  // namespace ui


text:
using System;
using System.Collections.Generic;
using Talifun.Commander.Command.Configuration;
using Talifun.Commander.Command.Esb;
using Talifun.Commander.Command.VideoThumbNailer.Command.Request;
using Talifun.Commander.Command.VideoThumbNailer.CommandTester.Request;
using Talifun.Commander.Command.VideoThumbnailer.Configuration;

namespace Talifun.Commander.Command.VideoThumbnailer
{
	public class VideoThumbnailerMessanger : ICommandMessenger
	{
		public ISettingConfiguration Settings
		{
			get { return VideoThumbnailerConfiguration.Instance; }
		}

		public object CreateCancelMessage(Guid correlationId, Guid requestorCorrelationId)
		{
			return new VideoThumbnailerCancelMessage
			{
				CorrelationId = correlationId,
				ParentCorrelationId = requestorCorrelationId
			};
		}

		public object CreateRequestMessage(Guid correlationId, Guid requestorCorrelationId, IDictionary<string, string> appSettings, ProjectElement project, string workingFilePath, FileMatchElement fileMatch)
		{
			var configuration = project.GetElement<VideoThumbnailerElement>(fileMatch, Settings.ElementCollectionSettingName);

			return new VideoThumbnailerRequestMessage
			{
				CorrelationId = correlationId,
				RequestorCorrelationId = requestorCorrelationId,
				AppSettings = appSettings,
				Configuration = configuration,
				InputFilePath = workingFilePath,
				FileMatch = fileMatch
			};
		}

		public object CreateTestConfigurationRequestMessage(Guid correlationId, Guid requestorCorrelationId, IDictionary<string, string> appSettings, ProjectElement project)
		{
			var configuration = project.GetElementCollection<VideoThumbnailerElementCollection>(Settings.ElementCollectionSettingName);
			return new VideoThumbnailerConfigurationTestRequestMessage
			{
				CorrelationId = correlationId,
				RequestorCorrelationId = requestorCorrelationId,
				AppSettings = appSettings,
				ProjectName = project.Name,
				Configuration = configuration
			};
		}
	}
}


text:
#include "statements/Statement.h"
#include "statements/ExpressionStatement.h"

#include "ModelBase/src/nodes/TypedListDefinition.h"
DEFINE_TYPED_LIST(OOModel::Statement)

namespace OOModel {

COMPOSITENODE_DEFINE_EMPTY_CONSTRUCTORS(Statement)
		COMPOSITENODE_DEFINE_TYPE_REGISTRATION_METHODS_WITH_DEFAULT_PROXY(Statement, ExpressionStatement)

}


text:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.eje_c.multilink.json" />


text:
import axios from 'axios'

export const getSeasons = (id = null) => dispatch => {
  dispatch({
    type: 'FETCH_SEASONS_ONLOAD'
  })

  const url = id ? `/seasons?id=${id}` : '/seasons'

  axios.get(url).then(response => {
    dispatch({
      type: 'FETCH_SEASONS_SUCCESS',
      payload: response.data
    })
  }, error => {
    dispatch({
      type: 'FETCH_SEASONS_ERROR',
      payload: error.response
    })
  })
}

// READ
export const getSeason = (id) => dispatch => {
  dispatch({
    type: 'FETCH_SEASON_ONLOAD'
  })

  axios.get(`/seasons/${id}`).then(response => {
    dispatch({
      type: 'FETCH_SEASON_SUCCESS',
      payload: response.data
    })
  }, error => {
    dispatch({
      type: 'FETCH_SEASON_ERROR',
      payload: error.response
    })
  })
}

export const createSeason = (data) => dispatch => {
  axios.post('/seasons', data).then(response => {
    dispatch({
      type: 'CREATE_SEASON_SUCCESS',
      payload: response.data
    })
  }, error => {
    dispatch({
      type: 'CREATE_SEASON_ERROR',
      payload: error.response
    })
  })
}

// export const getSesons = () => dispatch => {
//   dispatch({
//     type: 'FETCH_SERIALS_ONLOAD'
//   })
//
//   axios.get('/serials').then(response => {
//     dispatch({
//       type: 'FETCH_SERIALS_SUCCESS',
//       payload: response.data
//     })
//   }, error => {
//     dispatch({
//       type: 'FETCH_SERIALS_ERROR',
//       payload: error.response
//     })
//   })
// }

// export const deleteSerial = (id) => dispatch => {
//   axios.delete(`serials/${id}`).then(response => {
//     dispatch({
//       type: 'DELETE_SERIAL_SUCCESS',
//       payload: response.data
//     })
//   }, error => {
//     dispatch({
//       type: 'DELETE_SERIAL_ERROR',
//       payload: error.response
//     })
//   })
// }
//
// export const addSeral = (data) => dispatch => {
//   axios.post('serials', data).then(response => {
//     dispatch({
//       type: 'CREATE_SERIAL_SUCCESS',
//       payload: response.data
//     })
//   }, error => {
//     dispatch({
//       type: 'CREATE_SERIAL_ERROR',
//       payload: response.data
//     })
//   })
// }
//
// export const getSerial = (id) => dispatch => {
//   dispatch({
//     type: 'FETCH_SERIAL_ONLOAD'
//   })
//
//   axios.get(`/serials/${id}`).then(response => {
//     dispatch({
//       type: 'FETCH_SERIAL_SUCCESS',
//       payload: response.data
//     })
//   }, error => {
//     dispatch({
//       type: 'FETCH_SERIAL_ERROR',
//       payload: error.response
//     })
//   })
// }
//
//
// export const updateSerial = (id, data) => dispatch => {
//   dispatch({
//     type: 'UPDATE_SERIAL_ONLOAD'
//   })
//
//   axios.put(`serials/${id}`, data).then(response => {
//     dispatch({
//       type: 'UPDATE_SERIAL_SUCCESS',
//       payload: response.data
//     })
//   }, error => {
//     dispatch({
//       type: 'UPDATE_SERIAL_ERROR',
//       payload: error.response
//     })
//   })
// }


text:
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
	http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5">

    <display-name>Front Sistemas de la Facultad de Contaduria y Adminsitracion - Universidad Veracruzana</display-name>
    <description>La base del sistema front</description>

    <!-- For web context -->
    <servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/spring-mvc-config.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <!-- For root context -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/spring-core-config.xml</param-value>
    </context-param>

</web-app>


text:
package com.hazelcast.internal.cluster.impl.operations;

import com.hazelcast.core.MemberLeftException;
import com.hazelcast.internal.cluster.impl.ClusterDataSerializerHook;
import com.hazelcast.internal.cluster.impl.ClusterServiceImpl;
import com.hazelcast.internal.cluster.impl.MembersView;
import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.spi.ExceptionAction;
import com.hazelcast.spi.exception.CallerNotMemberException;

import java.io.IOException;

import static com.hazelcast.spi.ExceptionAction.THROW_EXCEPTION;

/**
 * An operation sent by the member that starts mastership claim process to fetch/gather member views of other members.
 * Collected member views will be used to decide final, most recent member list.
 *
 * @since 3.9
 */
public class FetchMembersViewOp extends AbstractClusterOperation implements JoinOperation {

    private String targetUuid;
    private MembersView membersView;

    public FetchMembersViewOp() {
    }

    public FetchMembersViewOp(String targetUuid) {
        this.targetUuid = targetUuid;
    }

    @Override
    public void run() throws Exception {
        ClusterServiceImpl service = getService();
        String thisUuid = service.getLocalMember().getUuid();
        if (!targetUuid.equals(thisUuid)) {
            throw new IllegalStateException("Rejecting mastership claim, since target uuid[" + targetUuid
                    + "] is not matching local member uuid[" + thisUuid + "].");
        }
        membersView = service.handleMastershipClaim(getCallerAddress(), getCallerUuid());
    }

    @Override
    public boolean returnsResponse() {
        return true;
    }

    @Override
    public Object getResponse() {
        return membersView;
    }

    @Override
    public ExceptionAction onInvocationException(Throwable throwable) {
        if (throwable instanceof MemberLeftException || throwable instanceof CallerNotMemberException) {
            return THROW_EXCEPTION;
        }

        return super.onInvocationException(throwable);
    }

    @Override
    public int getId() {
        return ClusterDataSerializerHook.FETCH_MEMBER_LIST_STATE;
    }

    @Override
    protected void writeInternal(ObjectDataOutput out) throws IOException {
        out.writeUTF(targetUuid);
    }

    @Override
    protected void readInternal(ObjectDataInput in) throws IOException {
        targetUuid = in.readUTF();
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="200dp"
    android:layout_height="200dp"
    android:background="@drawable/pp_chat_recording_view_bg"
    android:orientation="vertical">

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="150dp">

        <LinearLayout
            android:id="@+id/pp_recording_imageview_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:gravity="center_vertical"
            android:orientation="horizontal">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/pp_recording_bkg"
                android:layout_weight="1"
                android:id="@+id/imageView" />

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/pp_recording_signal_008"
                android:id="@+id/pp_recording_state_imageview" />
        </LinearLayout>

        <ImageView
            android:id="@+id/pp_recording_view_cancel_imageview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:src="@drawable/pp_record_cancel" />

    </FrameLayout>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:gravity="center"
        android:textColor="@android:color/white"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:background="@drawable/pp_chat_recording_view_state_bg"
        android:layout_marginBottom="15dp"
        android:padding="5dp"
        android:text="Large Text"
        android:id="@+id/pp_recording_view_state_description" />

</LinearLayout>


text:
#ifndef _BACKED_BLOCK_H_
#define _BACKED_BLOCK_H_

#include "ext4_utils.h"
#include "output_file.h"

typedef void (*data_block_callback_t)(void *priv, u64 off, u8 *data, int len);
typedef void (*data_block_fill_callback_t)(void *priv, u64 off, u32 fill_val, int len);
typedef void (*data_block_file_callback_t)(void *priv, u64 off,
					   const char *file, off64_t offset,
					   int len);

void queue_data_block(u8 *data, u32 len, u32 block);
void queue_fill_block(u32 fill_val, u32 len, u32 block);
void queue_data_file(const char *filename, off64_t offset, u32 len,
	u32 block);
void for_each_data_block(data_block_callback_t data_func,
	data_block_file_callback_t file_func,
	data_block_fill_callback_t fill_func, void *priv);
void free_data_blocks();

#endif


text:
module E'4'35 where

import E'4'36 ( attempt )

import Test.HUnit

allDifferent :: Integer -> Integer -> Integer -> Bool
allDifferent =  attempt

-- 1: All zero
-- 2: All one
testAllDifferent1  = TestCase ( assertEqual "for: allDifferent 0 0 0" False (allDifferent 0 0 0) )
testAllDifferent2  = TestCase ( assertEqual "for: allDifferent 1 1 1" False (allDifferent 1 1 1) )

-- 3-6: All different and positive (case 1-4/4)
testAllDifferent3  = TestCase ( assertEqual "for: allDifferent 2 3 4" True  (allDifferent 2 3 4) )
testAllDifferent4  = TestCase ( assertEqual "for: allDifferent 3 2 4" True  (allDifferent 3 2 4) )
testAllDifferent5  = TestCase ( assertEqual "for: allDifferent 4 3 2" True  (allDifferent 4 3 2) )
testAllDifferent6  = TestCase ( assertEqual "for: allDifferent 2 4 3" True  (allDifferent 2 4 3) )

-- 7-10: All different and one negative (case 1-4/4)
testAllDifferent7  = TestCase ( assertEqual "for: allDifferent (-2) 4 3" True  (allDifferent (-2) 4 3) )
testAllDifferent8  = TestCase ( assertEqual "for: allDifferent 3 (-2) 4" True  (allDifferent 3 (-2) 4) )
testAllDifferent9  = TestCase ( assertEqual "for: allDifferent 4 3 (-2)" True  (allDifferent 4 3 (-2)) )
testAllDifferent10 = TestCase ( assertEqual "for: allDifferent (-2) 4 3" True  (allDifferent (-2) 4 3) )

-- 11: All equal
testAllDifferent11 = TestCase ( assertEqual "for: allDifferent 2 2 2" False (allDifferent 2 2 2) )

-- 12-14: Two equal (case 1-3/3)
testAllDifferent12 = TestCase ( assertEqual "for: allDifferent 2 2 3" False (allDifferent 2 2 3) )
testAllDifferent13 = TestCase ( assertEqual "for: allDifferent 2 3 2" False (allDifferent 2 3 2) )
testAllDifferent14 = TestCase ( assertEqual "for: allDifferent 3 2 2" False (allDifferent 3 2 2) )

testsAllDifferent

 = TestList
 [
   testAllDifferent1  ,
   testAllDifferent2  ,
   testAllDifferent3  ,
   testAllDifferent4  ,
   testAllDifferent5  ,
   testAllDifferent6  ,
   testAllDifferent7  ,
   testAllDifferent8  ,
   testAllDifferent9  ,
   testAllDifferent10 ,
   testAllDifferent11 ,
   testAllDifferent12 ,
   testAllDifferent13 ,
   testAllDifferent14
 ]

-- GHCi> runTestTT testsAllDifferent


text:
#ifndef _SEC_FSP_H_
#define _SEC_FSPE_H_

#include <PiPei.h>
#include <FspApi.h>
#include <Library/PcdLib.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/SerialPortLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/FspCommonLib.h>
#include <Library/FspSecPlatformLib.h>

#define FSP_MCUD_SIGNATURE  SIGNATURE_32 ('M', 'C', 'U', 'D')
#define FSP_PER0_SIGNATURE  SIGNATURE_32 ('P', 'E', 'R', '0')

/**

  Calculate the FSP IDT gate descriptor.

  @param[in] IdtEntryTemplate     IDT gate descriptor template.

  @return                     FSP specific IDT gate descriptor.

**/
UINT64
FspGetExceptionHandler(
  IN  UINT64  IdtEntryTemplate
  );

/**

  Initialize the FSP global data region.
  It needs to be done as soon as possible after the stack is setup.

  @param[in,out] PeiFspData             Pointer of the FSP global data.
  @param[in]     BootLoaderStack        BootLoader stack.
  @param[in]     ApiIdx                 The index of the FSP API.

**/
VOID
FspGlobalDataInit (
  IN OUT  FSP_GLOBAL_DATA    *PeiFspData,
  IN UINT32                   BootLoaderStack,
  IN UINT8                    ApiIdx
  );

/**

  Adjust the FSP data pointers after the stack is migrated to memory.

  @param[in] OffsetGap             The offset gap between the old stack and the new stack.

**/
VOID
FspDataPointerFixUp (
  IN UINT32   OffsetGap
  );

/**
  This interface returns the base address of FSP binary.

  @return   FSP binary base address.

**/
UINT32
EFIAPI
AsmGetFspBaseAddress (
  VOID
  );

/**
  This interface gets FspInfoHeader pointer

  @return   FSP binary base address.

**/
UINT32
EFIAPI
AsmGetFspInfoHeader (
  VOID
  );

/**
  This function gets the FSP UPD region offset in flash.

  @return the offset of the UPD region.

**/
UINT32
EFIAPI
GetFspUpdRegionOffset (
  VOID
  );

#endif


text:
package org.apache.activemq.artemis.jms.bridge.impl;

import org.apache.activemq.artemis.jms.bridge.ConnectionFactoryFactory;

import java.util.Hashtable;

public class JNDIConnectionFactoryFactory extends JNDIFactorySupport implements ConnectionFactoryFactory {

   public JNDIConnectionFactoryFactory(final Hashtable jndiProperties, final String lookup) {
      super(jndiProperties, lookup);
   }

   @Override
   public Object createConnectionFactory() throws Exception {
      return createObject();
   }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <declare-styleable name="AuroraLoadingView">
        <attr name="alvColor" format="color|reference"/>
        <attr name="alvRadius" format="dimension|reference"/>
        <attr name="alvBorderWidth" format="dimension|reference"/>
    </declare-styleable>
</resources>


text:
This folder contains miscellaneous SASS files. Unlike `"ext-theme-crisp-4cf01f09-de9a-457c-8325-6be5c5701ad5/sass/etc"`, these files
need to be used explicitly.


text:
Logging Guidelines
==================

controller-runtime uses a kind of logging called *structured logging*. If
you've used a library like Zap or logrus before, you'll be familiar with
the concepts we use.  If you've only used a logging library like the "log"
package (in the Go standard library) or "glog" (in Kubernetes), you'll
need to adjust how you think about logging a bit.

### Getting Started With Structured Logging

With structured logging, we associate a *constant* log message with some
variable key-value pairs.  For instance, suppose we wanted to log that we
were starting reconciliation on a pod.  In the Go standard library logger,
we might write:

```go
log.Printf("starting reconciliation for pod %s/%s", podNamespace, podName)
```

In controller-runtime, we'd instead write:

```go
logger.Info("starting reconciliation", "pod", req.NamespacedNamed)
```

or even write

```go
func (r *Reconciler) Reconcile(req reconcile.Request) (reconcile.Response, error) {
    logger := logger.WithValues("pod", req.NamespacedName)
    // do some stuff
    logger.Info("starting reconciliation")
}
```

Notice how we've broken out the information that we want to convey into
a constant message (`"starting reconciliation"`) and some key-value pairs
that convey variable information (`"pod", req.NamespacedName`).  We've
there-by added "structure" to our logs, which makes them easier to save
and search later, as well as correlate with metrics and events.

All of controller-runtime's logging is done via
[logr](https://github.com/go-logr/logr), a generic interface for
structured logging.  You can use whichever logging library you want to
implement the actual mechanics of the logging.  controller-runtime
provides some helpers to make it easy to use
[Zap](https://go.uber.org/zap) as the implementation.

You can configure the logging implementation using
`"sigs.k8s.io/controller-runtime/pkg/log".SetLogger`.  That
package also contains the convenience functions for setting up Zap.

You can get a handle to the the "root" logger using
`"sigs.k8s.io/controller-runtime/pkg/log".Log`, and can then call
`WithName` to create individual named loggers.  You can call `WithName`
repeatedly to chain names together:

```go
logger := log.Log.WithName("controller").WithName("replicaset")
// in reconcile...
logger = logger.WithValues("replicaset", req.NamespacedName)
// later on in reconcile...
logger.Info("doing things with pods", "pod", newPod)
```

As seen above, you can also call `WithValue` to create a new sub-logger
that always attaches some key-value pairs to a logger.

Finally, you can use `V(1)` to mark a particular log line as "debug" logs:

```go
logger.V(1).Info("this is particularly verbose!", "state of the world",
allKubernetesObjectsEverywhere)
```

While it's possible to use higher log levels, it's recommended that you
stick with `V(1)` or V(0)` (which is equivalent to not specifying `V`),
and then filter later based on key-value pairs or messages; different
numbers tend to lose meaning easily over time, and you'll be left
wondering why particular logs lines are at `V(5)` instead of `V(7)`.

## Logging errors

Errors should *always* be logged with `log.Error`, which allows logr
implementations to provide special handling of errors (for instance,
providing stack traces in debug mode).

It's acceptable to log call `log.Error` with a nil error object.  This
conveys that an error occurred in some capacity, but that no actual
`error` object was involved.

Errors returned by the `Reconcile` implementation of the `Reconciler` interface are commonly logged as a `Reconciler error`.
It's a developer choice to create an additional error log in the `Reconcile` implementation so a more specific file name and line for the error are returned.

## Logging messages

- Don't put variable content in your messages -- use key-value pairs for
  that. Never use `fmt.Sprintf` in your message.

- Try to match the terminology in your messages with your key-value pairs
  -- for instance, if you have a key-value pairs `api version`, use the
  term `APIVersion` instead of `GroupVersion` in your message.

## Logging Kubernetes Objects

Kubernetes objects should be logged directly, like `log.Info("this is
a Kubernetes object", "pod", somePod)`.  controller-runtime provides
a special encoder for Zap that will transform Kubernetes objects into
`name, namespace, apiVersion, kind` objects, when available and not in
development mode.  Other logr implementations should implement similar
logic.

## Logging Structured Values (Key-Value pairs)

- Use lower-case, space separated keys.  For example `object` for objects,
  `api version` for `APIVersion`

- Be consistent across your application, and with controller-runtime when
  possible.

- Try to be brief but descriptive.

- Match terminology in keys with terminology in the message.

- Be careful logging non-Kubernetes objects verbatim if they're very
  large.

### Groups, Versions, and Kinds

- Kinds should not be logged alone (they're meaningless alone).  Use
  a `GroupKind` object to log them instead, or a `GroupVersionKind` when
  version is relevant.

- If you need to log an API version string, use `api version` as the key
  (formatted as with a `GroupVersion`, or as received directly from API
  discovery).

### Objects and Types

- If code works with a generic Kubernetes `runtime.Object`, use the
  `object` key.  For specific objects, prefer the resource name as the key
  (e.g. `pod` for `v1.Pod` objects).

- For non-Kubernetes objects, the `object` key may also be used, if you
  accept a generic interface.

- When logging a raw type, log it using the `type` key, with a value of
  `fmt.Sprintf("%T", typ)`

- If there's specific context around a type, the key may be more specific,
  but should end with `type` -- for instance, `OwnerType` should be logged
  as `owner` in the context of `log.Error(err, "Could not get ObjectKinds
  for OwnerType", `owner type`, fmt.Sprintf("%T"))`.  When possible, favor
  communicating kind instead.

### Multiple things

- When logging multiple things, simply pluralize the key.

### controller-runtime Specifics

- Reconcile requests should be logged as `request`, although normal code
  should favor logging the key.

- Reconcile keys should be logged as with the same key as if you were
  logging the object directly (e.g. `log.Info("reconciling pod", "pod",
  req.NamespacedName)`).  This ends up having a similar effect to logging
  the object directly.


text:
<?php

namespace Anna\MusiqueBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class ChansonController extends Controller {

    public function listAction() {
        $repository = $this->getDoctrine()->getRepository('AnnaMusiqueBundle:Chansons');
        $chansons = $repository->findAll();

       //iterer chaque objet, transformer dureeChanson avec gmdate("i:s", 685);
       foreach($chansons as $chanson){
           $dureeChanson = gmdate("i:s", $chanson->getDureeChanson());
           $chanson->setDureeChanson($dureeChanson);
       }
        return $this->render('AnnaMusiqueBundle:Chanson:list.html.twig', array(
                    'chansons' => $chansons
        ));
    }

    public function addAction() {
        return $this->render('AnnaMusiqueBundle:Chanson:add.html.twig', array(
                        // ...
        ));
    }

    public function uploadAction() {
        return $this->render('AnnaMusiqueBundle:Chanson:upload.html.twig', array(
                        // ...
        ));
    }

    public function modifyAction(\Anna\MusiqueBundle\Entity\Chansons $chanson, \Symfony\Component\HttpFoundation\Request $req) {
        $form = $this->createForm(new \Anna\MusiqueBundle\Form\ChansonsType, $chanson);

        if ($req->getMethod() === 'POST') {
            $form->handleRequest($req);

            if ($form->isValid()) {
                $entityManager = $this->getDoctrine()->getManager();
                $entityManager->persist($chanson);
                $entityManager->flush();

                return $this->redirectToRoute('anna_musique_bundle_chanson_list');
            }
        }
        return $this->render('AnnaMusiqueBundle:Chanson:modify.html.twig', array(
                        'chansonForm' => $form->createView()
        ));
    }

    public function deleteAction() {
        return $this->render('AnnaMusiqueBundle:Chanson:delete.html.twig', array(
                        // ...
        ));
    }

}


text:
import asyncio

import pytest
import rethinkdb as r

import aiorethink as ar

###############################################################################
# Field and FieldAlias in isolation (i.e. not as class attribute in a
# FieldContainer)
###############################################################################

def test_basic_field():
    f = ar.Field()

    assert isinstance(f.val_type, ar.AnyValueType)

    assert f.name == None
    assert f.dbname == None # this is never the case when the field is inside a FieldContainer
    f.name = "f" # because this is done by FieldContainer
    assert f.name == "f"
    assert f.dbname == "f"

    assert not f.indexed
    assert not f.required
    assert not f.primary_key
    assert f.default == None

    assert f.validate(None) == f
    assert f.validate(1) == f
    assert f.validate("hello") == f

def test_field_with_type():
    f = ar.Field(ar.IntValueType())

    assert f.validate(1) == f
    with pytest.raises(ar.ValidationError):
        f.validate("hello")

def test_field_with_type_and_default():
    with pytest.raises(ar.IllegalSpecError):
        f = ar.Field(ar.IntValueType(), default = "hello")

    f = ar.Field(ar.StringValueType(), default = "hello")

def test_field_properties():
    f = ar.Field(default = "hello")
    assert f.default == "hello"

    f = ar.Field(indexed = True)
    assert f.indexed == True

    f = ar.Field(required = True)
    with pytest.raises(ar.ValidationError):
        f.validate(None)
    assert f.validate(10) == f

    f = ar.Field(primary_key = True)
    assert f.primary_key == True

    with pytest.raises(ar.IllegalSpecError):
        f = ar.Field(indexed = True, primary_key = True)

    f = ar.Field(name = "dbf")
    assert f.dbname == "dbf"
    f.name = "f" # this is what FieldContainer does
    assert f.name == "f"
    assert f.dbname == "dbf"

def test_repr():
    f = ar.Field()
    assert "dbname" in repr(f)

def test_fieldalias():
    f = ar.Field(ar.IntValueType())
    f.name = "f"
    fa = ar.FieldAlias(f)

    for attr in ["name", "dbname", "indexed", "required", "default", "validate"]:
        assert getattr(fa, attr) == getattr(f, attr)

    assert "fld_name=f" in repr(fa)

###############################################################################
# Field and FieldAlias inside FieldContainer
###############################################################################

def test_simple_field_inside_container():
    class FC(ar.FieldContainer):
        f = ar.Field()
        fa = ar.FieldAlias(f)

    assert FC.f.name == "f"
    assert FC.fa.name == "f"

def test_simple_get_set_delete():
    class FC(ar.FieldContainer):
        f1 = ar.Field()
        f1a = ar.FieldAlias(f1)
    fc = FC()

    assert fc.f1 == None
    assert fc.f1a == None
    fc.f1 = 1
    assert fc.f1 == 1
    assert fc.f1a == 1
    fc.f1a = 2
    assert fc.f1 == 2
    assert fc.f1a == 2
    del fc.f1
    assert fc.f1 == None
    assert fc.f1a == None
    del fc.f1a
    assert fc.f1 == None
    assert fc.f1a == None
    fc.f1a = 1
    assert fc.f1 == 1
    assert fc.f1a == 1
    del fc.f1a
    assert fc.f1 == None
    assert fc.f1a == None

def test_default_value():
    class FC(ar.FieldContainer):
        f = ar.Field(default = 10)
    fc = FC()

    assert fc.f == 10
    fc.f = 1
    assert fc.f == 1
    del fc.f
    assert fc.f == 10
    del fc.f
    assert fc.f == 10

def test_field_to_doc():
    class FC(ar.FieldContainer):
        f1 = ar.Field()
    fc = FC()

    e = fc.to_doc()
    assert e["f1"] == None

    fc.f1 = 1
    e = fc.to_doc()
    assert e["f1"] == 1

def test_field_from_doc():
    class FC(ar.FieldContainer):
        f1 = ar.Field()

    doc = { "f1": "hello" }
    fc = FC.from_doc(doc)

    assert fc.f1 == "hello"


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Lidgren.Network;

namespace NetworkingMessages.Messages
{
    public class NetworkMessage
    {
        public static readonly NetworkMessage Empty = new NetworkMessage();

        public virtual bool CustomPack() { return false; }
        public virtual NetOutgoingMessage Pack(NetOutgoingMessage msg) { return null;}
        public virtual void Unpack(NetIncomingMessage msg) {}
    }

    public class SerializedNetworkMessage : NetworkMessage
    {
        public override bool CustomPack() { return false; }
    }

    public class CustomPackedNetworkMessage : NetworkMessage
    {
        public override bool CustomPack() { return true; }
    }
}


text:
var ngMongoModule = angular.module('ngMongo', []);

// gives access to sockets.io and routting of returned responces/updates
// should be configuered to set url for the
ngMongoModule.provider('$SocketsIo', [function () {
    var me = {connected:false, url : 'http://localhost'};
    var defer;
    me.$q = {};

    this.url = function(newUrl){                                                              //set the socket.io client script url
        if(newUrl) me.url = newUrl;
        return me.url ;
    };

    me.qList = {};   //the obj for linking responces to requests

    me.rIdGen = function () { return Math.random().toString() + Math.random().toString(); };  // Quick guid thats not a real guid, they take too long to create

    me.isFunction = function (functionToCheck) {
        var getType = {};
        return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
    }

    var routing = function(){

        me.socket.on('publicFunctionReturn', function (data) {
            if (me.qList[data.dataSend.requestId] && me.qList[data.dataSend.requestId].publicFunctionReturn) {
                me.qList[data.dataSend.requestId].publicFunctionReturn(data.err, data.dataReturned, data.dataSent);
            }
        });
        me.socket.on('findReturn', function (data) {
            if (me.qList[data.dataSend.requestId] && me.qList[data.dataSend.requestId].findReturn) {
                me.qList[data.dataSend.requestId].findReturn(data.err, data.docs, data.dataSend);
            }
        });
        me.socket.on('findUpdate', function (data) {
            if (me.qList[data.dataSend.requestId] && me.qList[data.dataSend.requestId].findUpdate) {
                me.qList[data.dataSend.requestId].findUpdate(data.err, data.docs, data.dataSend);
            }
        });
        me.socket.on('pReturn', function (data) {
            if (me.qList[data.dataSend.requestId] && me.qList[data.dataSend.requestId].pReturn) {
                me.qList[data.dataSend.requestId].pReturn(data.err, data.data, data.dataSend);
            }
        });
        me.socket.on('findMoreReturn', function (data) {
            if (me.qList[data.dataSend.requestId] && me.qList[data.dataSend.requestId].findMoreReturn) {
                me.qList[data.dataSend.requestId].findMoreReturn(data.err, data.docs, data.dataSend);
            }
        });
        me.socket.on('progressReturn', function (data) {
            if (me.qList[data.dataSend.requestId] && me.qList[data.dataSend.requestId].progressReturn) {
                me.qList[data.dataSend.requestId].progressReturn(data.progress, data.dataSent);
            }
        });
        me.socket.on('countReturn', function (data) {
            if (me.qList[data.dataSend.requestId] && me.qList[data.dataSend.requestId].countReturn) {
                me.qList[data.dataSend.requestId].countReturn(data.count, data.dataSent);
            }
        });
        me.socket.on('totalsReturn', function (data) {
            if (me.qList[data.dataSend.requestId] && me.qList[data.dataSend.requestId].totalsReturn) {
                me.qList[data.dataSend.requestId].totalsReturn(data.totals,data.dataSent);
            }
        });
        me.socket.on('saveReturn', function (data) {
            if (me.qList[data.dataSend.requestId] && me.qList[data.dataSend.requestId].saveReturn) {
                me.qList[data.dataSend.requestId].saveReturn(data.savedDoc, data.dataSent);
            }
        });
        me.socket.on('deleteReturn', function (data) {
            if (me.qList[data.dataSend.requestId] && me.qList[data.dataSend.requestId].deleteReturn) {
                me.qList[data.dataSend.requestId].deleteReturn(data.dataSent);
            }
        });

        if(defer && defer.resolve) defer.resolve();
    };

    me.connect = function () {                                                                // called once if needed, handels respnce routing, may move to on('connect')

        if (me.connected == true) {

            return defer.promise;
        }

        defer = me.$q.defer();
        me.socket = io.connect(me.url);
        me.connected = true;
        me.socket.on('connect',routing);
        me.socket.on('reconnect',routing);

        return defer.promise;
    }

    this.$get = function ($q) {
            me.$q = $q;
        return me;
    }

}]);

// gives mongo like syntax to subscribe to mongo queries
ngMongoModule.service('$mongo', ['$SocketsIo', '$timeout', '$server', '$q', function ($SocketsIo, $timeout, $server, $q) {
    this.query = function (collection) {
        if ($SocketsIo.connected == false) $SocketsIo.connect();                                                          // connect via io if not
        var arrayResutls = [],          // main object returned by everything
        count = 0,                      // expected length
        find,                           // the where statment
        progress = 1,                   // 0-1 % conplete **only works for simple queries**
        hasBeenCalled = false,          // is this query active, has toArray been called
        totalsSkipLimits = true,        // if using the totals grouping should they be for just the results returned or if the skip & limit are removed
        totalsObj = {},                 // returned totals obj
        totals,                         // a $group satment for the totals
        totalsCalculatingDefault = 'Calculating...', // what to show before the totals are returned
        projection,                     // $project satment
        limit ,                         // $limit #
        sort ,                          // $sort satment
        group ,                         // $group satment
        aggregate ,                     // $aggregate [satments]
        progressCallBack,               // function on an progress  **only works for simple queries**
        progressInc = .25,              // how offten do you get an update **only works for simple queries**
        localVars = {},                 // a dictionary of
        newAtEnd = false,               // can be false or a new doc obj
        rid = $SocketsIo.rIdGen(),      // give this query a "guid"
        newDoc = doc,                   // the template doc applied to each item in the returned array
        afterUpdate,                    // a functions called after each update
        then,                           // a functions called after first return
        db,                             // default or first db by default but can be changed
        fullItemKey,                    // for aggregate/group making subItems saveable
        newAtStart,                     // same as new at end but at start
        defer,                          // prommise
        number = 0,
        pNumber = 0,
        indexOf = {};

        // removes all routing back to this query
        function clearQList() { if ($SocketsIo.qList[rid]) { delete $SocketsIo.qList[rid]; }; };

        // makes the query request back to the server
        arrayResutls.$toArray = function (toArrayCallBack) {
            if(toArrayCallBack) afterUpdate = toArrayCallBack;
            arrayResutls.$cancel();                                          // stops updates for an old query for this obj if there is any
            rid = $SocketsIo.rIdGen();
            progress = 0;                                                    // build request
            var data = { collection: collection, requestId: rid, find: find, progress: progressInc, newAtEnd: newAtEnd, newAtStart: newAtStart, length:1000, more: false, totalsSkipLimits: totalsSkipLimits }
            if(limit) {
                data.limit = limit;
                data.length = arrayResutls.length + limit;
            }
            if(sort) data.sort = sort;
            if(aggregate) data.aggregate = aggregate;
            if(group) data.group = group;
            if(totals) data.totals = totals;
            if(projection) data.projection = projection;
            if(db) data.db = db;
            data.number = number;
            hasBeenCalled = true;
            $SocketsIo.socket.emit('find', data);                          // make request

            $SocketsIo.qList[rid] = {                                      // setup routing
                findReturn: function (err, docs, sentData) {
                    if(!err && number <= sentData.number){
                        number = sentData.number || 0;
                        pNumber = sentData.pNumber || 0;
                        $timeout(function () {
                            progress = 1;
                            arrayResutls.$clear();

                            for (var i = 0; i < docs.length; i++) {
                                var docId = "";
                                if(docs[i]._id) docId = docs[i]._id.toString();
                                if(indexOf[docId]) arrayResutls.splice(indexOf[docId], 1);
                                if (!localVars[docId]) localVars[docId] = {};
                                if ((group || aggregate) && fullItemKey){
                                    if (!localVars[docId][fullItemKey]) localVars[docId][fullItemKey] = {};
                                    for(var j in docs[i][fullItemKey]){
                                        if(!localVars[docId][fullItemKey][docs[i][fullItemKey][j]._id.toString()]) localVars[docId][fullItemKey][docs[i][fullItemKey][j]._id.toString()] = {};
                                        docs[i][fullItemKey][j] = newDoc(docs[i][fullItemKey][j], collection, localVars[docId][fullItemKey][docs[i][fullItemKey][j]._id.toString()], arrayResutls)
                                    }
                                    arrayResutls.push(docs[i]);
                                    indexOf[docId] = (arrayResutls.length - 1);
                                }
                                else {
                                    if(indexOf[docs[i]._id.toString()]) arrayResutls.splice(indexOf[docs[i]._id.toString()], 1);
                                    arrayResutls.push(newDoc(docs[i], collection, localVars[docId],arrayResutls));
                                    indexOf[docs[i]._id.toString()] = (arrayResutls.length - 1);
                                }
                            }
                            if(then != null) then();
                            then = null;
                            if(afterUpdate != null) afterUpdate();
                            if(defer) defer.resolve(arrayResutls);
                            $timeout(function(){
                                scanObj(arrayResutls);
                            },1);
                        });
                    }
                    else{
                        console.log(err);
                    }

                }, countReturn: function (countQ) {
                    $timeout(function () {
                        count = countQ;
                    });
                },
                progressReturn: function (progressQ, sentData) {
                    $timeout(function () {
                        if (progress < 1) {
                            progress = progressQ;
                            if ($SocketsIo.isFunction(progressCallBack)) {
                                progressCallBack(progress);
                            }
                        }
                    });
                },
                findUpdate: function (err, docs, sentData) {
                    if(!err && number <= sentData.number){
                        number = sentData.number || 0;
                        pNumber = sentData.pNumber || 0;
                         $timeout(function () {
                            progress = 1;
                            arrayResutls.$clear();
                                for (var i = 0; i < docs.length; i++) {
                                    var docId = "";
                                    if(docs[i]._id) docId = docs[i]._id.toString();
                                    if(indexOf[docId]) arrayResutls.splice(indexOf[docId], 1);
                                    if (!localVars[docId]) localVars[docId] = {};
                                    if ((group || aggregate) && fullItemKey){
                                        if (!localVars[docId][fullItemKey]) localVars[docId][fullItemKey] = {};
                                        for(var j in docs[i][fullItemKey]){
                                            if(!localVars[docId][fullItemKey][docs[i][fullItemKey][j]._id.toString()]) localVars[docId][fullItemKey][docs[i][fullItemKey][j]._id.toString()] = {};
                                            docs[i][fullItemKey][j] = newDoc(docs[i][fullItemKey][j], collection, localVars[docId][fullItemKey][docs[i][fullItemKey][j]._id.toString()],arrayResutls)
                                        }
                                        arrayResutls.push(docs[i]);
                                        indexOf[docId] = (arrayResutls.length - 1);
                                    }
                                    else {
                                        if(indexOf[docs[i]._id.toString()]) arrayResutls.splice(indexOf[docs[i]._id.toString()], 1);
                                        arrayResutls.push(newDoc(docs[i], collection, localVars[docId],arrayResutls));
                                        indexOf[docs[i]._id.toString()] = (arrayResutls.length - 1);
                                    }
                                }
                            if(afterUpdate != null) afterUpdate();
                            $timeout(function(){
                                scanObj(arrayResutls);
                            },1);
                        });
                    }

                },
                totalsReturn:function(totals,sentData){
                    $timeout(function(){
                        totalsObj.results = totals;
                    });
                },
                pReturn: function (err,data, sentData) {
                    if(!err && number <= sentData.number && pNumber <= sentData.pNumber){
                        number = sentData.number || 0;
                        pNumber = sentData.pNumber || 0;
                        $timeout(function () {
                            for (var i = 0; i < arrayResutls.length; i++) {
                                if(data.docId == arrayResutls[i]._id){
                                    if(data.update){
                                        for(var j in data.update.$unset){
                                            delete arrayResutls[i][j];
                                            delete arrayResutls[i].localVar.$oldDoc[j];
                                        }
                                        for(var j in data.update.$set){
                                            arrayResutls[i][j] = data.update.$set[j];
                                            arrayResutls[i].localVar.$oldDoc[j] = data.update.$set[j];
                                        }
                                    }
                                    break;break;
                                    return true;
                                }
                            }
                        if(afterUpdate != null) afterUpdate();
                        $timeout(function(){
                            scanObj(arrayResutls);
                        },1);
                        });
                    }
                }
            };

            return arrayResutls;
        };

        arrayResutls.$db = function (dbQ) {
                db = dbQ;
                arrayResutls.db = db;
            if(hasBeenCalled) this.$toArray();
            return this;
        };

        arrayResutls.$find = function (findQ) {
            find = findQ;
            if(hasBeenCalled) this.$toArray();
            return this;
        };

        arrayResutls.$aggregate = function (aggregateQ,fullItemKeyQ) {
            aggregate = aggregateQ;
            if(fullItemKeyQ) fullItemKey = fullItemKeyQ;
            if(hasBeenCalled) this.$toArray();
            return this;
        };

        arrayResutls.$group = function (groupQ,fullItemKeyQ) {
            group = groupQ;
            if(fullItemKeyQ) fullItemKey = fullItemKeyQ;
            if(hasBeenCalled) this.$toArray();
            return this;
        };

        arrayResutls.$projection = function (projectionQ) {
            projection = projectionQ;
            if(hasBeenCalled) this.$toArray();
            return this;
        };

        arrayResutls.$totalsCalculatingDefault = function (totalsCalculatingDefaultQ) {
            totalsCalculatingDefault = totalsCalculatingDefaultQ;
            if(totalsObj.results) totalsObj.results = {};
            if(!hasBeenCalled){
                for(var i in totals){
                    totalsObj.results[i] = totalsCalculatingDefault;
                }
            }
            return totalsObj;
        };

        arrayResutls.$totals = function (totalsQ) {
            totals = totalsQ;
            if(!totalsObj.results) totalsObj.results = {};
            if(isEmpty(totalsObj.results)){
                for(var i in totals){
                    totalsObj.results[i] = totalsCalculatingDefault; //'Calculating...';
                }
            }
            if(hasBeenCalled) this.$toArray();
            return totalsObj;
        };

        arrayResutls.$totalsSkipLimits = function (totalsSkipLimitsQ) {
            totalsSkipLimits = totalsSkipLimitsQ;
            if(hasBeenCalled) this.$toArray();
            return this;
        };

        arrayResutls.$doc = function (docQ) {
            newDoc = docQ;
            return this;
        };

        arrayResutls.$deleteDoc = function (docQ, callBack) {
            $SocketsIo.socket.emit('deleteDoc', { collection: collection, requestId: rid, docId: docQ._id });
            return this;
        };

        arrayResutls.$cancel = function () {
            clearQList();
            $SocketsIo.socket.emit('cancel', { collection: collection, requestId: rid });
            rid = $SocketsIo.rIdGen();
        };
        arrayResutls._rid = function () { return rid;}
        arrayResutls.$clear = function () { arrayResutls.splice(0, arrayResutls.length); indexOf = {}; return this; };

        arrayResutls.$count = function () { return count; };

        arrayResutls.$saveAll = function (updateMe) {
            for (var i in arrayResutls) {
                if (arrayResutls[i] && arrayResutls[i].$save) arrayResutls[i].$save(updateMe);
            }
            return arrayResutls;
        };

        arrayResutls.$afterUpdate = function (afterUpdateQ) {
            afterUpdate = afterUpdateQ;
            if(arrayResutls.length > 0 || hasBeenCalled) afterUpdate();
            return arrayResutls;
        };

        arrayResutls.$then = function (thenQ) {
            then = thenQ;
            if(arrayResutls.length > 0 || hasBeenCalled) then();
            return arrayResutls;
        };

        arrayResutls.$progress = function (progressIncQ, callBack) {
            if (progressIncQ) {
                progressInc = progressIncQ;
                if (callBack) progressCallBack = callBack;
                return this;
            }
            return progress;
        }

        arrayResutls.$inProgress = function () { return progress < 1; }

        arrayResutls.$limit = function (limitQ) {
            if (limitQ) {
                limit = limitQ;
                if(hasBeenCalled) this.$toArray();
                return this;
            }
            return limit;
        }

        arrayResutls.$sort = function (sortQ) {
            if (sortQ) {
                sort = sortQ;
                if(hasBeenCalled) this.$toArray();
                return this;
            }
            return limit;
        }

        function checkDate (obj, key){
            if(obj[key].match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/i)) obj[key] = new Date(obj[key]);
        }

        function scanObj(obj){
            for(var i in obj){
                if((angular.isArray(obj[i]) || angular.isObject(obj[i])) && !angular.isDate(obj[i])) scanObj(obj[i]);
                else if(angular.isString(obj[i])) checkDate(obj, i);
            }
        }

        arrayResutls.$more = function (moreQ) {
            if(progress < 1){
                return this;
            }
            if(moreQ) limit = moreQ;
            progress = 0;

            var data = { collection: collection, requestId: rid, find: find, progress: progressInc, newAtEnd: newAtEnd, length:1000, more: true, totalsSkipLimits: totalsSkipLimits }
            if(newAtEnd){ data.skip = (arrayResutls.length -1);}
            else{data.skip = arrayResutls.length;}
            if(limit) {
                data.limit = limit;
                data.length = arrayResutls.length + limit;
            }
            if(sort) data.sort = sort;
            if(aggregate) data.aggregate = aggregate;
            if(group) data.group = group;
            if(totals) data.totals = totals;
            if(projection) data.projection = projection;
            if(db) data.db = db;
            data.number = number;
            $SocketsIo.socket.emit('find', data);
            if(!$SocketsIo.qList[rid]) return arrayResutls;
            $SocketsIo.qList[rid].findMoreReturn = function (err, docs, sentData) {
                    if(!err && number <= sentData.number){
                        number = sentData.number || 0;
                        pNumber = sentData.pNumber || 0;
                        $timeout(function () {
                            progress = 1;
                            for (var i = 0; i < arrayResutls.length; i++) {
                                if(arrayResutls[i]._id) indexOf[arrayResutls[i]._id.toString()] = arrayResutls.indexOf(arrayResutls[i]);
                            }
                            for (var i = 0; i < docs.length; i++) {
                                var docId = "";
                                if(docs[i]._id) docId = docs[i]._id.toString();
                                if(indexOf[docId]) arrayResutls.splice(indexOf[docId], 1);
                                if (!localVars[docId]) localVars[docId] = {};
                                if ((group || aggregate) && fullItemKey){
                                    if (!localVars[docId][fullItemKey]) localVars[docId][fullItemKey] = {};
                                    for(var j in docs[i][fullItemKey]){
                                        if(!localVars[docId][fullItemKey][docs[i][fullItemKey][j]._id.toString()]) localVars[docId][fullItemKey][docs[i][fullItemKey][j]._id.toString()] = {};
                                        docs[i][fullItemKey][j] = newDoc(docs[i][fullItemKey][j], collection, localVars[docId][fullItemKey][docs[i][fullItemKey][j]._id.toString()], arrayResutls)
                                    }
                                    arrayResutls.push(docs[i]);
                                    indexOf[docId] = arrayResutls.indexOf(docs[i]);
                                }
                                else {
                                    if(indexOf[docs[i]._id.toString()]) arrayResutls.splice(indexOf[docs[i]._id.toString()], 1);
                                    arrayResutls.push(newDoc(docs[i], collection, localVars[docId],arrayResutls));
                                    indexOf[docs[i]._id.toString()] = arrayResutls.indexOf(docs[i]);
                                }
                            }
                            if(afterUpdate != null) afterUpdate();
                            if(defer) defer.resolve(arrayResutls);
                            $timeout(function(){
                                scanObj(arrayResutls);
                            },1);
                        });
                    }
                };

            return this;
        };

        arrayResutls.$newAtEnd = function (newAtEndQ) {
            newAtEnd = newAtEndQ;
            if(hasBeenCalled) this.$toArray();
            return this;
        };

        arrayResutls.$newAtStart = function (newAtStartQ) {
            newAtStart = newAtStartQ;
            if(hasBeenCalled) this.$toArray();
            return this;
        };

        arrayResutls.$q = function () {
            defer = $q.defer();
            if(!(progress < 1)) {
                $timeout(function () {
                    defer.resolve(arrayResutls);
                })
            }
            return defer.promise;
        };

        return arrayResutls;
    }

    this.doc = doc;                             //expose base doc

    // the base doc for every item
    // theDoc = item obj returned from server,
    // collection = collection name as string,
    // localVar = an object with anything not saved back to the database,
    // parentQuery = the parent array
    function doc(theDoc, collection, localVar, parentQuery) {
        var rid = $SocketsIo.rIdGen(), inProgress = false;

        theDoc.localVar = localVar;
        if (!theDoc.localVar) theDoc.localVar = {};

        theDoc.localVar.$oldDoc = strippedDoc();             // save origenal obj for comparisen latter

        // removes data not be saved back to the database
        function strippedDoc(docObj) {
            if (!docObj) docObj = theDoc;
            var doc = {}, dumDoc = {};
            for (var i in docObj) {
                if (['localVar'].indexOf(i) == -1 && i.indexOf('$') == -1) {
                    dumDoc[i] = docObj[i];
                }
            }
            angular.copy(dumDoc, doc);
            return doc;
        };

        theDoc.$strippedDoc = strippedDoc;

        function clearQList() { if ($SocketsIo.qList[rid]) { delete $SocketsIo.qList[rid]; }; };

        var sdefer;
        theDoc.$save = function (updateMe,timeout,max,p) {
            sdefer = $q.defer();
            if(timeout){
                if(!max) max = 3;
                if(theDoc.localVar.saveTimer)  $timeout.cancel(theDoc.localVar.saveTimer);
                if(theDoc.localVar.saveInt ==  null) theDoc.localVar.saveInt = 0;
                theDoc.localVar.saveInt += 1;
                if(theDoc.localVar.saveInt > max){
                    theDoc.localVar.saveInt = 0;
                    save(updateMe);
                }
                else{
                    theDoc.localVar.saveTimer = $timeout(function(){
                        save(updateMe);
                        theDoc.localVar.saveInt = 0;
                    },timeout)
                }
            }
            else{
                save(updateMe);
            }
            function save(updateMe){
                theDoc.$cancelSave();
                rid = $SocketsIo.rIdGen();
                inProgress = true;
                    var data = { collection: collection, requestId: rid, doc: deepMatch(strippedDoc(), strippedDoc(theDoc.localVar.$oldDoc)) };
                    if (parentQuery && parentQuery.db) data.db = parentQuery.db;
                if (theDoc.$isNew == true) {
                    data.doc = deepMatch(strippedDoc(), { _id: theDoc._id });
                    data.$isNew = true;
                }

                if (data.doc.change && Object.keys(data.doc.change).length > 0) {
                    if (updateMe) data.updateMe = updateMe;
                    if (p) data.p = p;
                    if(parentQuery && parentQuery._rid()) data.partentRequestId = parentQuery._rid();
                    $SocketsIo.socket.emit('save', data);
                    theDoc.localVar.$oldDoc = strippedDoc();
                    $SocketsIo.qList[rid] = {
                        saveReturn: function (savedDoc) {
                            $timeout(function () {
                                inProgress = false;
                                sdefer.resolve();
                            });
                        }

                    }
                }

            }

            return sdefer.promise;;
        };

        theDoc.$delete = function (updateMe) {

            rid = $SocketsIo.rIdGen();
            inProgress = true;
            var data = { collection: collection, requestId: rid, docId:theDoc._id };
            if (updateMe) data.updateMe = updateMe;
            $SocketsIo.socket.emit('deleteDoc', data);
            $SocketsIo.qList[rid] = {
                saveReturn: function (savedDoc) {
                    $timeout(function () {
                        inProgress = false;
                    });
                }
            }

        };

        theDoc.$cancelSave = function () {
            $SocketsIo.socket.emit('cancelSave', {requestId:rid});
            clearQList();
            return this;
        };

        theDoc.$deepMatch = deepMatch;
        // compares two objects and returns a dictionaly for files with old new and save statment
        function deepMatch(odj1, odj2) {
            var returnObj = {
                _id: odj1._id,
                change: {},
                save: {}
            };
            for (var i in odj1) {
                if (odj2[i] == undefined) {
                    returnObj.change[i] = { 'new': odj1[i], type: 'create' };
                    if (!returnObj.save.$set) returnObj.save.$set = {};
                    returnObj.save.$set[i] = odj1[i];
                }
                else if (angular.equals(odj1[i], odj2[i]) == false) {
                    returnObj.change[i] = { old: odj2[i], 'new': odj1[i], type: 'update' };
                    if (!returnObj.save.$set) returnObj.save.$set = {};
                    returnObj.save.$set[i] = odj1[i];
                }
            }
            for (var i in odj2) {
                if (odj1[i] == undefined) {
                    returnObj.change[i] = { old: odj2[i], type: 'delete' };
                    if (!returnObj.save.$unset) returnObj.save.$unset = {};
                    returnObj.save.$unset[i] = "";
                }
            }

            return returnObj;
        }

        return theDoc;
    }

    function isEmpty(obj) {
        if (obj == null) return true;
        if (obj.length > 0)    return false;
        if (obj.length === 0)  return true;
        for (var key in obj) {
            if (hasOwnProperty.call(obj, key)) return false;
        }
        return true;
    }
}]);

// gives access to pubilc server functions via promisses
ngMongoModule.service('$server', ['$SocketsIo', '$timeout', '$q', function ($SocketsIo, $timeout, $q) {
    this.functions = function (functionName, data) {
        var defer = $q.defer();
        var rid = $SocketsIo.rIdGen();
        $SocketsIo.connect().then( function(){
            $SocketsIo.socket.emit('publicFunction', { functionName: functionName, requestId: rid, data:data });
        })
        $SocketsIo.qList[rid] = {
            publicFunctionReturn: function (err, data, sentData) {

                if ($SocketsIo.qList[rid]) { delete $SocketsIo.qList[rid]; };
                if(err) defer.reject(data);
                defer.resolve(data);

            }
        }
        return defer.promise;
    };
}]);


text:
.multiselect-container {
    position: absolute;
    list-style-type: none;
    margin: 0;
    padding: 0
}

.multiselect-container .input-group {
    margin: 5px
}

.multiselect-container > li {
    padding: 0
}

.multiselect-container > li > a.multiselect-all label {
    font-weight: 700
}

.multiselect-container > li.multiselect-group label {
    margin: 0;
    padding: 3px 20px 3px 20px;
    height: 100%;
    font-weight: 700
}

.multiselect-container > li.multiselect-group-clickable label {
    cursor: pointer
}

.multiselect-container > li > a {
    padding: 0
}

.multiselect-container > li > a > label {
    margin: 0;
    height: 100%;
    cursor: pointer;
    font-weight: 400;
    padding: 3px 20px 3px 40px
}

.multiselect-container > li > a > label.radio, .multiselect-container > li > a > label.checkbox {
    margin: 0
}

.multiselect-container > li > a > label > input[type=checkbox] {
    margin-bottom: 5px
}

.btn-group > .btn-group:nth-child(2) > .multiselect.btn {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px
}

.form-inline .multiselect-container label.checkbox, .form-inline .multiselect-container label.radio {
    padding: 3px 20px 3px 40px
}

.form-inline .multiselect-container li a label.checkbox input[type=checkbox], .form-inline .multiselect-container li a label.radio input[type=radio] {
    margin-left: -20px;
    margin-right: 0
}


text:
class CreateRatings < ActiveRecord::Migration
  def self.up
    create_table :ratings do |t|

      # The actual rating value.
      # This is an integer for individual ratings
      #
      t.integer :rating, :null => false

      # Polymorphic association with rateable
      #
      t.references :rateable, :polymorphic => true

      # User association
      #
      t.references :user

      # We don't need updated_at here,
      # so we use this instead of t.timestamps
      #
      t.datetime :created_at

    end

    add_index :ratings, [:rateable_type, :rateable_id, :user_id]
  end

  def self.down
    drop_table :ratings
  end
end


text:
class ImageFileManager
{
public:
   /// ctor
   ImageFileManager(AppSettings& settings);

   /// returns next filename for given image type
   CString NextFilename(T_enImageType enImageType, bool bStartNewSeries = false);

   /// returns next filename for image type and given date
   CString NextFilename(T_enImageType enImageType, time_t time, bool bStartNewSeries = false);

private:
   /// adds date to path
   void AddDate(CString& cszPath, time_t time);

   /// adds image type path
   void AddImageTypePath(CString& cszPath, T_enImageType enImageType, bool bStartNewSeries);

   /// formats numbered image path
   void FormatNumberedImagePath(const CString& cszPath, CString& cszSubfolder, bool bStartNewSeries);

   /// finds last used filename image index
   void FindLastUsedFilename();

private:
   /// app settings (copy)
   AppSettings m_settings;

   /// next image index
   unsigned int m_uiNextImageIndex;
};


text:
require 'test_helper'
require 'capybara/rails'

class UserControllerTest < ActionController::TestCase
  test "should get show" do
  	get :show
  	assert_response :success
  end

  test "should get edit" do
  	get :edit
  	assert_response :success
  end

end


text:
"""
"""
from django.conf.urls.defaults import *

from classifieds.views import AdEditView, AdCreationEditView
from classifieds.views.manage import AdDeleteView

# nested urls
base_urlpatterns = patterns('classifieds.views',
    url(r'^$', 'browse.category_overview',
        name='classifieds_browse_categories'),

    url(r'^post/$', 'create.first_post', name='classifieds_create_ad'),
    url(r'^create/$', 'create.select_category',
        name='classifieds_create_ad_select_category'),
    url(r'^create/(?P<slug>[-\w]+)/$', 'create.create_in_category',
        name='classifieds_create_ad_in_category'),
    url(r'^create/edit/(?P<pk>[0-9]+)/$', AdCreationEditView.as_view(),
        name='classifieds_create_ad_edit'),
    url(r'^create/preview/(?P<pk>[0-9]+)/$', 'create.preview',
        name='classifieds_create_ad_preview'),

    url(r'^search/(?P<slug>[-\w]+)/$', 'browse.search_in_category',
        name='classifieds_browse_category_search'),
    url(r'^search/results/(?P<slug>[-\w]+)/$', 'browse.search_results',
        name='classifieds_browse_search_results'),
    url(r'^(?P<pk>[0-9]+)/$', 'browse.view',
        name='classifieds_browse_ad_view'),
)

# local-based urls coming soon
urlpatterns = base_urlpatterns

# top-level urls
urlpatterns += patterns('classifieds.views',
    url(r'^mine/$', 'manage.mine', name='classifieds_manage_view_all'),
    url(r'^edit/(?P<pk>[0-9]+)/$', AdEditView.as_view(),
        name='classifieds_manage_ad_edit'),
    url(r'^delete/(?P<pk>[0-9]+)/$', AdDeleteView.as_view(),
        name='classifieds_manage_ad_delete'),

    (r'^new/(?P<pk>[0-9]+)/$', 'payment.view_bought'),
    (r'^checkout/(?P<pk>[0-9]+)$', 'payment.checkout'),
    (r'^pricing$', 'payment.pricing'),

    (r'^contact/(?P<pk>[0-9]+)$', 'contact.contact_seller'),
)

from sitemaps import sitemaps

urlpatterns += patterns('',
    (r'^ipn/$', 'paypal.standard.ipn.views.ipn'),
    (r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap',
     {'sitemaps': sitemaps}),
)


text:
import unittest

import requests_mock

from canvasapi import Canvas
from tests import settings
from tests.util import register_uris

@requests_mock.Mocker()
class TestPageView(unittest.TestCase):
    def setUp(self):
        self.canvas = Canvas(settings.BASE_URL, settings.API_KEY)

        with requests_mock.Mocker() as m:
            register_uris({"user": ["get_by_id", "page_views", "page_views_p2"]}, m)

            self.user = self.canvas.get_user(1)
            pageviews = self.user.get_page_views()
            self.pageview = pageviews[0]

    # __str__()
    def test__str__(self, m):
        string = str(self.pageview)
        self.assertIsInstance(string, str)


text:
import logging
from typing import Any, Optional, Set, TypeVar, cast

from reactivex import abc, typing
from reactivex.disposable import (
    CompositeDisposable,
    Disposable,
    SingleAssignmentDisposable,
)

from ..periodicscheduler import PeriodicScheduler

_TState = TypeVar("_TState")

log = logging.getLogger("Rx")

class WxScheduler(PeriodicScheduler):
    """A scheduler for a wxPython event loop."""

    def __init__(self, wx: Any) -> None:
        """Create a new WxScheduler.

        Args:
            wx: The wx module to use; typically, you would get this by
                import wx
        """

        super().__init__()
        self._wx = wx
        timer_class: Any = self._wx.Timer

        class Timer(timer_class):
            def __init__(self, callback: typing.Action) -> None:
                super().__init__()  # type: ignore
                self.callback = callback

            def Notify(self) -> None:
                self.callback()

        self._timer_class = Timer
        self._timers: Set[Timer] = set()

    def cancel_all(self) -> None:
        """Cancel all scheduled actions.

        Should be called when destroying wx controls to prevent
        accessing dead wx objects in actions that might be pending.
        """
        for timer in self._timers:
            timer.Stop()  # type: ignore

    def _wxtimer_schedule(
        self,
        time: typing.AbsoluteOrRelativeTime,
        action: typing.ScheduledSingleOrPeriodicAction[_TState],
        state: Optional[_TState] = None,
        periodic: bool = False,
    ) -> abc.DisposableBase:
        scheduler = self

        sad = SingleAssignmentDisposable()

        def interval() -> None:
            nonlocal state
            if periodic:
                state = cast(typing.ScheduledPeriodicAction[_TState], action)(state)
            else:
                sad.disposable = cast(typing.ScheduledAction[_TState], action)(
                    scheduler, state
                )

        msecs = max(1, int(self.to_seconds(time) * 1000.0))  # Must be non-zero

        log.debug("timeout wx: %s", msecs)

        timer = self._timer_class(interval)
        # A timer can only be used from the main thread
        if self._wx.IsMainThread():
            timer.Start(msecs, oneShot=not periodic)  # type: ignore
        else:
            self._wx.CallAfter(timer.Start, msecs, oneShot=not periodic)  # type: ignore
        self._timers.add(timer)

        def dispose() -> None:
            timer.Stop()  # type: ignore
            self._timers.remove(timer)

        return CompositeDisposable(sad, Disposable(dispose))

    def schedule(
        self, action: typing.ScheduledAction[_TState], state: Optional[_TState] = None
    ) -> abc.DisposableBase:
        """Schedules an action to be executed.

        Args:
            action: Action to be executed.
            state: [Optional] state to be given to the action function.

        Returns:
            The disposable object used to cancel the scheduled action
            (best effort).
        """
        sad = SingleAssignmentDisposable()
        is_disposed = False

        def invoke_action() -> None:
            if not is_disposed:
                sad.disposable = action(self, state)

        self._wx.CallAfter(invoke_action)

        def dispose() -> None:
            nonlocal is_disposed
            is_disposed = True

        return CompositeDisposable(sad, Disposable(dispose))

    def schedule_relative(
        self,
        duetime: typing.RelativeTime,
        action: typing.ScheduledAction[_TState],
        state: Optional[_TState] = None,
    ) -> abc.DisposableBase:
        """Schedules an action to be executed after duetime.

        Args:
            duetime: Relative time after which to execute the action.
            action: Action to be executed.
            state: [Optional] state to be given to the action function.

        Returns:
            The disposable object used to cancel the scheduled action
            (best effort).
        """
        return self._wxtimer_schedule(duetime, action, state=state)

    def schedule_absolute(
        self,
        duetime: typing.AbsoluteTime,
        action: typing.ScheduledAction[_TState],
        state: Optional[_TState] = None,
    ) -> abc.DisposableBase:
        """Schedules an action to be executed at duetime.

        Args:
            duetime: Absolute time at which to execute the action.
            action: Action to be executed.
            state: [Optional] state to be given to the action function.

        Returns:
            The disposable object used to cancel the scheduled action
            (best effort).
        """

        duetime = self.to_datetime(duetime)
        return self._wxtimer_schedule(duetime - self.now, action, state=state)

    def schedule_periodic(
        self,
        period: typing.RelativeTime,
        action: typing.ScheduledPeriodicAction[_TState],
        state: Optional[_TState] = None,
    ) -> abc.DisposableBase:
        """Schedules a periodic piece of work to be executed in the loop.

        Args:
             period: Period in seconds for running the work repeatedly.
             action: Action to be executed.
             state: [Optional] state to be given to the action function.

         Returns:
             The disposable object used to cancel the scheduled action
             (best effort).
        """

        return self._wxtimer_schedule(period, action, state=state, periodic=True)


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

    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Statistics of xcomp in UD_Belarusian</title>
    <link rel="root" href=""/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/hint.css"/>

          home

          edit page
          issue tracker

          <gcse:search></gcse:search>

        This page pertains to UD version 2.

            It appears that you have Javascript disabled.
            Please consider enabling Javascript for this page to see the visualizations.

Treebank Statistics: UD_Belarusian: Relations: xcomp

This relation is universal.

109 nodes (1%) are attached to their parents as xcomp.

106 instances of xcomp (97%) are left-to-right (parent precedes child).
Average distance between parent and child is 1.77064220183486.

The following 4 pairs of parts of speech are connected with xcomp: <tt>VERB</tt>-<tt>VERB</tt> (77; 71% instances), <tt>NOUN</tt>-<tt>VERB</tt> (16; 15% instances), <tt>ADJ</tt>-<tt>VERB</tt> (15; 14% instances), <tt>ADV</tt>-<tt>VERB</tt> (1; 1% instances).

# visual-style 3	bgColor:blue
# visual-style 3	fgColor:white
# visual-style 2	bgColor:blue
# visual-style 2	fgColor:white
# visual-style 2 3 xcomp	color:blue
1	Сірыя	сірыя	PROPN	NNP	Animacy=Inan|Case=Nom|Gender=Fem|Number=Sing	2	nsubj	_	_
2	хоча	хацець	VERB	VBC	Aspect=Imp|Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin|Voice=Act	0	root	_	_
3	выпускаць	выпускаць	VERB	VB	Aspect=Imp|VerbForm=Inf|Voice=Act	2	xcomp	_	_
4	лекі	лекі	NOUN	NN	Animacy=Inan|Case=Acc|Gender=Masc|Number=Plur	3	obj	_	_
5	разам	разам	ADV	RB	Degree=Pos	3	advmod	_	_
6	з	з	ADP	IN	_	7	case	_	_
7	Беларуссю	беларусь	PROPN	NNP	Animacy=Inan|Case=Ins|Gender=Fem|Number=Sing	5	obl	_	_

# visual-style 9	bgColor:blue
# visual-style 9	fgColor:white
# visual-style 8	bgColor:blue
# visual-style 8	fgColor:white
# visual-style 8 9 xcomp	color:blue
1	Да	да	ADP	IN	_	3	case	_	_
2	сваіх	свой	DET	PRP$	Case=Gen|Number=Plur|Poss=Yes|PronType=Prs	3	det	_	_
3	сяброў	сябар	NOUN	NN	Animacy=Anim|Case=Gen|Gender=Masc|Number=Plur	5	obl	_	_
4	я	я	PRON	PRP	Case=Nom|Number=Sing|Person=1|PronType=Prs	5	nsubj	_	_
5	гавару	гаварыць	VERB	VBC	Aspect=Imp|Mood=Ind|Number=Sing|Person=1|Tense=Pres|VerbForm=Fin|Voice=Act	0	root	_	SpaceAfter=No
6	:	:	PUNCT	PUNCT	_	8	punct	_	_
7	зараз	зараз	ADV	RB	Degree=Pos	8	advmod	_	_
8	час	час	NOUN	NN	Animacy=Inan|Case=Nom|Gender=Masc|Number=Sing	5	ccomp	_	_
9	падрыхтавацца	падрыхтавацца	VERB	VB	Aspect=Perf|VerbForm=Inf|Voice=Mid	8	xcomp	_	SpaceAfter=No
10	.	.	PUNCT	PUNCT	_	5	punct	_	_

# visual-style 4	bgColor:blue
# visual-style 4	fgColor:white
# visual-style 3	bgColor:blue
# visual-style 3	fgColor:white
# visual-style 3 4 xcomp	color:blue
1	Беларускія	беларускі	ADJ	JJL	Case=Nom|Degree=Pos|Number=Plur	2	amod	_	_
2	банкі	банк	NOUN	NN	Animacy=Inan|Case=Nom|Gender=Masc|Number=Plur	3	nsubj	_	_
3	гатовыя	гатовы	ADJ	JJL	Case=Nom|Degree=Pos|Number=Plur	0	root	_	_
4	працаваць	працаваць	VERB	VB	Aspect=Imp|VerbForm=Inf|Voice=Act	3	xcomp	_	_
5	з	з	ADP	IN	_	7	case	_	_
6	200-тысячнай	200-тысячны	ADJ	JJL	Case=Ins|Degree=Pos|Gender=Fem|Number=Sing	7	amod	_	_
7	купюрай	купюра	NOUN	NN	Animacy=Inan|Case=Ins|Gender=Fem|Number=Sing	4	obl	_	SpaceAfter=No
8	.	.	PUNCT	PUNCT	_	3	punct	_	_

© 2014–2021
            Universal Dependencies contributors.
            Site powered by Annodoc and brat
.


text:
// ReSharper disable InconsistentNaming
using System;
using System.Collections.Generic;

namespace DotLua
{
    internal static class LuaEvents
    {
        // This is all based on the Lua 5.2 manual
        // http://www.lua.org/manual/5.2/manual.html#2.4

        public static LuaObject rawget(LuaObject table, LuaObject index)
        {
            if (table.IsTable)
            {
                LuaObject obj;
                if (table.AsTable().TryGetValue(index, out obj))
                    return obj;
                return LuaObject.Nil;
            }
            throw new LuaException("Invalid operation");
        }

        public static void rawset(LuaObject table, LuaObject key, LuaObject value)
        {
            if (table.IsTable)
            {
                var t = table.AsTable();
                if (t.ContainsKey(key))
                    t[key] = value;
                else
                    t.Add(key, value);
            }
            else
                throw new LuaException("Invalid operation");
        }

        private static LuaObject getBinhandler(LuaObject a, LuaObject b, string f)
        {
            var f1 = getMetamethod(a, f);
            var f2 = getMetamethod(b, f);

            return f1 | f2;
        }

        private static LuaObject getEqualhandler(LuaObject a, LuaObject b)
        {
            if ((a.Type != b.Type) || (a.IsTable && b.IsUserData))
                return LuaObject.Nil;
            var mm1 = getMetamethod(a, "__eq");
            var mm2 = getMetamethod(b, "__eq");
            if (mm1 == mm2)
                return mm1;
            return LuaObject.Nil;
        }

        internal static LuaObject toNumber(LuaObject obj)
        {
            if (obj.IsNumber)
                return LuaObject.FromNumber(obj.AsNumber());
            if (obj.IsString)
            {
                double d;
                if (double.TryParse(obj.AsString(), out d))
                    return LuaObject.FromNumber(d);
                return LuaObject.Nil;
            }
            return LuaObject.Nil;
        }

        internal static bool ConvertToNumber(LuaObject obj, out double value)
        {
            if (obj.IsNumber)
            {
                value = (double)obj.luaobj;
                return true;
            }
            if (obj.IsString)
            {
                if (double.TryParse(obj.AsString(), out value))
                    return true;
                return false;
            }
            value = 0d;
            return false;
        }

        internal static LuaObject getMetamethod(LuaObject obj, string e)
        {
            if (obj.Metatable == null || obj.Metatable.IsNil)
                return LuaObject.Nil;
            return obj.Metatable[e];
        }

        internal static LuaObject add_event(LuaObject op1, LuaObject op2)
        {
            double a, b;

            if (ConvertToNumber(op1, out a) && ConvertToNumber(op2, out b))
                return LuaObject.FromNumber(a + b);
            var handler = getBinhandler(op1, op2, "__add");
            if (!handler.IsNil)
                return handler.Call(op1, op2)[0];

            throw new LuaException("Invalid arithmetic operation");
        }

        internal static LuaObject sub_event(LuaObject op1, LuaObject op2)
        {
            double a, b;

            if (ConvertToNumber(op1, out a) && ConvertToNumber(op2, out b))
                return LuaObject.FromNumber(a - b);
            var handler = getBinhandler(op1, op2, "__sub");
            if (!handler.IsNil)
                return handler.Call(op1, op2)[0];

            throw new LuaException("Invalid arithmetic operation");
        }

        internal static LuaObject mul_event(LuaObject op1, LuaObject op2)
        {
            double a, b;

            if (ConvertToNumber(op1, out a) && ConvertToNumber(op2, out b))
                return LuaObject.FromNumber(a * b);
            var handler = getBinhandler(op1, op2, "__mul");
            if (!handler.IsNil)
                return handler.Call(op1, op2)[0];

            throw new LuaException("Invalid arithmetic operation");
        }

        internal static LuaObject div_event(LuaObject op1, LuaObject op2)
        {
            double a, b;

            if (ConvertToNumber(op1, out a) && ConvertToNumber(op2, out b))
                return LuaObject.FromNumber(a / b);
            var handler = getBinhandler(op1, op2, "__div");
            if (!handler.IsNil)
                return handler.Call(op1, op2)[0];

            throw new LuaException("Invalid arithmetic operation");
        }

        internal static LuaObject mod_event(LuaObject op1, LuaObject op2)
        {
            double a, b;

            if (ConvertToNumber(op1, out a) && ConvertToNumber(op2, out b))
                return LuaObject.FromNumber(a - Math.Floor(a / b) * b);
            var handler = getBinhandler(op1, op2, "__mod");
            if (!handler.IsNil)
                return handler.Call(op1, op2)[0];

            throw new LuaException("Invalid arithmetic operation");
        }

        internal static LuaObject pow_event(LuaObject op1, LuaObject op2)
        {
            double a, b;

            if (ConvertToNumber(op1, out a) && ConvertToNumber(op2, out b))
                return LuaObject.FromNumber(Math.Pow(a, b));
            var handler = getBinhandler(op1, op2, "__pow");
            if (!handler.IsNil)
                return handler.Call(op1, op2)[0];

            throw new LuaException("Invalid arithmetic operation");
        }

        internal static LuaObject unm_event(LuaObject op)
        {
            double a;

            if (ConvertToNumber(op, out a))
            {
                return LuaObject.FromNumber(-a);
            }
            var handler = getMetamethod(op, "__unm");
            if (!handler.IsNil)
                return handler.Call(op)[0];

            throw new LuaException("Invalid arithmetic operation");
        }

        internal static LuaObject index_event(LuaObject table, LuaObject key)
        {
            LuaObject handler;

            if (table.IsTable)
            {
                var v = rawget(table, key);
                if (!v.IsNil)
                    return v;
                handler = getMetamethod(table, "__index");
                if (handler.IsNil)
                    return LuaObject.Nil;
            }
            else
            {
                handler = getMetamethod(table, "__index");
                if (handler.IsNil)
                    throw new LuaException("Invalid argument");
            }

            if (handler.IsFunction)
                return handler.AsFunction()(new[] { table, key })[0];
            if (!handler.IsNil)
                return handler[key];
            return LuaObject.Nil;
        }

        internal static LuaObject newindex_event(LuaObject table, LuaObject key, LuaObject value)
        {
            LuaObject handler;
            if (table.IsTable)
            {
                var v = rawget(table, key);
                if (!v.IsNil)
                {
                    rawset(table, key, value);
                    return LuaObject.Nil;
                }
                handler = getMetamethod(table, "__newindex");
                if (handler.IsNil)
                {
                    rawset(table, key, value);
                    return LuaObject.Nil;
                }
            }
            else
            {
                handler = getMetamethod(table, "__newindex");
                if (handler.IsNil)
                    throw new LuaException("Invalid op");
            }

            if (handler.IsFunction)
                handler.AsFunction()(new[] { table, key, value });
            else
                handler[key] = value;
            return LuaObject.Nil;
        }

        internal static LuaArguments call_event(LuaObject func, LuaArguments args)
        {
            if (func.IsFunction)
                return func.AsFunction()(args);
            var handler = getMetamethod(func, "__call");
            if (handler.IsFunction)
            {
                var argslist = new List<LuaObject>();
                argslist.Add(func);
                argslist.AddRange(args);
                return handler.AsFunction()(argslist.ToArray());
            }
            throw new LuaException("Cannot call nonfunction");
        }

        internal static LuaObject len_event(LuaObject op)
        {
            if (op.IsString)
                return op.AsString().Length;
            var handler = getMetamethod(op, "__len");
            if (!handler.IsNil)
                return handler.Call(op)[0];
            if (op.IsTable)
                return op.AsTable().Count;
            throw new LuaException("Invalid op");
        }

        internal static LuaObject concat_event(LuaObject op1, LuaObject op2)
        {
            if ((op1.IsString || op1.IsNumber) && (op2.IsString || op2.IsNumber))
                return string.Concat(op1, op2);
            var handler = getBinhandler(op1, op2, "__concat");
            if (!handler.IsNil)
                return handler.Call(op1, op2)[0];
            throw new LuaException("Invalid op");
        }

        internal static LuaObject eq_event(LuaObject op1, LuaObject op2)
        {
            if (op1 == op2)
                return true;
            var handler = getEqualhandler(op1, op2);
            if (!handler.IsNil)
                return !(!(handler.Call(op1, op2)[0].AsBool()));
            return false;
        }

        internal static LuaObject lt_event(LuaObject op1, LuaObject op2)
        {
            if (op1.IsNumber && op2.IsNumber)
                return op1.AsNumber() < op2.AsNumber();
            if (op1.IsString && op2.IsString)
            {
                var n = StringComparer.CurrentCulture.Compare(op1.AsString(), op2.AsString());
                return (n < 0);
            }
            var handler = getBinhandler(op1, op2, "__lt");
            if (!handler.IsNil)
                return !(!(handler.Call(op1, op2)[0].AsBool()));
            throw new ArgumentException("attempt to compare " + op1.type + " with " + op2.type);
        }

        internal static LuaObject le_event(LuaObject op1, LuaObject op2)
        {
            if (op1.IsNumber && op2.IsNumber)
                return op1.AsNumber() <= op2.AsNumber();
            if (op1.IsString && op2.IsString)
            {
                var n = StringComparer.CurrentCulture.Compare(op1.AsString(), op2.AsString());
                return (n <= 0);
            }
            var handler = getBinhandler(op1, op2, "__le");
            if (!handler.IsNil)
                return !(!(handler.Call(op1, op2)[0].AsBool()));
            throw new ArgumentException("attempt to compare " + op1.type + " with " + op2.type);
        }

        internal static LuaObject gc_event(LuaObject op)
        {
            var handler = getMetamethod(op, "__gc");
            if (handler.IsFunction)
                handler.AsFunction()(new[] { op });
            return LuaObject.Nil;
        }

        internal static LuaObject tostring_event(LuaObject op)
        {
            var handler = getMetamethod(op, "__tostring");
            if (!handler.IsNil)
                return handler.Call(op)[0];
            return op.ToString();
        }
    }
}


text:
import {controller} from 'api/post/controller';
import {CheckAdmin, Gatekeeper} from 'auth/gatekeeper';

var express = require('express');

var postRouter = express.Router();

postRouter.param('post', controller.mountId);

postRouter.route('/')
  .get(controller.getAll)
  .post(CheckAdmin(), controller.createOne);

postRouter.route('/:post')
  .get(controller.getOne)
  .put(Gatekeeper(), controller.editOne)
  .delete(CheckAdmin(), controller.removeOne);

export {postRouter};


text:
<?php

require_once(__DIR__ . '/src/Zebra_cURL.php');

class Zebra_Zebra extends Zebra_cURL
{
}


text:
package org.apache.dubbo.remoting.transport.mina;

import org.apache.dubbo.common.URL;
import org.apache.dubbo.remoting.Channel;
import org.apache.dubbo.remoting.ChannelHandler;
import org.apache.dubbo.remoting.Codec2;
import org.apache.dubbo.remoting.buffer.ChannelBuffer;
import org.apache.dubbo.remoting.buffer.ChannelBuffers;
import org.apache.dubbo.remoting.buffer.DynamicChannelBuffer;

import org.apache.mina.common.ByteBuffer;
import org.apache.mina.common.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolDecoderOutput;
import org.apache.mina.filter.codec.ProtocolEncoder;
import org.apache.mina.filter.codec.ProtocolEncoderOutput;

import static org.apache.dubbo.remoting.Constants.BUFFER_KEY;
import static org.apache.dubbo.remoting.Constants.DEFAULT_BUFFER_SIZE;
import static org.apache.dubbo.remoting.Constants.MAX_BUFFER_SIZE;
import static org.apache.dubbo.remoting.Constants.MIN_BUFFER_SIZE;

/**
 * MinaCodecAdapter.
 */
final class MinaCodecAdapter implements ProtocolCodecFactory {

    private final ProtocolEncoder encoder = new InternalEncoder();

    private final ProtocolDecoder decoder = new InternalDecoder();

    private final Codec2 codec;

    private final URL url;

    private final ChannelHandler handler;

    private final int bufferSize;

    public MinaCodecAdapter(Codec2 codec, URL url, ChannelHandler handler) {
        this.codec = codec;
        this.url = url;
        this.handler = handler;
        int b = url.getPositiveParameter(BUFFER_KEY, DEFAULT_BUFFER_SIZE);
        this.bufferSize = b >= MIN_BUFFER_SIZE && b <= MAX_BUFFER_SIZE ? b : DEFAULT_BUFFER_SIZE;
    }

    @Override
    public ProtocolEncoder getEncoder() {
        return encoder;
    }

    @Override
    public ProtocolDecoder getDecoder() {
        return decoder;
    }

    private class InternalEncoder implements ProtocolEncoder {

        @Override
        public void dispose(IoSession session) throws Exception {
        }

        @Override
        public void encode(IoSession session, Object msg, ProtocolEncoderOutput out) throws Exception {
            ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(1024);
            MinaChannel channel = MinaChannel.getOrAddChannel(session, url, handler);
            try {
                codec.encode(channel, buffer, msg);
            } finally {
                MinaChannel.removeChannelIfDisconnected(session);
            }
            out.write(ByteBuffer.wrap(buffer.toByteBuffer()));
            out.flush();
        }
    }

    private class InternalDecoder implements ProtocolDecoder {

        private ChannelBuffer buffer = ChannelBuffers.EMPTY_BUFFER;

        @Override
        public void decode(IoSession session, ByteBuffer in, ProtocolDecoderOutput out) throws Exception {
            int readable = in.limit();
            if (readable <= 0) {
                return;
            }

            ChannelBuffer frame;

            if (buffer.readable()) {
                if (buffer instanceof DynamicChannelBuffer) {
                    buffer.writeBytes(in.buf());
                    frame = buffer;
                } else {
                    int size = buffer.readableBytes() + in.remaining();
                    frame = ChannelBuffers.dynamicBuffer(size > bufferSize ? size : bufferSize);
                    frame.writeBytes(buffer, buffer.readableBytes());
                    frame.writeBytes(in.buf());
                }
            } else {
                frame = ChannelBuffers.wrappedBuffer(in.buf());
            }

            Channel channel = MinaChannel.getOrAddChannel(session, url, handler);
            Object msg;
            int savedReadIndex;

            try {
                do {
                    savedReadIndex = frame.readerIndex();
                    try {
                        msg = codec.decode(channel, frame);
                    } catch (Exception e) {
                        buffer = ChannelBuffers.EMPTY_BUFFER;
                        throw e;
                    }
                    if (msg == Codec2.DecodeResult.NEED_MORE_INPUT) {
                        frame.readerIndex(savedReadIndex);
                        break;
                    } else {
                        if (savedReadIndex == frame.readerIndex()) {
                            buffer = ChannelBuffers.EMPTY_BUFFER;
                            throw new Exception("Decode without read data.");
                        }
                        if (msg != null) {
                            out.write(msg);
                        }
                    }
                } while (frame.readable());
            } finally {
                if (frame.readable()) {
                    frame.discardReadBytes();
                    buffer = frame;
                } else {
                    buffer = ChannelBuffers.EMPTY_BUFFER;
                }
                MinaChannel.removeChannelIfDisconnected(session);
            }
        }

        @Override
        public void dispose(IoSession session) throws Exception {
        }

        @Override
        public void finishDecode(IoSession session, ProtocolDecoderOutput out) throws Exception {
        }
    }
}


text:
This is the sample application for the
[*Ruby on Rails Tutorial:
Learn Web Development with Rails*](http://www.railstutorial.org/)


text:
#region License

#endregion

namespace ObjectGL.Api.Objects
{
    public interface ITesselationEvaluationShader : IShader
    {

    }
}


text:
import * as path from "path";

import { AbstractFormatter } from "../language/formatter/abstractFormatter";
import { IFormatterMetadata } from "../language/formatter/formatter";
import { RuleFailure } from "../language/rule/rule";
import { camelize, dedent } from "../utils";

export class Formatter extends AbstractFormatter {
    /* tslint:disable:object-literal-sort-keys */
    public static metadata: IFormatterMetadata = {
        formatterName: "msbuild",
        description: "Formats errors for consumption by msbuild.",
        descriptionDetails: dedent`
            The output is compatible with both msbuild and Visual Studio. All failures have the
            'warning' severity.`,
        sample: "myFile.ts(1,14): warning: Missing semicolon",
        consumer: "machine",
    };
    /* tslint:enable:object-literal-sort-keys */

    public format(failures: RuleFailure[]): string {
        const outputLines = failures.map((failure: RuleFailure) => {
            const fileName = path.normalize(failure.getFileName());
            const failureString = failure.getFailure();
            const camelizedRule = camelize(failure.getRuleName());

            const lineAndCharacter = failure.getStartPosition().getLineAndCharacter();
            const positionTuple = `(${lineAndCharacter.line + 1},${lineAndCharacter.character + 1})`;
            const severity = failure.getRuleSeverity();

            return `${fileName}${positionTuple}: ${severity} ${camelizedRule}: ${failureString}`;
        });

        return `${outputLines.join("\n")}\n`;
    }
}