text:
from urlparse import urlparse

from django.contrib.auth.forms import PasswordChangeForm, SetPasswordForm
from django.contrib.auth.models import User, AnonymousUser
from django.contrib.auth.tokens import default_token_generator
from django.core import mail
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from django.utils.encoding import force_bytes
from django.utils.http import urlsafe_base64_encode

from cellcounter.cc_kapi.factories import UserFactory, KeyboardFactory
from .forms import EmailUserCreationForm, PasswordResetForm
from .utils import read_signup_email
from .views import PasswordResetConfirmView

class TestRegistrationView(TestCase):

    def setUp(self):
        self.request_factory = RequestFactory()

    def test_get(self):
        response = self.client.get(reverse('register'))
        self.assertEqual(response.status_code, 200)
        self.assertIsInstance(response.context['form'], EmailUserCreationForm)

    def test_valid(self):
        data = {'username': '123', 'email': 'joe@example.org', 'password1': 'test', 'password2': 'test', 'tos': True}
        response = self.client.post(reverse('register'), data=data, follow=True)
        self.assertRedirects(response, reverse('new_count'))
        user = User.objects.get(username='123')
        messages = list(response.context['messages'])
        self.assertEqual("Successfully registered, you are now logged in! View your profile"
                         % user.id,
                         messages[0].message)
        self.assertEqual(user, response.context['user'])

    def test_invalid(self):
        data = {'username': '123', 'email': 'joe@example.org', 'password1': 'test', 'password2': 'test', 'tos': False}
        response = self.client.post(reverse('register'), data=data)
        self.assertEqual(response.status_code, 200)
        self.assertFormError(response, 'form', 'tos', 'You must agree our Terms of Service')
        self.assertEqual(AnonymousUser(), response.context['user'])

    @override_settings(RATELIMIT_ENABLE=True)
    def test_ratelimit_registration(self):
        cache.clear()
        data = {'username': '123', 'email': 'joe@example.org', 'password1': 'test', 'password2': 'test', 'tos': True}
        self.client.post(reverse('register'), data)
        self.client.logout()
        data['username'] = 'Another'
        self.client.post(reverse('register'), data, follow=True)
        self.client.logout()
        data['username'] = 'Another2'
        response = self.client.post(reverse('register'), data, follow=True)
        messages = list(response.context['messages'])
        self.assertEqual(1, len(messages))
        self.assertEqual('You have been rate limited', messages[0].message)

    @override_settings(RATELIMIT_ENABLE=True)
    def test_ratelimit_invalid_form(self):
        cache.clear()
        data = {'username': '123', 'email': '1234', 'password1': 'test', 'password2': 'test', 'tos': True}
        self.client.post(reverse('register'), data)
        response = self.client.post(reverse('register'), data, follow=True)
        self.assertEqual(response.status_code, 200)
        self.assertNotIn('You have been rate limited', response.content)

class TestPasswordChangeView(TestCase):
    def setUp(self):
        self.factory = RequestFactory()
        self.user = UserFactory()
        self.valid_data = {'old_password': 'test', 'new_password1': 'new', 'new_password2': 'new'}
        self.invalid_data = {'old_password': 'test', 'new_password1': 'test', 'new_password2': '1234'}

    def test_logged_out_get_redirect(self):
        response = self.client.get(reverse('change-password'))
        self.assertRedirects(response,
                             "%s?next=%s" % (reverse('login'), reverse('change-password')))

    def test_logged_out_post_redirect(self):
        response = self.client.post(reverse('change-password'), self.valid_data)
        self.assertRedirects(response,
                             "%s?next=%s" % (reverse('login'), reverse('change-password')))

    def test_logged_in_to_form(self):
        self.client.force_login(self.user)
        response = self.client.get(reverse('change-password'))
        self.assertEqual(response.status_code, 200)
        self.assertIsInstance(response.context['form'], PasswordChangeForm)

    def test_post_valid(self):
        self.client.force_login(self.user)
        response = self.client.post(reverse('change-password'), data=self.valid_data, follow=True)
        self.assertRedirects(response, reverse('new_count'))
        messages = list(response.context['messages'])
        self.assertEqual('Password changed successfully', messages[0].message)

    def test_post_invalid(self):
        self.client.force_login(self.user)
        response = self.client.post(reverse('change-password'), data=self.invalid_data)
        self.assertFormError(response, 'form', 'new_password2', "The two password fields didn't match.")

class TestUserDetailView(TestCase):
    def setUp(self):
        self.keyboard = KeyboardFactory()

    def test_get_anonymous(self):
        user2 = UserFactory()
        response = self.client.get(reverse('user-detail', kwargs={'pk': user2.id}))
        self.assertRedirects(response,
                             "%s?next=%s" % (reverse('login'), reverse('user-detail', kwargs={'pk': user2.id})))

    def test_get_self(self):
        self.client.force_login(self.keyboard.user)
        response = self.client.get(reverse('user-detail', kwargs={'pk': self.keyboard.user.id}))
        self.assertEqual(response.status_code, 200)
        self.assertEqual(response.context['user_detail'], self.keyboard.user)
        self.assertEqual(len(response.context['keyboards']), 1)

    def test_get_someone_else(self):
        user2 = UserFactory()
        self.client.force_login(self.keyboard.user)
        response = self.client.get(reverse('user-detail', kwargs={'pk': user2.id}))
        self.assertEqual(response.status_code, 403)

class TestUserDeleteView(TestCase):
    def setUp(self):
        self.user = UserFactory()

    def test_get_delete_anonymous(self):
        response = self.client.get(reverse('user-delete', kwargs={'pk': self.user.id}))
        self.assertRedirects(response,
                             "%s?next=%s" % (reverse('login'), reverse('user-delete', kwargs={'pk': self.user.id})))

    def test_delete_anonymous(self):
        user2 = UserFactory()
        response = self.client.delete(reverse('user-delete', kwargs={'pk': user2.id}))
        self.assertRedirects(response,
                             "%s?next=%s" % (reverse('login'), reverse('user-delete', kwargs={'pk': user2.id})))

    def test_get_delete_self(self):
        self.client.force_login(self.user)
        response = self.client.get(reverse('user-delete', kwargs={'pk': self.user.id}))
        self.assertEqual(response.status_code, 200)
        self.assertTemplateUsed(response, 'accounts/user_check_delete.html')

    def test_delete_self(self):
        self.client.force_login(self.user)
        response = self.client.delete(reverse('user-delete', kwargs={'pk': self.user.id}), follow=True)
        self.assertRedirects(response, reverse('new_count'))
        self.assertEqual('User account deleted', list(response.context['messages'])[0].message)

    def test_get_delete_someone_else(self):
        user2 = UserFactory()
        self.client.force_login(self.user)
        response = self.client.get(reverse('user-delete', kwargs={'pk': user2.id}))
        self.assertEqual(response.status_code, 403)

    def test_delete_someone_else(self):
        user2 = UserFactory()
        self.client.force_login(self.user)
        response = self.client.delete(reverse('user-delete', kwargs={'pk': user2.id}))
        self.assertEqual(response.status_code, 403)

class TestUserUpdateView(TestCase):
    def setUp(self):
        self.valid_data = {'first_name': 'Jack', 'last_name': 'Example', 'email': 'test@example.org'}
        self.extra_data = {'first_name': 'Joe', 'last_name': 'Example', 'email': 'test@example.org',
                           'username': 'invalid'}
        self.invalid_data = {'first_name': 'Joe', 'last_name': 'Example', 'email': '1234'}

    def test_get_update_when_anonymous(self):
        user = UserFactory()
        response = self.client.get(reverse('user-update', kwargs={'pk': user.id}))
        self.assertRedirects(response,
                             "%s?next=%s" % (reverse('login'), reverse('user-update', kwargs={'pk': user.id})))

    def test_post_update_when_anonymous(self):
        user = UserFactory()
        response = self.client.post(reverse('user-update', kwargs={'pk': user.id}), data=self.valid_data)
        self.assertRedirects(response,
                             "%s?next=%s" % (reverse('login'), reverse('user-update', kwargs={'pk': user.id})))

    def test_update_self_valid(self):
        user = UserFactory()
        self.client.force_login(user)
        response = self.client.post(reverse('user-update', kwargs={'pk': user.id}), data=self.valid_data,
                                    follow=True)
        self.assertRedirects(response, reverse('user-detail', kwargs={'pk': user.id}))
        self.assertEqual('User details updated', list(response.context['messages'])[0].message)
        updated_user = User.objects.get(username=user.username)
        self.assertNotEqual(updated_user.first_name, user.first_name)
        self.assertNotEqual(updated_user.last_name, user.last_name)
        self.assertNotEqual(updated_user.email, user.email)

    def test_update_self_extra(self):
        user = UserFactory()
        self.client.force_login(user)
        response = self.client.post(reverse('user-update', kwargs={'pk': user.id}), data=self.extra_data,
                                    follow=True)
        self.assertRedirects(response, reverse('user-detail', kwargs={'pk': user.id}))
        self.assertEqual('User details updated', list(response.context['messages'])[0].message)
        updated_user = User.objects.get(username=user.username)
        self.assertNotEqual(updated_user.first_name, user.first_name)
        self.assertNotEqual(updated_user.last_name, user.last_name)
        self.assertNotEqual(updated_user.email, user.email)
        self.assertEqual(updated_user.username, user.username)

    def test_update_self_invalid(self):
        user = UserFactory()
        self.client.force_login(user)
        response = self.client.post(reverse('user-update', kwargs={'pk': user.id}), data=self.invalid_data)
        self.assertEqual(response.status_code, 200)
        self.assertFormError(response, 'form', 'email', 'Enter a valid email address.')

    def test_update_someone_else(self):
        user = UserFactory()
        user2 = UserFactory()
        self.client.force_login(user)
        response = self.client.post(reverse('user-update', kwargs={'pk': user2.id}))
        self.assertEqual(response.status_code, 403)

class TestPasswordResetView(TestCase):
    def setUp(self):
        self.factory = RequestFactory()
        self.user = UserFactory()

    def test_get_form(self):
        response = self.client.get(reverse('password-reset'))
        self.assertEqual(response.status_code, 200)
        self.assertIsInstance(response.context['form'], PasswordResetForm)
        self.assertTemplateUsed(response, 'accounts/reset_form.html')

    def test_post_valid_email(self):
        data = {'email': self.user.email}
        response = self.client.post(reverse('password-reset'), data=data, follow=True)
        self.assertRedirects(response, reverse('new_count'))
        self.assertEqual('Reset email sent', list(response.context['messages'])[0].message)
        self.assertEqual(1, len(mail.outbox))
        url, path = read_signup_email(mail.outbox[0])
        uidb64, token = urlparse(url).path.split('/')[-3:-1]
        self.assertEqual(path, reverse('password-reset-confirm', kwargs={'uidb64': uidb64, 'token': token}))

    def test_post_invalid_email(self):
        data = {'email': 'invalid@example.org'}
        response = self.client.post(reverse('password-reset'), data=data, follow=True)
        self.assertRedirects(response, reverse('new_count'))
        self.assertEqual(0, len(mail.outbox))

    @override_settings(RATELIMIT_ENABLE=True)
    def test_post_ratelimit(self):
        for n in range(0, 5):
            self.client.post(reverse('password-reset'), data={'email': self.user.email}, follow=True)
        response = self.client.post(reverse('password-reset'), data={'email': self.user.email}, follow=True)
        self.assertEqual(list(response.context['messages'])[0].message, 'You have been rate limited')
        cache.clear()

class TestPasswordResetConfirmView(TestCase):
    def setUp(self):
        self.user = UserFactory()
        self.valid_uidb64 = urlsafe_base64_encode(force_bytes(self.user.pk))
        self.valid_data = {'new_password1': 'newpwd', 'new_password2': 'newpwd'}
        self.invalid_data = {'new_password1': 'newpwd', 'new_password2': '1234'}

    def _generate_token(self, user):
        return default_token_generator.make_token(user)

    def test_valid_user_valid(self):
        """valid_user() with valid uidb64"""
        self.assertEqual(PasswordResetConfirmView().valid_user(self.valid_uidb64), self.user)

    def test_valid_user_invalid(self):
        """valid_user() with invalid uidb64"""
        uidb64 = urlsafe_base64_encode(force_bytes(2))
        self.assertIsNone(PasswordResetConfirmView().valid_user(uidb64))

    def test_valid_token_valid(self):
        """valid_token() with valid user and token"""
        self.assertTrue(PasswordResetConfirmView().valid_token(self.user, self._generate_token(self.user)))

    def test_valid_token_invalid_token(self):
        """valid_token() with valid user and invalid token"""
        token = "AAA-AAAAAAAAAAAAAAAAAAAA"
        self.assertFalse(PasswordResetConfirmView().valid_token(self.user, token))

    def test_valid_token_invalid_both(self):
        """valid_token() with invalid user and invalid token"""
        token = "AAA-AAAAAAAAAAAAAAAAAAAA"
        self.assertFalse(PasswordResetConfirmView().valid_token(None, self._generate_token(self.user)))

    def test_get_invalid_token(self):
        token = "AAA-AAAAAAAAAAAAAAAAAAAA"
        response = self.client.get(reverse('password-reset-confirm',
                                           kwargs={'uidb64': self.valid_uidb64,
                                                   'token': token}))
        self.assertEqual(response.status_code, 200)
        self.assertFalse(response.context['validlink'])
        self.assertIn("The password reset link was invalid, possibly because it has already been used."
                      " Please request a new password reset.", response.content)

    def test_get_invalid_user(self):
        response = self.client.get(reverse('password-reset-confirm',
                                           kwargs={'uidb64': urlsafe_base64_encode(force_bytes(2)),
                                                   'token': self._generate_token(self.user)}))
        self.assertEqual(response.status_code, 200)
        self.assertFalse(response.context['validlink'])
        self.assertIn("The password reset link was invalid, possibly because it has already been used."
                      " Please request a new password reset.", response.content)

    def test_post_invalid_token(self):
        token = "AAA-AAAAAAAAAAAAAAAAAAAA"
        response = self.client.post(reverse('password-reset-confirm',
                                            kwargs={'uidb64': self.valid_uidb64,
                                                    'token': token}),
                                    data=self.valid_data)
        self.assertEqual(response.status_code, 200)
        self.assertFalse(response.context['validlink'])
        self.assertIn("The password reset link was invalid, possibly because it has already been used."
                      " Please request a new password reset.", response.content)

    def test_get_valid(self):
        token = self._generate_token(self.user)
        response = self.client.get(reverse('password-reset-confirm',
                                           kwargs={'uidb64': self.valid_uidb64,
                                                   'token': token}))
        self.assertEqual(response.status_code, 200)
        self.assertIsInstance(response.context['form'], SetPasswordForm)

    def test_post_valid(self):
        token = self._generate_token(self.user)
        response = self.client.post(reverse('password-reset-confirm',
                                            kwargs={'uidb64': self.valid_uidb64,
                                                    'token': token}),
                                    data=self.valid_data, follow=True)
        self.assertRedirects(response, reverse('new_count'))
        self.assertEqual('Password reset successfully', list(response.context['messages'])[0].message)

    def test_post_invalid(self):
        token = self._generate_token(self.user)
        response = self.client.post(reverse('password-reset-confirm',
                                            kwargs={'uidb64': self.valid_uidb64,
                                                    'token': token}),
                                    data=self.invalid_data)
        self.assertEqual(response.status_code, 200)
        self.assertFormError(response, 'form', 'new_password2', "The two password fields didn't match.")


text:
<!DOCTYPE HTML>

		<title>Test Page for sap.ui.dt.ElementOverlay</title>

redpajama_set_name: RedPajamaGithub


text:
package com.google.firebase.firestore.remote;

import static com.google.firebase.firestore.testutil.IntegrationTestUtil.waitFor;

import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.firebase.database.collection.ImmutableSortedSet;
import com.google.firebase.firestore.auth.User;
import com.google.firebase.firestore.core.OnlineState;
import com.google.firebase.firestore.local.LocalStore;
import com.google.firebase.firestore.local.MemoryPersistence;
import com.google.firebase.firestore.local.Persistence;
import com.google.firebase.firestore.local.QueryEngine;
import com.google.firebase.firestore.model.DocumentKey;
import com.google.firebase.firestore.model.mutation.MutationBatchResult;
import com.google.firebase.firestore.testutil.IntegrationTestUtil;
import com.google.firebase.firestore.util.AsyncQueue;
import com.google.firebase.firestore.util.Consumer;
import io.grpc.Status;
import java.util.concurrent.Semaphore;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(AndroidJUnit4.class)
public class RemoteStoreTest {
  @Test
  public void testRemoteStoreStreamStopsWhenNetworkUnreachable() {
    AsyncQueue testQueue = new AsyncQueue();
    Datastore datastore =
        new Datastore(
            IntegrationTestUtil.testEnvDatabaseInfo(),
            testQueue,
            null,
            null,
            ApplicationProvider.getApplicationContext(),
            null);
    Semaphore networkChangeSemaphore = new Semaphore(0);
    RemoteStore.RemoteStoreCallback callback =
        new RemoteStore.RemoteStoreCallback() {
          @Override
          public void handleRemoteEvent(RemoteEvent remoteEvent) {}

          @Override
          public void handleRejectedListen(int targetId, Status error) {}

          @Override
          public void handleSuccessfulWrite(MutationBatchResult successfulWrite) {}

          @Override
          public void handleRejectedWrite(int batchId, Status error) {}

          @Override
          public void handleOnlineStateChange(OnlineState onlineState) {
            networkChangeSemaphore.release();
          }

          @Override
          public ImmutableSortedSet<DocumentKey> getRemoteKeysForTarget(int targetId) {
            return null;
          }
        };

    FakeConnectivityMonitor connectivityMonitor = new FakeConnectivityMonitor();
    QueryEngine queryEngine = new QueryEngine();
    Persistence persistence = MemoryPersistence.createEagerGcMemoryPersistence();
    persistence.start();
    LocalStore localStore = new LocalStore(persistence, queryEngine, User.UNAUTHENTICATED);
    RemoteStore remoteStore =
        new RemoteStore(callback, localStore, datastore, testQueue, connectivityMonitor);

    waitFor(testQueue.enqueue(remoteStore::forceEnableNetwork));
    drain(testQueue);
    networkChangeSemaphore.drainPermits();

    connectivityMonitor.goOffline();
    waitFor(networkChangeSemaphore);
    drain(testQueue);
    networkChangeSemaphore.drainPermits();

    waitFor(testQueue.enqueue(remoteStore::forceEnableNetwork));
    connectivityMonitor.goOnline();
    waitFor(networkChangeSemaphore);
  }

  private void drain(AsyncQueue testQueue) {
    waitFor(testQueue.enqueue(() -> {}));
  }

  static class FakeConnectivityMonitor implements ConnectivityMonitor {
    private Consumer<NetworkStatus> callback = null;

    @Override
    public void addCallback(Consumer<NetworkStatus> callback) {
      this.callback = callback;
    }

    @Override
    public void shutdown() {}

    public void goOffline() {
      if (callback != null) {
        callback.accept(ConnectivityMonitor.NetworkStatus.UNREACHABLE);
      }
    }

    public void goOnline() {
      if (callback != null) {
        callback.accept(ConnectivityMonitor.NetworkStatus.REACHABLE);
      }
    }
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.MSBuild;
using Wyam.Common.Configuration;
using Wyam.Common.IO;
using Wyam.Common.Meta;
using Wyam.Common.Tracing;

namespace Wyam.CodeAnalysis
{
    /// <summary>
    /// Reads all the source files from a specified msbuild project.
    /// This module will be executed once and input documents will be ignored if a search path is
    /// specified. Otherwise, if a delegate is specified the module will be executed once per input
    /// document and the resulting output documents will be aggregated.
    /// Note that this requires the MSBuild tools to be installed (included with Visual Studio).
    /// </summary>
    /// <remarks>
    /// The output of this module is similar to executing the ReadFiles module on all source files in the project.
    /// </remarks>
    /// <metadata cref="CodeAnalysisKeys.AssemblyName" usage="Output" />
    /// <metadata cref="Keys.SourceFileRoot" usage="Output" />
    /// <metadata cref="Keys.SourceFileBase" usage="Output" />
    /// <metadata cref="Keys.SourceFileExt" usage="Output" />
    /// <metadata cref="Keys.SourceFileName" usage="Output" />
    /// <metadata cref="Keys.SourceFileDir" usage="Output" />
    /// <metadata cref="Keys.SourceFilePath" usage="Output" />
    /// <metadata cref="Keys.SourceFilePathBase" usage="Output" />
    /// <metadata cref="Keys.RelativeFilePath" usage="Output" />
    /// <metadata cref="Keys.RelativeFilePathBase" usage="Output" />
    /// <metadata cref="Keys.RelativeFileDir" usage="Output" />
    /// <category>Input/Output</category>
    public class ReadProject : ReadWorkspace
    {
        /// <summary>
        /// Reads the project file at the specified path.
        /// </summary>
        /// <param name="path">The project file path.</param>
        public ReadProject(FilePath path)
            : base(path)
        {
        }

        /// <summary>
        /// Reads the project file at the specified path. This allows you to specify a different project file depending on the input.
        /// </summary>
        /// <param name="path">A delegate that returns a <c>FilePath</c> with the project file path.</param>
        public ReadProject(DocumentConfig path)
            : base(path)
        {
        }

        /// <inheritdoc />
        protected override IEnumerable<Project> GetProjects(IFile file)
        {
            MSBuildWorkspace workspace = MSBuildWorkspace.Create();
            Project project = workspace.OpenProjectAsync(file.Path.FullPath).Result;
            TraceMsBuildWorkspaceDiagnostics(workspace);
            if (!project.Documents.Any())
            {
                Trace.Warning($"Project at {file.Path.FullPath} contains no documents, which may be an error (view verbose output for any MSBuild errors)");
            }
            return new[] { project };
        }
    }
}


text:
from PySide import QtCore, QtGui

class Ui_Dialog(object):
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(418, 303)
        self.gridLayout = QtGui.QGridLayout(Dialog)
        self.gridLayout.setObjectName("gridLayout")
        self.configGroupBox = QtGui.QGroupBox(Dialog)
        self.configGroupBox.setTitle("")
        self.configGroupBox.setObjectName("configGroupBox")
        self.formLayout = QtGui.QFormLayout(self.configGroupBox)
        self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
        self.formLayout.setObjectName("formLayout")
        self.label0 = QtGui.QLabel(self.configGroupBox)
        self.label0.setObjectName("label0")
        self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label0)
        self.lineEdit0 = QtGui.QLineEdit(self.configGroupBox)
        self.lineEdit0.setObjectName("lineEdit0")
        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.lineEdit0)
        self.label1 = QtGui.QLabel(self.configGroupBox)
        self.label1.setObjectName("label1")
        self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.label1)
        self.lineEdit1 = QtGui.QLineEdit(self.configGroupBox)
        self.lineEdit1.setObjectName("lineEdit1")
        self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.lineEdit1)
        self.gridLayout.addWidget(self.configGroupBox, 0, 0, 1, 1)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.gridLayout.addWidget(self.buttonBox, 1, 0, 1, 1)

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog)

    def retranslateUi(self, Dialog):
        Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "ConfigureDialog", None, QtGui.QApplication.UnicodeUTF8))
        self.label0.setText(QtGui.QApplication.translate("Dialog", "identifier:  ", None, QtGui.QApplication.UnicodeUTF8))
        self.label1.setText(QtGui.QApplication.translate("Dialog", "Filename:  ", None, QtGui.QApplication.UnicodeUTF8))


text:
<?php

/*
 * This file is part of the kompakt/mediameister package.
 *
 * (c) Christian Hoegl <chrigu@sirprize.me>
 *
 */

namespace Kompakt\Mediameister\Task\BatchLister\Console;

use Kompakt\Mediameister\DropDir\DropDir;
use Symfony\Component\Console\Output\ConsoleOutputInterface;

class TaskRunner
{
    protected $dropDir = null;
    protected $output = null;

    public function __construct(
        DropDir $dropDir,
        ConsoleOutputInterface $output
    )
    {
        $this->dropDir = $dropDir;
        $this->output = $output;
    }

    public function run()
    {
        $batches = [];

        foreach ($this->dropDir->getBatches() as $batch)
        {
            $batches[] = $batch->getName();
        }

        asort($batches);

        foreach ($batches as $batchName)
        {
            $this->output->writeln(sprintf('<info>%s</info>', $batchName));
        }
    }
}


text:
namespace Farmhand.UI.Components.Interfaces
{
    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Graphics;

    /// <summary>
    ///     The MenuComponent interface.
    /// </summary>
    public interface IMenuComponent
    {
        /// <summary>
        ///     Gets or sets a value indicating whether visible.
        /// </summary>
        bool Visible { get; set; }

        /// <summary>
        ///     Gets or sets the layer.
        /// </summary>
        int Layer { get; set; }

        /// <summary>
        ///     Gets the parent container.
        /// </summary>
        IComponentContainer Parent { get; }

        /// <summary>
        ///     Called every frame on each component, responsible for updating behavior
        /// </summary>
        /// <param name="t">
        ///     The time elapsed since the previous frame
        /// </param>
        void Update(GameTime t);

        /// <summary>
        ///     Called each frame on each component, responsible for drawing it and it's children
        /// </summary>
        /// <param name="b">
        ///     The sprite batch to use for drawing
        /// </param>
        /// <param name="offset">
        ///     The offset of this component
        /// </param>
        void Draw(SpriteBatch b, Point offset);

        /// <summary>
        ///     Attaches this component to another
        /// </summary>
        /// <param name="collection">
        ///     The collection to attach to
        /// </param>
        void Attach(IComponentContainer collection);

        /// <summary>
        ///     Detaches this component from it's parent
        /// </summary>
        /// <param name="collection">
        ///     Collection to detach from
        /// </param>
        void Detach(IComponentContainer collection);

        /// <summary>
        ///     Gets the position of this component
        /// </summary>
        /// <returns>
        ///     The position of this component as a <see cref="Point" />.
        /// </returns>
        Point GetPosition();

        /// <summary>
        ///     Gets the bounding region of this component
        /// </summary>
        /// <returns>
        ///     The region of this component as a <see cref="Rectangle" />.
        /// </returns>
        Rectangle GetRegion();
    }
}


text:
in order of contribution

* Boris Modylevsky [@borismod](https://github.com/borismod)
* Tomer Cohen [@TCDooM](https://github.com/TCDooM)
* Igor Olikh [@igoro1975](https://github.com/igoro1975)
* Derrick Wood [@asmoran](https://github.com/asmoran)
* sokolovsv90 [@sokolovsv90](https://github.com/sokolovsv90)
* Tomer Admon [@TomerAdmon](https://github.com/TomerAdmon)
* Artem Kuznetsov [@nex-54](https://github.com/nex-54)
* Stephen Brown [@evolvedlight](https://github.com/evolvedlight)
* Tomas Bezouska [@bezysoftware](http://github.com/bezysoftware)
* Pat Hermens [@phermens-coolblue](https://github.com/phermens-coolblue)
* Daniel Dreibrodt [@3breadt](https://github.com/3breadt)


text:
<?xml version="1.0" ?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:sbol="http://sbols.org/v2#" xmlns:igem="http://wiki.synbiohub.org/wiki/Terms/igem#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sbh="http://wiki.synbiohub.org/wiki/Terms/synbiohub#" xmlns:prov="http://www.w3.org/ns/prov#">
  <sbol:CombinatorialDerivation rdf:about="http://michael.zhang/GFP_Reporter_Template_CombinatorialDerivation_Sample/1">
    <sbol:displayId>GFP_Reporter_Template_CombinatorialDerivation_Sample</sbol:displayId>
    <sbol:persistentIdentity rdf:resource="http://michael.zhang/GFP_Reporter_Template_CombinatorialDerivation_Sample"/>
    <sbol:strategy rdf:resource="http://sbols.org/v2#sample"/>
    <sbol:template rdf:resource="http://michael.zhang/GFP_Reporter_Template/1"/>
    <sbol:version>1</sbol:version>
    <sbol:variableComponent>
      <sbol:VariableComponent rdf:about="http://michael.zhang/GFP_Reporter_Template_CombinatorialDerivation_Sample/Pro_Component_VariableComponent/1">
        <sbol:displayId>Pro_Component_VariableComponent</sbol:displayId>
        <sbol:operator rdf:resource="http://sbols.org/v2#zeroOrOne"/>
        <sbol:persistentIdentity rdf:resource="http://michael.zhang/GFP_Reporter_Template_CombinatorialDerivation_Sample/Pro_Component_VariableComponent"/>
        <sbol:variable rdf:resource="http://michael.zhang/GFP_Reporter_Template/Pro_Component/1"/>
        <sbol:variant rdf:resource="https://synbiohub.org/public/igem/BBa_K1545001/1"/>
        <sbol:variant rdf:resource="https://synbiohub.org/public/igem/BBa_K1545000/1"/>
        <sbol:version>1</sbol:version>
      </sbol:VariableComponent>
    </sbol:variableComponent>
  </sbol:CombinatorialDerivation>
</rdf:RDF>


text:
Ext.define('Ifresco.store.TrashCan', {
    extend: 'Ext.data.Store',
    model: 'Ifresco.model.TrashCan',
    autoLoad: true,
    proxy: {
        type: 'ajax',
        url: Routing.generate('ifresco_client_user_trash_can'),
        reader: {
            type: 'json',
            idProperty: 'nodeRef',
            root: 'deletedNodes',
            successProperty : 'success',
            messageProperty : 'message'
        }
    }
});


text:
#include <cat/io/PackageManager.hpp>
using namespace cat;


text:
<?php
// Include class
include_once '../../../../jqSuitePHP_Sources_4_4_4_0/examples/jqform/fileupload/jqformconfig.php';
include_once $CODE_PATH.'jqUtils.php';
include_once $CODE_PATH.'jqForm.php';
// Create instance
$newForm = new jqForm('newForm',array('method' => 'post', 'id' => 'newForm'));
// Demo Mode creating connection
include_once $CODE_PATH.'jqGridPdo.php';
$conn = new PDO(DB_DSN, DB_USER, DB_PASSWORD);
$newForm->setConnection( $conn );
// Set url
$newForm->setUrl($SERVER_HOST.$SELF_PATH.'fileupload.php');
// Set Form header
$formhead='Shipping Details';
$newForm->setFormHeader($formhead,'ui-icon-mail-closed');
// Set parameters
$jqformparams = array();
// Set SQL Command, table, keys
$newForm->table = 'orders';
$newForm->setPrimaryKeys('OrderID');
$newForm->serialKey = true;
// Set Form layout
$newForm->setColumnLayout('twocolumn');
$newForm->setTableStyles('width:580px;','','');
// Add elements
$newForm->addElement('OrderID','hidden', array('label' => 'OrderID', 'id' => 'newForm_OrderID'));
$newForm->addElement('ShipName','text', array('label' => 'Name', 'maxlength' => '40', 'style' => 'width:98%;', 'id' => 'newForm_ShipName'));
$newForm->addElement('ShipAddress','text', array('label' => 'Address', 'maxlength' => '60', 'style' => 'width:98%;', 'id' => 'newForm_ShipAddress'));
$newForm->addElement('ShipCity','text', array('label' => 'City', 'maxlength' => '15', 'size' => '20', 'id' => 'newForm_ShipCity'));
$newForm->addElement('ShipPostalCode','text', array('label' => 'PostalCode', 'maxlength' => '10', 'size' => '20', 'id' => 'newForm_ShipPostalCode'));
$newForm->addElement('ShipCountry','text', array('label' => 'Country', 'maxlength' => '15', 'size' => '20', 'id' => 'newForm_ShipCountry'));
$newForm->addElement('Freight','number', array('label' => 'Freight', 'id' => 'newForm_Freight'));
$newForm->addElement('newFile','file', array('label' => 'Attachment', 'id' => 'newForm_newFile'));
$elem_9[]=$newForm->createElement('newSubmit','submit', array('value' => 'Submit'));
$newForm->addGroup("newGroup",$elem_9, array('style' => 'text-align:right;', 'id' => 'newForm_newGroup'));
// automatic file upload options
$newForm->setUploadOptions('newFile', array(
	'dir'=>'./',		// directory to upload
	'filetypes'=>'',	// allowed file types. if empty all
	'filesize'=>1048576,// bytes 1024*1024 = 1Mb
	'fileprefix'=>''	// add a prefix to the file name
));
// Add events
// Add ajax submit events
$success = <<< SU
function( response, status, xhr) {
$("#demo").html(response);
}
SU;
$newForm->setAjaxOptions( array('dataType'=>null,
'resetForm' =>null,
'clearForm' => null,
'success' =>'js:'.$success,
'iframe' => true,
'forceSync' =>false) );
// Demo mode - no input
$newForm->demo = true;
// Render the form
echo $newForm->renderForm($jqformparams);
?>