text:
/* *****************************************************************************
 *
 * Name:    elm.c
 * Author:  Gabriel Gonzalez
 * Email:   gabeg@bu.edu
 * License: The MIT License (MIT)
 *
 * Description: Display and run the Extensible Login Manager.
 *
 * Notes: None.
 *
 * *****************************************************************************
 */

/* Includes */
#include "elm.h"

/* Private functions */
static void usage(void);

/* Private variables */
typedef struct
{
    int help;
    int verbose;
    int preview;
    int run;
    int logout;
} ElmOptions;

/* ************************************************************************** */
/* Display the Extensible Login Manager  */
int main(int argc, char **argv)
{
    /* Check if no arguments given */
    if (argc == 0) {
        usage();
        exit(ELM_EXIT_SUCCESS);
    }

    /* Command line options */
    static const  char   *shortopts  = "hvpr";
    static struct option  longopts[] = {
        { "help",    no_argument,       0, 'h' },
        { "verbose", no_argument,       0, 'v' },
        { "preview", optional_argument, 0, 'p' },
        { "run",     optional_argument, 0, 'r' },
        { "logout",  optional_argument, 0,  0 },
        { 0,         0,                 0,  0 }
    };

    /* Parse options */
    ElmOptions options = {0};
    int        index   = 0;
    int        c;

    while ((c=getopt_long(argc, argv, shortopts, longopts, &index)) != -1)
    {
        switch (c)
        {
        case 'h':
            usage();
            exit(ELM_EXIT_SUCCESS);

        case 'v':
            options.verbose = 1;
            elm_io_set_verbose(options.verbose);
            break;

        case 'p':
            options.preview = 1;
            sleep(1);
            break;

        case 'r':
            options.run = 1;
            break;

        case 0:
            options.logout = 1;
            elmprintf(LOGWARN, "Logout needs to be implemented. Exiting.");
            exit(5);
            break;

        default:
            elmprintf(LOGERR, "Unknown option specified '%c'. Exiting", c);
            exit(ELM_EXIT_INV_OPT);
        }
    }

    /* Run login manager */
    if (options.run) {
        elmprintf(LOGINFO, "Starting the Extensible Login Manager!");

        ElmLoginManager *manager = elm_login_manager_new();
        manager->set_preview_mode(options.preview);

        return manager->run();
    }

    return 0;
}

/* ************************************************************************** */
/* Print program usage */
void usage(void)
{
    printf("Usage: %s [options]\n", PROGRAM);
    printf("\n");
    printf("Options:\n");
    printf("    -h, --help\n");
    printf("        Print program usage.\n");
    printf("\n");
    printf("    -v, --verbose\n");
    printf("        Verbose output.\n");
    printf("\n");
    printf("    -p, --preview\n");
    printf("        Run login manager in Preview Mode (ignores X window setup).\n");
    printf("\n");
    printf("    -r, --run\n");
    printf("        Run login manager normally.\n");
    printf("\n");
    printf("    --logout\n");
    printf("        Logout of user session.\n");
}


text:
layout: news
post-type: announcement
permalink: /news/2.12.0-M1
title: "Scala 2.12.0-M1 is now available!"
---
We are very pleased to announce the release of Scala 2.12.0-M1!

<!-- To be added:
* Get started with the [Hello Scala 2.11 template](https://typesafe.com/activator/template/hello-scala-2_11) in [Typesafe Activator](https://typesafe.com/platform/getstarted)
-->

* Download a distribution from [scala-lang.org](http://scala-lang.org/download/2.12.0-M1.html)
* Obtain it via [Maven Central](http://search.maven.org/?search%7Cga%7C1%7Cg%3A%22org.scala-lang%22%20AND%20v%3A%222.11.0%22#search%7Cga%7C1%7Cg%3Aorg.scala-lang%20AND%20v%3A2.12.0-M1)

Code that compiles on 2.11.x without deprecation warnings should compile on 2.12.x (we do not guarantee this for experimental APIs, such as reflection).
If not, [please file an issue](https://issues.scala-lang.org).

We are working with the community to ensure availability of the core projects of the Scala 2.12 eco-system.
This release is *not* binary compatible with the 2.11.x series, to allow us to keep improving the Scala standard library.

The Scala 2.12 series targets Java 8.
Programs written in Scala 2.12, including the Scala 2.12 compiler, can only be executed on Java 8 or newer.
Note that the current milestone release (2.12.0-M1) still targets Java 6.

### New Features in the 2.12 Series

Scala 2.12 contains all of the bug fixes and improvements made in the 2.11 series.

At the current stage in the milestone cycle, Scala 2.12 is still very similar to Scala 2.11.

The following changes are planned for Scala 2.12:

* Java 8 style closures.
  The Scala compiler will emit closure classes (lambdas) in the same manner as Java 8.
  The design notes for this feature are available in [this gist](https://gist.github.com/retronym/0178c212e4bacffed568).
* Lambda syntax for SAM types.
  Similar to Java 8, Scala 2.12 allows instantiating any type with one single abstract method by passing a lambda.
  This feature is already avalable in Scala 2.11 using the `-Xexperimental` compiler option.
  It improves the experience of using libraries written for Java 8 in Scala.
* New backend and optimizer.
  The "GenBCode" backend, which is already available in Scala 2.11 using the `-Ybackend:GenBCode` compiler option, will be enabled by default.
  Scala 2.12 will also ship with a new inliner and bytecode optimizer.
  We keep track of issues and work items for the new optimizer on the [scala-opt repostiory issue tracker](https://github.com/scala-opt/scala/issues).

The above list is incomplete and will be extended during the Scala 2.12 milestone cycle.

Up the current milestone, the Scala team and contributors [fixed 47 bugs](https://issues.scala-lang.org/browse/SI-9200?jql=project%20%3D%20SI%20and%20fixVersion%20%3E%3D%20%222.12.0-M1%22%20and%20fixVersion%20%3C%3D%20%222.12.0%22%20and%20resolution%20%3D%20fixed) that are exclusive to Scala 2.12.0.
During the development cycle of Scala 2.12, we will continue to backport issues to 2.11 whenever feasible.
With the release of 2.12.0, backports to 2.11 will be dialed back.

<!-- Notes from 2.11.0
#### Important Changes

For most cases, code that compiled under 2.10.x without deprecation warnings should not be affected. We've verified this by [compiling](https://jenkins-dbuild.typesafe.com:8499/job/Community-2.11.x) a [sizeable number of open source projects](https://github.com/typesafehub/community-builds/blob/master/common-2.11.x.conf#L43).

Changes to the reflection API may cause breakages...

We've decided to fix the following more obscure deviations from specified behavior without deprecating them first.

* [SI-4577](https://issues.scala-lang.org/browse/SI-4577) Compile `x match { case _ : Foo.type => }` to `Foo eq x`, as specified. It used to be `Foo == x` (without warning). If that's what you meant, write `case Foo =>`.
* ...

The following changes were made after a deprecation cycle

* [SI-6809](https://issues.scala-lang.org/browse/SI-6809) Case classes without a parameter list are no longer allowed.
* ...

Finally, some notable improvements and bug fixes:

* [SI-7296](https://issues.scala-lang.org/browse/SI-7296) Case classes with > 22 parameters are now allowed.
*...

#### Deprecations

The following language "warts" have been deprecated:
* [#3746](https://github.com/scala/scala/pull/3746) Generation of bean info classes using the `@BeanInfo` annotation.
Deprecation is closely linked to source and binary compatibility. We say two versions are source compatible when they compile the same programs with the same results. Deprecation requires qualifying this statement: "assuming there are no deprecation warnings". This is what allows us to evolve the Scala platform and keep it healthy. We move slowly to guarantee smooth upgrades, but we want to keep improving as well!
-->

#### Removed Modules

The following modules have been removed from the Scala 2.12 distribution:

* The Scala actors library is no longer released with Scala 2.12.
  We recommend that you use the [Akka actors library](http://akka.io/) instead.
  To migrate your code, follow the [Scala actors migration guide](http://docs.scala-lang.org/overviews/core/actors-migration-guide.html) before upgrading your project to Scala 2.12.
* The Scala distribution archives and the `scala-library-all` maven dependency no longer inlcude Akka actors.
  To use the Akka actors library, add it to your project [as a dependency](http://doc.akka.io/docs/akka/2.3.10/intro/getting-started.html).
* The continuations plugin is no longer shipped with the Scala 2.12 distribution.

#### Contributors

A big thank you to everyone who's helped improve Scala by reporting bugs, improving our documentation, spreading kindness in mailing lists and other public fora, and submitting and reviewing pull requests!
You are all magnificent.

According to `git shortlog -sn --no-merges 2.11.x..v2.12.0-M1`, 33 people contributed to this major release:
Jason Zaugg, Lukas Rytz, A. P. Marki, Rex Kerr, Kato Kazuyoshi, Max Bileschi, jxcoder, François Garillot, rubyu, Adriaan Moors, Dominik Gruntz, Evgeny Vereshchagin, Marc Siegel, Masato Sogame, Simon Ochsenreither, Todd Vierling, Viktor Klang, cchantep, Denton Cockburn, Paolo Giarrusso, Denis Rosset, Roman Hargrave, Rui Gonçalves, Shadaj, harryhuk, Steven Scott, Antoine Gourlay, Aleksandar Prokopec, Lukas Elmer, Erlend Hamnaberg, Maks Atygaev, Malte Isberner, dgruntz.
Thank you!

These release notes are [hosted on GitHub](https://github.com/scala/make-release-notes/blob/2.12.x/hand-written.md) and are continuously updated during the Scala 2.12.0 release cycle.
You are kindly invited to contribute!

### Reporting Bugs

Please file any bugs you encounter on [our issue tracker](https://issues.scala-lang.org).
If you're unsure whether something is a bug, please contact the [scala-user](https://groups.google.com/forum/?fromgroups#!forum/scala-user) mailing list.
Before creating a new issue, search search the issue tracker to see if your bug has already been reported.

### Scala IDE for Eclipse

A release of the Scala IDE for Eclipse for Scala 2.12 will be available together with the release.

Note that for the current milestone (2.12.0-M1), the Scala IDE is not yet available.

<!-- Notes from 2.11.0
The Scala IDE with this release built in is [available from this update site](http://download.scala-ide.org/sdk/helium/e38/scala211/stable/site/) for [Eclipse 4.2/4.3 (Juno/Kepler)](http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/keplersr2). Please have a look at the [getting started guide](http://scala-ide.org/docs/user/gettingstarted.html) for more info.
-->

### Available Projects

Please refer to the list of [libraries and frameworks available for Scala 2.12](https://github.com/scala/make-release-notes/blob/2.12.x/projects-2.12.md).

### Binary Compatibility

Since Sala 2.11, minor releases of Scala are binary compatible.
Scala 2.12 continues this tradition: every 2.12.x release will be binary compatible with 2.12.0.
Note that milestone releases and release candidates are **not** binary compatible with any other release.

#### Definition

When two versions of Scala are binary compatible, it is safe to compile your project on one Scala version and link against another Scala version at run time.
Safe run-time linkage (only!) means that the JVM does not throw a (subclass of) [`LinkageError`](http://docs.oracle.com/javase/7/docs/api/java/lang/LinkageError.html) when executing your program in the mixed scenario, assuming that none arise when compiling and running on the same version of Scala.
Concretely, this means you may have external dependencies on your run-time classpath that use a different version of Scala than the one you're compiling with, as long as they're binary compatibile.
In other words, separate compilation on different binary compatible versions does not introduce problems compared to compiling and running everything on the same version of Scala.

We check binary compatibility automatically with [MiMa](https://github.com/typesafehub/migration-manager).

#### Forwards and Back

We distinguish forwards and backwards compatibility (think of these as properties of a sequence of versions, not of an individual version).
Maintaining backwards compatibility means code compiled on an older version will link with code compiled with newer ones.
Forwards compatibility allows you to compile on new versions and run on older ones.

Thus, backwards compatibility precludes the removal of (non-private) methods, as older versions could call them, not knowing they would be removed, whereas forwards compatibility disallows adding new (non-private) methods, because newer programs may come to depend on them, which would prevent them from running on older versions (private methods are exempted here as well, as their definition and call sites must be in the same compilation unit).

#### Meta

Note that so far we've only talked about the jars generated by scalac for the standard library and reflection.
Our policies do not extend to the meta-issue: ensuring binary compatibility for bytecode generated from identical sources, by different version of scalac?
(The same problem exists for compiling on different JDKs.)
While we strive to achieve this, it's not something we can test in general.
Notable examples where we know meta-binary compatibility is hard to achieve: specialisation and the optimizer.

In short, if binary compatibility of your library is important to you, use [MiMa](https://github.com/typesafehub/migration-manager) to verify compatibility before releasing.
Compiling identical sources with different versions of the Scala compiler (or on different JVM versions!) could result in binary incompatible bytecode.
This is rare, and we try to avoid it, but we can't guarantee it will never happen.

#### Concretely

We guarantee forwards and backwards compatibility of the `"org.scala-lang" % "scala-library" % "2.12.x"` and `"org.scala-lang" % "scala-reflect" % "2.12.x"` artifacts, except for anything under the `scala.reflect.internal` package, as scala-reflect is still experimental.
We also strongly discourage relying on the stability of `scala.concurrent.impl` and `scala.reflect.runtime`, though we will only break compatibility for severe bugs here.

redpajama_set_name: RedPajamaGithub


text:
module.exports = function (bytes, precision) {
  var suffixes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
      factor   = Math.pow(10, precision > 0 ? precision : 2);
  // Using a for loop since it's perfect for this kind of problem
  for (var i = bytes, k = 0; i >= 1024 && k < suffixes.length; i /= 1024, k++) {}
  // Return the number rounded to precision
  return (Math.round(i * factor) / factor) + ' ' + suffixes[k];
};


text:
<?php
namespace Godana\Controller;

use SamUser\Entity\User;
use Doctrine\Common\Persistence\ObjectManager;

use Godana\Entity\File;
use Zend\Stdlib\ResponseInterface as Response;
use Zend\Form\Form;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use ZfcUser\Service\User as UserService;
use ZfcUser\Options\UserControllerOptionsInterface;
use Zend\Stdlib\Parameters;

class MyUserController extends AbstractActionController
{
	const ROUTE_EDIT_ROLE = 'admin/user/role_change';
	const ROUTE_LIST_USER = 'admin/user';
	const ROUTE_EDIT_USER = 'admin/user/edit';
	const ROUTE_ADD_USER = 'admin/user/add';

	// zfcuser controller
	const ROUTE_CHANGEPASSWD = 'zfcuser/changepassword';
    const ROUTE_LOGIN        = 'zfcuser/login';
    const ROUTE_REGISTER     = 'zfcuser/register';
    const ROUTE_ACTIVATION_PENDING = 'zfcuser/activation_pending';
    const ROUTE_ACTIVATION_DONE = 'zfcuser/activation_done';
    const ROUTE_CHANGEEMAIL  = 'zfcuser/changeemail';
    const ROUTE_PROFILE     = 'zfcuser/profile';

    const CONTROLLER_NAME    = 'zfcuser';

	/**
     * @var UserService
     */
    protected $userService;

    /**
     * @var Form
     */
    protected $loginForm;

    /**
     * @var Form
     */
    protected $registerForm;

    /**
     * @var Form
     */
    protected $changePasswordForm;

    /**
     * @var Form
     */
    protected $changeEmailForm;

    /**
	 * @var Form
	 */
	protected $roleForm;

	/**
	 * @var Form
	 */
	protected $userEditForm;

	/**
	 * @var Form
	 */
	protected $userAddForm;

    /**
     * @todo Make this dynamic / translation-friendly
     * @var string
     */
    protected $failedLoginMessage = 'Authentication failed. Please try again.';

    /**
     * @var UserControllerOptionsInterface
     */
    protected $options;

	/**
     * @var ObjectManager
     */
    protected $objectManager;

	/**
     * User page
     */
    public function indexAction()
    {
        if (!$this->zfcUserAuthentication()->hasIdentity()) {
            return $this->redirect()->toRoute(static::ROUTE_LOGIN);
        }

        return new ViewModel();
    }

    public function activationPendingAction()
    {
    	$lang = $this->params()->fromRoute('lang', 'mg');
    	$userId = $this->params()->fromRoute('userId', null);
    	$user = $this->getObjectManager()->getRepository('SamUser\Entity\User')->find($userId);
    	$userMetas = $user->getUserMetas();
        //\Doctrine\Common\Util\Debug::dump($userMetas);
        $token = "";
    	foreach ($userMetas as $userMeta) {
        	if ($userMeta->getMetaKey() == 'token') {
        		$token = $userMeta->getMeta();
        	}
        }

        $serverUrl = $this->getServiceLocator()->get('ViewHelperManager')->get('serverUrl')->__invoke();
        //$basePath = $this->getServiceLocator()->get('ViewHelperManager')->get('basePath')->__invoke();
        $server_url = $serverUrl;

    	$email = $user->getEmail();
    	$activation_link = $server_url . $this->url()->fromRoute(static::ROUTE_ACTIVATION_DONE, array('lang' => $lang));
    	$activation_link .= '?token=' . $token . '&email='.$email;

        $viewTemplate = 'mail/activation';
        $values = array(
			'link' => $activation_link
		);

		$mailService = $this->getServiceLocator()->get('goaliomailservice_message');
		$from = 'tsmakalagy@yahoo.fr';
		$to = $email;
		$subject = 'Godana activation link';
		$message = $mailService->createHtmlMessage($from, $to, $subject, $viewTemplate, $values);
		$mailService->send($message);

    	return new ViewModel();
    }

    public function activationDoneAction()
    {
    	$activation_ttl = 5184000;
    	$token = $this->params()->fromQuery('token', null);
    	$email = $this->params()->fromQuery('email', null);
    	$activation_link_valid = false;
    	$activation_valid = false;
    	$userTokenMeta = '';

    	if ($token != null && $email != null) {
    		$user = $this->getObjectManager()->getRepository('SamUser\Entity\User')->findOneByEmail($email);
    		if ($user instanceof User) {
    			$registerTime = $user->getRegisterTime();
    			if ($registerTime->getTimeStamp() + $activation_ttl > time()) {
    				$activation_link_valid = true;
    			}
    			if ($activation_link_valid) {
    				$userMetas = $user->getUserMetas();
    				$userToken = "";
			        foreach ($userMetas as $userMeta) {
			        	if ($userMeta->getMetaKey() == 'token') {
			        		$userToken = $userMeta->getMeta();
			        		$userTokenMeta = $userMeta;
			        		break;
			        	}
			        }
			        if ($userToken == $token) {
			        	$activation_valid = true;
			        }
    			}
    			if ($activation_valid) {
    				$user->setState(2);
    				$user->removeUserMeta($userTokenMeta);
    				$this->getObjectManager()->remove($userTokenMeta);
    				$this->getObjectManager()->persist($user);
    				$this->getObjectManager()->flush();
    			}

    		}

    	}

    	$this->getServiceLocator()->get('Application')
        	->getEventManager()->attach(\Zend\Mvc\MvcEvent::EVENT_RENDER,
        		function($event){
        			$application = $event->getApplication();
        			$serverUrl = $application->getServiceManager()->get('ViewHelperManager')->get('serverUrl')->__invoke();
        			$router = $event->getRouter();
        			$routeParams = $event->getRouteMatch()->getParams();
        			$lang = $routeParams['lang'];
        			$url = $router->assemble($routeParams, array('name' => 'zfcuser/login'));
        			$url = $serverUrl . $url;
        			$headerLine = "refresh:5;url=" . $url;
     				$event->getResponse()->getHeaders()->addHeaderLine($headerLine);
 				}, -10000);
    	return new ViewModel();
    }

	/**
     * Login form
     */
    public function loginAction()
    {
        if ($this->zfcUserAuthentication()->getAuthService()->hasIdentity()) {
            return $this->redirect()->toRoute($this->getOptions()->getLoginRedirectRoute());
        }
        $lang = $this->params()->fromRoute('lang', 'mg');
        $request = $this->getRequest();
        $form    = $this->getLoginForm();

        if ($this->getOptions()->getUseRedirectParameterIfPresent() && $request->getQuery()->get('redirect')) {
            $redirect = $request->getQuery()->get('redirect');
        } else {
            $redirect = false;
        }
        if (!$request->isPost()) {
            return array(
                'loginForm' => $form,
                'redirect'  => $redirect,
            	'lang' => $lang,
                'enableRegistration' => $this->getOptions()->getEnableRegistration(),
            );
        }

        $form->setData($request->getPost());

        if (!$form->isValid()) {
            $this->flashMessenger()->setNamespace('zfcuser-login-form')->addMessage($this->failedLoginMessage);
            return $this->redirect()->toUrl($this->url()->fromRoute(static::ROUTE_LOGIN, array('lang' => $lang)).($redirect ? '?redirect='.$redirect : ''));
        }

        // clear adapters
        $this->zfcUserAuthentication()->getAuthAdapter()->resetAdapters();
        $this->zfcUserAuthentication()->getAuthService()->clearIdentity();

        return $this->forward()->dispatch(static::CONTROLLER_NAME, array('action' => 'authenticate', 'lang' => $lang));
    }

 	/**
     * Logout and clear the identity
     */
    public function logoutAction()
    {
        $this->zfcUserAuthentication()->getAuthAdapter()->resetAdapters();
        $this->zfcUserAuthentication()->getAuthAdapter()->logoutAdapters();
        $this->zfcUserAuthentication()->getAuthService()->clearIdentity();
		$lang = $this->params()->fromRoute('lang', 'mg');
        $redirect = $this->params()->fromPost('redirect', $this->params()->fromQuery('redirect', false));
        if ($this->getOptions()->getUseRedirectParameterIfPresent() && $redirect) {
            return $this->redirect()->toUrl($redirect);
        }

        return $this->redirect()->toRoute($this->getOptions()->getLogoutRedirectRoute(), array('lang' => $lang));
    }

	/**
     * General-purpose authentication action
     */
    public function authenticateAction()
    {
        if ($this->zfcUserAuthentication()->getAuthService()->hasIdentity()) {
            return $this->redirect()->toRoute($this->getOptions()->getLoginRedirectRoute());
        }

        $adapter = $this->zfcUserAuthentication()->getAuthAdapter();
        $redirect = $this->params()->fromPost('redirect', $this->params()->fromQuery('redirect', false));

		$lang = $this->params()->fromRoute('lang', 'mg');
        $result = $adapter->prepareForAuthentication($this->getRequest());
        // Return early if an adapter returned a response
        if ($result instanceof Response) {
            return $result;
        }

        $auth = $this->zfcUserAuthentication()->getAuthService()->authenticate($adapter);

        $authMessages = $auth->getMessages();

        if (!$auth->isValid()) {
			$this->flashMessenger()->setNamespace('zfcuser-login-form')->addMessage($authMessages[0]);
            $adapter->resetAdapters();
            return $this->redirect()->toUrl($this->url()->fromRoute(static::ROUTE_LOGIN, array('lang' => $lang))
                . ($redirect ? '?redirect='.$redirect : ''));
        }

        if ($this->getOptions()->getUseRedirectParameterIfPresent() && $redirect) {
            return $this->redirect()->toUrl($redirect);
        }
        return $this->redirect()->toRoute($this->getOptions()->getLoginRedirectRoute(), array('lang' => $lang));
    }

	/**
     * Register new user
     */
    public function registerAction()
    {
        // if the user is logged in, we don't need to register
        if ($this->zfcUserAuthentication()->hasIdentity()) {
            // redirect to the login redirect route
            return $this->redirect()->toRoute($this->getOptions()->getLoginRedirectRoute());
        }
        // if registration is disabled
        if (!$this->getOptions()->getEnableRegistration()) {
            return array('enableRegistration' => false);
        }
        $lang = $this->params()->fromRoute('lang', 'mg');
        $request = $this->getRequest();
        $service = $this->getUserService();
        $form = $this->getRegisterForm();

        if ($this->getOptions()->getUseRedirectParameterIfPresent() && $request->getQuery()->get('redirect')) {
            $redirect = $request->getQuery()->get('redirect');
        } else {
            $redirect = false;
        }

        $redirectUrl = $this->url()->fromRoute(static::ROUTE_REGISTER, array('lang' => $lang))
            . ($redirect ? '?redirect=' . $redirect : '');
        $prg = $this->prg($redirectUrl, true);
        if ($prg instanceof Response) {
            return $prg;
        } elseif ($prg === false) {
            return array(
                'registerForm' => $form,
            	'lang' => $lang,
                'enableRegistration' => $this->getOptions()->getEnableRegistration(),
                'redirect' => $redirect,
            );
        }

        $post = $prg;
        $user = $service->register($post);
        $redirect = isset($prg['redirect']) ? $prg['redirect'] : null;

        if (!$user) {
            return array(
                'registerForm' => $form,
            	'lang' => $lang,
                'enableRegistration' => $this->getOptions()->getEnableRegistration(),
                'redirect' => $redirect,
            );
        }

        if ($service->getOptions()->getLoginAfterRegistration()) {
            $identityFields = $service->getOptions()->getAuthIdentityFields();
            if (in_array('email', $identityFields)) {
                $post['identity'] = $user->getEmail();
            } elseif (in_array('username', $identityFields)) {
                $post['identity'] = $user->getUsername();
            }
            $post['credential'] = $post['password'];
            $post['redirect'] = $redirect;
            $request->setPost(new Parameters($post));
            return $this->forward()->dispatch(static::CONTROLLER_NAME, array('action' => 'authenticate'));
        }

        // TODO: Add the redirect parameter here...
//        return $this->redirect()->toUrl($this->url()->fromRoute(static::ROUTE_LOGIN) . ($redirect ? '?redirect='.$redirect : ''));
		$userId = $user->getId();

        return $this->redirect()->toRoute(static::ROUTE_ACTIVATION_PENDING, array('lang' => $lang, 'userId' => $userId));
    }

    public function validateInputAjaxAction()
    {
		$form = $this->getRegisterForm();
		$request = $this->getRequest();

		if ($request->isPost()) {
			// Default validators are added to the input filter
			$input_filter = $form->getInputFilter();

			// 'my_form_element' is the name of an element in the form
			$input_name = $request->getPost('name');

			if ($input_name != 'passwordVerify') {
				$input_element = $input_filter->get($input_name);

				// Set the value to validate against
				$input_element->setValue($request->getPost($input_name));

				// Check if the provided value is not valid
				if (!$input_element->isValid()) {
					// Element value is not valid
					$result['success'] = false;
					$messages = $input_element->getMessages();
					$error_message = '';
					foreach ($messages as $message) {
						$error_message .= '
'.$message.'
';
					}
					$data = array(
				        'success' => false,
				        'error_msg' => $error_message
				    );
				    return $this->getResponse()->setContent(\Zend\Json\Json::encode($data));
				} else {
					$result['success'] = false;
					$data = array(
				        'success' => true,
				    );
				    return $this->getResponse()->setContent(\Zend\Json\Json::encode($data));
				}
			} else {
				$form->setValidationGroup(array('passwordVerify'));

				$password = $request->getPost('password');
				$passwordVerify = $request->getPost('passwordVerify');

				$data['password'] = $password;
				$data['passwordVerify'] = $passwordVerify;

				$form->setData($data);

				// Check if the provided value is not valid
				if (!$form->isValid()) {
					$result['success'] = false;
					$messages = $form->get('passwordVerify')->getMessages();
					$error_message = '';
					foreach ($messages as $message) {
						$error_message .= '
'.$message.'
';
					}
					$data = array(
				        'success' => false,
				        'error_msg' => $error_message
				    );
				    return $this->getResponse()->setContent(\Zend\Json\Json::encode($data));
				} else {
					$result['success'] = false;
					$data = array(
				        'success' => true,
				    );
				    return $this->getResponse()->setContent(\Zend\Json\Json::encode($data));
				}
			}

		}
    }

	/**
     * Edit user profile
     */
    public function profileAction()
    {
    	// if the user isn't logged in, we can't change profile
        if (!$this->zfcUserAuthentication()->hasIdentity()) {
            // redirect to the login redirect route
            return $this->redirect()->toRoute($this->getOptions()->getLoginRedirectRoute());
        }
        $service = $this->getUserService();
        $currentUser = $service->getAuthService()->getIdentity();
        $form = $this->getProfileForm();
        $fileForm = $this->getFileForm();
        //$form->bind($currentUser);
        $lang = $this->params()->fromRoute('lang', 'mg');

		$form->setHydrator($service->getFormHydrator());

        $data['firstname'] = $currentUser->getFirstname();
        $data['lastname'] = $currentUser->getLastname();
        $data['username'] = $currentUser->getUsername();
        if ($currentUser->getDateofbirth()) {
        	$data['dateofbirth'] = $currentUser->getDateofbirth()->format('m/d/Y');
        }
        $data['sex'] = $currentUser->getSex();
        $data['email'] = $currentUser->getEmail();
        $form->setData($data);
        $prg = $this->prg(static::ROUTE_PROFILE);
        $fm = $this->flashMessenger()->setNamespace('profile')->getMessages();
        if (isset($fm[0])) {
            $status = $fm[0];
        } else {
            $status = null;
        }

        if ($prg instanceof Response) {
            return $prg;
        } elseif ($prg === false) {
            return array(
                'status' => $status,
            	'enableRegistration' => $this->getOptions()->getEnableRegistration(),
                'profileForm' => $form,
            	'fileForm' => $fileForm,
            	'lang' => $lang,
            );
        }
        $form->setData($prg);
        if (!$form->isValid()) {
            return array(
                'status' => false,
            	'enableRegistration' => $this->getOptions()->getEnableRegistration(),
                'profileForm' => $form,
            	'fileForm' => $fileForm,
            	'lang' => $lang,
            );
        }

        if (!$this->getUserService()->editProfile($form->getData())) {
            return array(
                'status' => false,
            	'enableRegistration' => $this->getOptions()->getEnableRegistration(),
                'profileForm' => $form,
            	'fileForm' => $fileForm,
            	'lang' => $lang,
            );
        }

        $this->flashMessenger()->setNamespace('profile')->addMessage(true);
        return $this->redirect()->toUrl($this->url()->fromRoute(static::ROUTE_PROFILE, array('lang' => $lang)));
    }

	/**
     * Change the users password
     */
    public function changepasswordAction()
    {
        // if the user isn't logged in, we can't change password
        if (!$this->zfcUserAuthentication()->hasIdentity()) {
            // redirect to the login redirect route
            return $this->redirect()->toRoute($this->getOptions()->getLoginRedirectRoute());
        }

        $form = $this->getChangePasswordForm();
        $prg = $this->prg(static::ROUTE_CHANGEPASSWD);
		$lang = $this->params()->fromRoute('lang', 'mg');

        $fm = $this->flashMessenger()->setNamespace('change-password')->getMessages();
        if (isset($fm[0])) {
            $status = $fm[0];
        } else {
            $status = null;
        }

        if ($prg instanceof Response) {
            return $prg;
        } elseif ($prg === false) {
            return array(
                'status' => $status,
                'changePasswordForm' => $form,
            	'lang' => $lang,
            );
        }

        $form->setData($prg);

        if (!$form->isValid()) {
            return array(
                'status' => false,
                'changePasswordForm' => $form,
            	'lang' => $lang,
            );
        }

        if (!$this->getUserService()->changePassword($form->getData())) {
            return array(
                'status' => false,
                'changePasswordForm' => $form,
            	'lang' => $lang,
            );
        }

        $this->flashMessenger()->setNamespace('change-password')->addMessage(true);
        return $this->redirect()->toRoute(static::ROUTE_CHANGEPASSWD);
    }

    public function changeEmailAction()
    {
        // if the user isn't logged in, we can't change email
        if (!$this->zfcUserAuthentication()->hasIdentity()) {
            // redirect to the login redirect route
            return $this->redirect()->toRoute($this->getOptions()->getLoginRedirectRoute());
        }

        $form = $this->getChangeEmailForm();
        $request = $this->getRequest();
        $request->getPost()->set('identity', $this->getUserService()->getAuthService()->getIdentity()->getEmail());

        $fm = $this->flashMessenger()->setNamespace('change-email')->getMessages();
        if (isset($fm[0])) {
            $status = $fm[0];
        } else {
            $status = null;
        }

        $prg = $this->prg(static::ROUTE_CHANGEEMAIL);
        if ($prg instanceof Response) {
            return $prg;
        } elseif ($prg === false) {
            return array(
                'status' => $status,
                'changeEmailForm' => $form,
            );
        }

        $form->setData($prg);

        if (!$form->isValid()) {
            return array(
                'status' => false,
                'changeEmailForm' => $form,
            );
        }

        $change = $this->getUserService()->changeEmail($prg);

        if (!$change) {
            $this->flashMessenger()->setNamespace('change-email')->addMessage(false);
            return array(
                'status' => false,
                'changeEmailForm' => $form,
            );
        }

        $this->flashMessenger()->setNamespace('change-email')->addMessage(true);
        return $this->redirect()->toRoute(static::ROUTE_CHANGEEMAIL);
    }

	public function uploadAjaxAction()
 	{
        $uploadhandler = $this->getServiceLocator()->get('user_upload_handler');
        return $this->getResponse();

 	}

	public function listAction()
	{
		$this->layout('layout/sb-admin-layout');
 		$this->layout()->user_active = 'active';
 		$lang = $this->params()->fromRoute('lang', 'mg');
		$om = $this->getObjectManager();
		$users = $om->getRepository('SamUser\Entity\User')->findAll();
		return array(
			'users' => $users,
			'lang' => $lang,
		);
	}

	public function editUserAction()
	{
		$this->layout('layout/sb-admin-layout');
 		$this->layout()->user_active = 'active';
		$om = $this->getObjectManager();
		$lang = $this->params()->fromRoute('lang', 'mg');
		$userId = $this->params()->fromRoute('userId', null);

		$form = $this->getUserEditForm();

		if ($userId != null) {
			$user = $om->getRepository('SamUser\Entity\User')->find($userId);
			$form->bind($user);
			$dob = $user->getDateofbirth();
			if (isset($dob)) {
				$form->get('user-form')->get('dateofbirth')->setValue($dob->format('m/d/Y'));
			}

			$url = $this->url()->fromRoute(static::ROUTE_EDIT_USER, array('lang' => $lang, 'userId' => $userId));
		    $prg = $this->prg($url, true);
	        if ($prg instanceof Response) {
	            return $prg;
	        } elseif ($prg === false) {
	            return array(
			    	'userEditForm' => $form,
	            	'lang' => $lang,
	            	'user' => $user,
			    );
	        }
	        $post = $prg;
	        $form->setData($post);
			if ($form->isValid()) {
	     		$om->persist($user);
	            $om->flush();
				return $this->redirect()->toUrl($this->url()->fromRoute(static::ROUTE_LIST_USER, array('lang' => $lang)));
	        }
		}
		return array(
	    	'userEditForm' => $form,
            'lang' => $lang,
            'user' => $user,
	    );
	}

	public function addUserAction()
	{
		$this->layout('layout/sb-admin-layout');
 		$this->layout()->user_active = 'active';
		$om = $this->getObjectManager();
		$lang = $this->params()->fromRoute('lang', 'mg');

		$form = $this->getUserAddForm();
		$service = $this->getUserService();

		$url = $this->url()->fromRoute(static::ROUTE_ADD_USER, array('lang' => $lang));
	    $prg = $this->prg($url, true);
        if ($prg instanceof Response) {
            return $prg;
        } elseif ($prg === false) {
            return array(
		    	'addUserForm' => $form,
            	'lang' => $lang,
		    );
        }
        $post = $prg;
        $user = $service->register($post);
        if (!$user) {
        	return array(
		    	'addUserForm' => $form,
	            'lang' => $lang,
		    );
        }

	    return $this->redirect()->toUrl($this->url()->fromRoute(static::ROUTE_LIST_USER, array('lang' => $lang)));
	}

	public function changeRoleAction()
	{
		$this->layout('layout/sb-admin-layout');
 		$this->layout()->user_active = 'active';
		$om = $this->getObjectManager();
		$lang = $this->params()->fromRoute('lang', 'mg');
		$userId = $this->params()->fromRoute('userId', null);

		$form = $this->getRoleForm();

		if ($userId != null) {
			$user = $om->getRepository('SamUser\Entity\User')->find($userId);
			$form->bind($user);
			$url = $this->url()->fromRoute(static::ROUTE_EDIT_ROLE, array('lang' => $lang, 'userId' => $userId));
		    $prg = $this->prg($url, true);

	        if ($prg instanceof Response) {
	            return $prg;
	        } elseif ($prg === false) {
	            return array(
			    	'userRoleForm' => $form,
	            	'lang' => $lang,
	            	'user' => $user,
			    );
	        }
	        $post = $prg;
	        $form->setData($post);
			if ($form->isValid()) {
	     		$om->persist($user);
	            $om->flush();
				return $this->redirect()->toUrl($this->url()->fromRoute(static::ROUTE_LIST_USER, array('lang' => $lang)));
	        }
		}
		return array(
	    	'userRoleForm' => $form,
			'lang' => $lang,
			'user' => $user,
	    );
	}

	public function getRegisterForm()
    {
        if (!$this->registerForm) {
            $this->setRegisterForm($this->getServiceLocator()->get('zfcuser_register_form'));
        }
        return $this->registerForm;
    }

    public function setRegisterForm(Form $registerForm)
    {
        $this->registerForm = $registerForm;
    }

	public function getProfileForm()
    {
        if (!$this->profileForm) {
            $this->setProfileForm($this->getServiceLocator()->get('zfcuser_profile_form'));
        }
        return $this->profileForm;
    }

    public function setProfileForm(Form $profileForm)
    {
        $this->profileForm = $profileForm;
    }

    public function getLoginForm()
    {
        if (!$this->loginForm) {
            $this->setLoginForm($this->getServiceLocator()->get('zfcuser_login_form'));
        }
        return $this->loginForm;
    }

    public function setLoginForm(Form $loginForm)
    {
        $this->loginForm = $loginForm;
        $fm = $this->flashMessenger()->setNamespace('zfcuser-login-form')->getMessages();
        if (isset($fm[0])) {
            $this->loginForm->setMessages(
                array('identity' => array($fm[0]))
            );
        }
        return $this;
    }

    public function getChangePasswordForm()
    {
        if (!$this->changePasswordForm) {
            $this->setChangePasswordForm($this->getServiceLocator()->get('zfcuser_change_password_form'));
        }
        return $this->changePasswordForm;
    }

    public function setChangePasswordForm(Form $changePasswordForm)
    {
        $this->changePasswordForm = $changePasswordForm;
        return $this;
    }

    /**
     * set options
     *
     * @param UserControllerOptionsInterface $options
     * @return UserController
     */
    public function setOptions(UserControllerOptionsInterface $options)
    {
        $this->options = $options;
        return $this;
    }

    /**
     * get options
     *
     * @return UserControllerOptionsInterface
     */
    public function getOptions()
    {
        if (!$this->options instanceof UserControllerOptionsInterface) {
            $this->setOptions($this->getServiceLocator()->get('zfcuser_module_options'));
        }
        return $this->options;
    }

    /**
     * Get changeEmailForm.
     *
     * @return changeEmailForm.
     */
    public function getChangeEmailForm()
    {
        if (!$this->changeEmailForm) {
            $this->setChangeEmailForm($this->getServiceLocator()->get('zfcuser_change_email_form'));
        }
        return $this->changeEmailForm;
    }

    /**
     * Set changeEmailForm.
     *
     * @param changeEmailForm the value to set.
     */
    public function setChangeEmailForm($changeEmailForm)
    {
        $this->changeEmailForm = $changeEmailForm;
        return $this;
    }

    public function getFileForm()
    {
        if (!$this->fileForm) {
            $this->setFileForm($this->getServiceLocator()->get('file_form'));
        }
        return $this->fileForm;
    }

    public function setFileForm(Form $fileForm)
    {
        $this->fileForm = $fileForm;
    }

	public function getRoleForm()
	{
		if (!$this->roleForm) {
            $this->setRoleForm($this->getServiceLocator()->get('user_role_form'));
        }
		return $this->roleForm;
	}

	public function setRoleForm(Form $roleForm)
	{
		$this->roleForm = $roleForm;
	}

	public function getUserEditForm()
	{
		if (!$this->userEditForm) {
            $this->setUserEditForm($this->getServiceLocator()->get('user_edit_form'));
        }
		return $this->userEditForm;
	}

	public function setUserEditForm(Form $userEditForm)
	{
		$this->userEditForm = $userEditForm;
	}

	public function getUserAddForm()
	{
		if (!$this->userAddForm) {
            $this->setUserAddForm($this->getServiceLocator()->get('user_add_form'));
        }
		return $this->userAddForm;
	}

	public function setUserAddForm(Form $userAddForm)
	{
		$this->userAddForm = $userAddForm;
	}

	public function getObjectManager()
    {
    	return $this->getServiceLocator()->get('Doctrine\ORM\EntityManager');
    }

    public function setObjectManager($objectManager)
    {
    	$this->objectManager = $objectManager;
    }

	public function getUserService()
    {
        if (!$this->userService) {
            $this->userService = $this->getServiceLocator()->get('zfcuser_user_service');
        }
        return $this->userService;
    }

    public function setUserService(UserService $userService)
    {
        $this->userService = $userService;
        return $this;
    }
}


text:
<!DOCTYPE html>

    <title>Strophe.js Basic Example</title>

      <form name='cred'>
        JID:
        <input type='text' id='jid'>
        Password:
        <input type='password' id='pass'>
        <input type='button' id='connect' value='connect'>
      </form>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>JSDoc: Source: index.js</title>

    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">

Source: index.js

'use strict';

const ClientRegister = require('./lib/client-register');
const ClientMessager = require('./lib/client-messager');
const HTTP           = require('http');
const Initializers   = require('./initializers');
const Logger         = require('./lib/logger');
const Teamster       = require('teamster');
const WSServer       = require('ws').Server;
const app            = require('koa')();

/**
 * A collection of private functions, run automatically when the app starts, for
 * creating our Koa app and HTTP and WS servers.
 *
 * @module Main
 */

Initializers.start()
  .then(createTeamster)
  .catch(err => { throw err; });

/**
 * Start 1 or more web processes running our app.
 *
 * @private
 */
function createTeamster() {
  Teamster.run(startServers, {
    fork      : process.env.NODE_ENV === 'production',
    numWorkers: parseInt(process.env.NUM_WORKERS, 10) || 1,
  });
}

/**
 * Start HTTP and WS servers for our app.
 *
 * @private
 */
function startServers() {
  const port = parseInt(process.env.PORT, 10) || 5000;

  HTTP.createServer(app.callback()).listen(port, () => {
    Logger.log({ event: `HTTP server listening on port ${port}` });
    startWSServer(this);
  });
}

/**
 * Start a WS server for handling WebSocket connections.
 *
 * @private
 * @param {HTTP.Server} httpServer The httpServer to attach the WS server to
 */
function startWSServer(httpServer) {
  const wsServer = new WSServer({ server: httpServer });
  wsServer.on('connection', onConnection);
}

/**
 * Handle a newly connected WebSocket connection
 *
 * @private
 * @param {WS.WebSocket} socket The new WebSocket connection
 */
function onConnection(socket) {
  const requestID = socket.upgradeReq.headers['x-request-id'];

  socket.pingInterval = setInterval(() => {
    socket.send(JSON.stringify({ ping: true }));
  }, 30000);

  ClientRegister.registerClient(socket).then(client => {
    Logger.clientLog(client, { event: 'New WebSocket client connected' });
    client.socket.on('close', () => onClose(client));
    client.socket.on('message', message => onMessage(client, message));
  }).catch(err => {
    ClientMessager.error({ socket: socket }, 'Error when joining new client');
    Logger.log({ request_id: requestID, event: 'Could not create new client' });
    Logger.error(err);
    socket.close();
  });
}

/**
 * Handle a message sent by a client.
 *
 * @private
 * @param {Client} client The client that sent the message
 * @param {string} message The message sent by the client
 */
function onMessage(client, message) {
  try {
    message = JSON.parse(message);
  } catch(err) {
    Logger.error(err);
    ClientMessager.error(client, 'Unparsable message sent');
    return;
  }

  if (message.action !== 'ping') {
    const err = `Unrecognized action sent: ${message.action}`;
    Logger.clientLog(client, { event: err });
    ClientMessager.error(client, err);
    return;
  }

  ClientRegister.renewClient(client);
}

/**
 * Handle a client's socket closing.
 *
 * @private
 * @param {Client} client The client whose socket has closed.
 */
function onClose(client) {
  clearInterval(client.socket.pingInterval);
  Logger.clientLog(client, { event: 'Client closed socket connection' });
  ClientRegister.deregisterClient(client);
}

Home

Modules

Client

ClientMessager

ClientRegister

Initializers

Logger

Main

Observer

Redis

Global

configureRedis

startObserver

    Documentation generated by JSDoc 3.3.0


text:
namespace LastfmScrobbler.Models.Responses
{
    using System.Runtime.Serialization;

    [DataContract]
    public class ScrobbleResponse : BaseResponse
    {
        [DataMember(Name = "scrobbles")]
        public Scrobbles Scrobbles { get; set; }
    }
}


text:
from __future__ import print_function
from datetime import datetime
import os
import numpy as np

class GraphCNNKeys(object):
    TRAIN_SUMMARIES = "train_summaries"
    TEST_SUMMARIES = "test_summaries"

class GraphCNNGlobal(object):
    BN_DECAY = 0.999
    GRAPHCNN_INIT_FACTOR = 1.
    GRAPHCNN_I_FACTOR = 1.0

def print_ext(*args):
    print(str(datetime.now()), *args)

def verify_dir_exists(dirname):
    if os.path.isdir(os.path.dirname(dirname)) == False:
        os.makedirs(os.path.dirname(dirname))

def get_node_mask(graph_size, max_size=None):
    if max_size == None:
        max_size = np.max(graph_size)
    return np.array([np.pad(np.ones([s, 1]), ((0, max_size-s), (0, 0)), 'constant', constant_values=(0)) for s in graph_size], dtype=np.float32)

def _tf_print(*args):
    for i in range(len(args)):
        print(args[i].shape)
        print(args[i])
    return args

def make_print(*args):
    import tensorflow as tf

    result = tf.py_func(_tf_print, args, [ s.dtype for s in args])
    for i in range(len(args)):
        result[i].set_shape(args[i].get_shape())
    return result


text:
package io.ByteArrayOutputStream;

import java.io.*;

class ByteArrayOutputStreamDemo {
	public static void main(String args[]) {
		ByteArrayOutputStream f = new ByteArrayOutputStream();
		String s = "This should end up in the array";
		byte buf[] = s.getBytes();

		try {
			f.write(buf);
		} catch (IOException e) {
			System.out.println("Error Writing to Buffer");
			return;
		}

		System.out.println("Buffer as a string");
		System.out.println(f.toString());
		System.out.println("Into array");
		byte b[] = f.toByteArray();
		for (int i=0; i<b.length; i++) System.out.print((char) b[i]);

		System.out.println("\nTo an OutStream()");

		try (FileOutputStream f2 = new FileOutputStream("test.txt"))
		{
			f.writeTo(f2);
		} catch (IOException e) {
			System.out.println("I/O Error: " + e);
			return;
		}

		System.out.println("Dound a reset");
		f.reset();

		for (int i=0; i<=4; i++) f.write('X');
		System.out.println(f.toString());
	}
}


text:
package net.sf.jailer.ui;

import java.awt.Color;
import java.net.URI;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;

import net.sf.jailer.ui.DbConnectionDialog.ConnectionInfo;

/**
 * "Connect with DB" dialog.
 *
 * @author Ralf Wisser
 */
public class DbConnectionDetailsEditor extends javax.swing.JDialog {

	/**
	 * true if valid connection is available.
	 */
	private boolean isOk = false;

	/**
	 * The connection to edit.
	 */
	private ConnectionInfo ci;

	/**
     * Opens detail editor for a connection.
     *
     * @param ci the connection
     * @return true if connection has been edited
     */
	public boolean edit(ConnectionInfo ci) {
		this.ci = ci;
		alias.setText(ci.alias);
		dbUrl.setText(ci.url);
		user.setText(ci.user);
		password.setText(ci.password);
		driverClass.setText(ci.driverClass);
		jar1.setText(ci.jar1);
		jar2.setText(ci.jar2);
		setVisible(true);
		return isOk;
	}

    /** Creates new form DbConnectionDialog
     * @param forNew */
    public DbConnectionDetailsEditor(java.awt.Frame parent, final String jdbcHelpURL, boolean forNew) {
        super(parent, true);
        initComponents();
        if (forNew) {
        	UIUtil.replace(infoBarLabel, new InfoBar("New Connection",
        			"Enter connection credentials for the database.\n" +
        			"Replace placeholders (\"<...>\") with appropriate URL parameters."));
        } else {
        	UIUtil.replace(infoBarLabel, new InfoBar("Edit Connection",
        			"Edit connection credentials for the database."));
        }
        setLocation(120, 170);
        load1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                String fn = UIUtil.choseFile(null, ".", "Jdbc Driver", ".jar", DbConnectionDetailsEditor.this, true, true);
                if (fn != null) {
                    jar1.setText(fn);
                }
            }
        });
        load2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                String fn = UIUtil.choseFile(null, ".", "Jdbc Driver", ".jar", DbConnectionDetailsEditor.this, true, true);
                if (fn != null) {
                    jar2.setText(fn);
                }
            }
        });
        load1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
            	load1.setEnabled(false);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
            	load1.setEnabled(true);
           }
        });
        load2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
            	load2.setEnabled(false);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
            	load2.setEnabled(true);
           }
        });
        helpjdbc.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
            	helpjdbc.setEnabled(false);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
            	helpjdbc.setEnabled(true);
           }
        });
        helpjdbc.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
            	try {
            		BrowserLauncher.openURL(new URI(jdbcHelpURL));
            	} catch (Exception e) {
            		UIUtil.showException(DbConnectionDetailsEditor.this, "Error", e);
            	}
            }
		});
        helpjdbc.setIcon(helpIcon);
        helpjdbc.setText(null);
        load1.setIcon(loadIcon);
        load1.setText(null);
        load2.setIcon(loadIcon);
        load2.setText(null);
        pack();
        setSize(Math.max(570, getWidth()), getHeight());
        UIUtil.initPeer();
 	}

	/** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jar1 = new javax.swing.JTextField();
        jar2 = new javax.swing.JTextField();
        driverClass = new javax.swing.JTextField();
        dbUrl = new javax.swing.JTextField();
        user = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        okButton = new javax.swing.JButton();
        cancelButton = new javax.swing.JButton();
        testConnectionButton = new javax.swing.JButton();
        jLabel11 = new javax.swing.JLabel();
        password = new javax.swing.JPasswordField();
        load1 = new javax.swing.JLabel();
        helpjdbc = new javax.swing.JLabel();
        load2 = new javax.swing.JLabel();
        alias = new javax.swing.JTextField();
        infoBarLabel = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Database Connection");
        getContentPane().setLayout(new java.awt.CardLayout());

        jPanel1.setLayout(new java.awt.GridBagLayout());

        jLabel1.setText(" Alias ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 10;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanel1.add(jLabel1, gridBagConstraints);

        jLabel2.setText(" JDBC Driver JAR ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 20;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanel1.add(jLabel2, gridBagConstraints);

        jLabel3.setText(" secondary JAR ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 40;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanel1.add(jLabel3, gridBagConstraints);

        jLabel4.setText(" ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridy = 15;
        jPanel1.add(jLabel4, gridBagConstraints);

        jLabel5.setText(" ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 45;
        jPanel1.add(jLabel5, gridBagConstraints);

        jLabel6.setText(" Driver-Class");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 50;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanel1.add(jLabel6, gridBagConstraints);

        jLabel7.setText(" DB-URL");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 60;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanel1.add(jLabel7, gridBagConstraints);

        jLabel8.setText(" User");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 70;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanel1.add(jLabel8, gridBagConstraints);

        jLabel9.setText(" Password");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 80;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanel1.add(jLabel9, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 20;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.weightx = 1.0;
        jPanel1.add(jar1, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 40;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.weightx = 1.0;
        jPanel1.add(jar2, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 50;
        gridBagConstraints.gridwidth = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.weightx = 1.0;
        jPanel1.add(driverClass, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 60;
        gridBagConstraints.gridwidth = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.weightx = 1.0;
        jPanel1.add(dbUrl, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 70;
        gridBagConstraints.gridwidth = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.weightx = 1.0;
        jPanel1.add(user, gridBagConstraints);

        jPanel2.setLayout(new java.awt.GridBagLayout());

        okButton.setText(" Ok ");
        okButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                okButtonActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHEAST;
        gridBagConstraints.insets = new java.awt.Insets(4, 4, 0, 4);
        jPanel2.add(okButton, gridBagConstraints);

        cancelButton.setText(" Cancel ");
        cancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelButtonActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHEAST;
        gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 0);
        jPanel2.add(cancelButton, gridBagConstraints);

        testConnectionButton.setText(" Test Connection ");
        testConnectionButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                testConnectionButtonActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHEAST;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(4, 4, 0, 12);
        jPanel2.add(testConnectionButton, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 100;
        gridBagConstraints.gridwidth = 4;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        jPanel1.add(jPanel2, gridBagConstraints);

        jLabel11.setText(" ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 10;
        gridBagConstraints.gridy = 10;
        jPanel1.add(jLabel11, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 80;
        gridBagConstraints.gridwidth = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.weighty = 1.0;
        jPanel1.add(password, gridBagConstraints);

        load1.setText("load");
        load1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 20;
        gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 0);
        jPanel1.add(load1, gridBagConstraints);

        helpjdbc.setText("help");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 20;
        gridBagConstraints.insets = new java.awt.Insets(0, 4, 0, 4);
        jPanel1.add(helpjdbc, gridBagConstraints);

        load2.setText("load");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 40;
        gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 0);
        jPanel1.add(load2, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 10;
        gridBagConstraints.gridwidth = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.weightx = 1.0;
        jPanel1.add(alias, gridBagConstraints);

        infoBarLabel.setText("info bar");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.gridwidth = 11;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 12, 0);
        jPanel1.add(infoBarLabel, gridBagConstraints);

        getContentPane().add(jPanel1, "card2");

        pack();
    }// </editor-fold>//GEN-END:initComponents

   private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
    	if (fillConnectionInfo()) {
       		isOk = true;
       		setVisible(false);
        }
    }//GEN-LAST:event_okButtonActionPerformed

   	@SuppressWarnings("deprecation")
	private boolean fillConnectionInfo() {
		boolean ok = true;
        Color red = new Color(255, 200, 180);
		if (alias.getText().trim().length() == 0) {
        	alias.setBackground(red);
        	ok = false;
        }
        if (driverClass.getText().trim().length() == 0) {
        	driverClass.setBackground(red);
        	ok = false;
        }
        if (dbUrl.getText().trim().length() == 0) {
        	dbUrl.setBackground(red);
        	ok = false;
        }
        if (ok) {
        	ci.alias = alias.getText().trim();
        	ci.driverClass = driverClass.getText().trim();
        	ci.jar1 = jar1.getText().trim();
        	ci.jar2 = jar2.getText().trim();
        	ci.url = dbUrl.getText().trim();
        	ci.user = user.getText().trim();
        	ci.password = password.getText().trim();
        }
        return ok;
	}

    private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
        setVisible(false);
    }//GEN-LAST:event_cancelButtonActionPerformed

    private void testConnectionButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_testConnectionButtonActionPerformed
        if (fillConnectionInfo()) {
        	if (DbConnectionDialog.testConnection(this, ci)) {
        		JOptionPane.showMessageDialog(this, "Successfully established connection.", "Connected", JOptionPane.INFORMATION_MESSAGE);
        	}
        }
    }//GEN-LAST:event_testConnectionButtonActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JTextField alias;
    private javax.swing.JButton cancelButton;
    public javax.swing.JTextField dbUrl;
    public javax.swing.JTextField driverClass;
    private javax.swing.JLabel helpjdbc;
    private javax.swing.JLabel infoBarLabel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JTextField jar1;
    private javax.swing.JTextField jar2;
    private javax.swing.JLabel load1;
    private javax.swing.JLabel load2;
    private javax.swing.JButton okButton;
    private javax.swing.JPasswordField password;
    private javax.swing.JButton testConnectionButton;
    public javax.swing.JTextField user;
    // End of variables declaration//GEN-END:variables

	private Icon helpIcon;
	private Icon loadIcon;
	{
		String dir = "/net/sf/jailer/resource";

		// load images
		try {
			helpIcon = new ImageIcon(getClass().getResource(dir + "/help.png"));
		} catch (Exception e) {
			e.printStackTrace();
		}
		try {
			loadIcon = new ImageIcon(getClass().getResource(dir + "/load.png"));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private static final long serialVersionUID = -492511696901313920L;
}


text:
from __future__ import absolute_import
from quixote.errors import TraversalError, AccessError
from vilya.libs.template import st

_q_exports = []

def __call__(request):
    return _q_index(request)

def _q_index(request):
    return st('users/new.html')


text:
var express = require('express');
var fs = require('fs');
var request = require('request');
var cheerio = require('cheerio');
var async = require('async');
var _ = require('lodash');
var multipart = require('connect-multiparty');
var multipartMiddleware = multipart();
var Excel = require("exceljs");
var multer  = require('multer');
var upload = multer({ dest: 'uploads/' });
var tnt = require('../controller/tntHandler');
var async = require('async');

var router = express.Router();

router.post('/tnt', multipartMiddleware, function (req, res, next) {

  async.waterfall([
    function (done) {
      var workbook = new Excel.Workbook();
      workbook.xlsx.readFile(req.files.file.path)

      .then(function() {

        var worksheet = workbook.getWorksheet(1)
          var colH = worksheet.getColumn(1)
          var dataArray = []

        colH.eachCell({includeEmpty: false}, function(cell, rowNumber) {

          if (rowNumber != 1) {
          var conNoteNumber = cell.value

          tnt.getTNT(conNoteNumber, function (data) {
              // console.log(data)

              dataArray.push(data)

            if (dataArray.length == worksheet.lastRow.number -1 ) {
                done(null, dataArray)
              }

          })
        }
        })
      })
    }

  ], function done(err, dataArray) {
    // console.log(bundle)
    if (err) return next(err);
    // console.log(dataArray.length)
    var flattenedArray = _.flattenDeep(dataArray)
    res.send(flattenedArray)
    res.end()

   })

})

module.exports = router;

                // console.log(dataArray)

           //    starTrack.getGuid(conNoteNumber, function (guid) {

           //      starTrack.getConEvents(guid[0], function (events) {

           //      // var last =  _.last(events)

           //        starTrack.getConSummary(guid[0], function (summary) {

           //          var conData = {
           //            rowNum: rowNumber,
           //        conNum: conNoteNumber,
           //        date: last['EventDate'],
           //        time: last['Time'],
           //        location: last['Location'],
           //        status: last['Status'],
           //        time: last['Time'],
           //        summary: summary['StatusDescription']
           //          }
           //          dataArray.push(conData)
           // //         var xls = json2xls(dataArray)
           //      // fs.writeFileSync(__dirname+ '/data.xlsx', xls, 'binary')

           //      if (dataArray.length == worksheet.lastRow.number -1 ) {
           //        done(null, dataArray)
           //      }
           //        })
           //      })
           //    })


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.daisy.pipeline.modules</groupId>
    <artifactId>modules-parent</artifactId>
    <version>1.14.2-SNAPSHOT</version>
    <relativePath>../../parent</relativePath>
  </parent>

  <version>3.0.6-SNAPSHOT</version>
  <artifactId>audio-encoder-lame</artifactId>
  <packaging>bundle</packaging>

  <name>DAISY Pipeline 2 module :: Lame Audio Encoder</name>
  <description>Implementation of the Audio Encoder API based on Lame</description>

  <dependencies>
    <dependency>
      <groupId>org.daisy.pipeline.modules</groupId>
      <artifactId>audio-common</artifactId>
    </dependency>
    <dependency>
      <groupId>org.daisy.pipeline</groupId>
      <artifactId>common-utils</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
      <version>4.12</version>
    </dependency>
  </dependencies>

  <properties>
    <expose-services>
      org.daisy.pipeline.audio.lame.impl.LameEncoder
    </expose-services>
  </properties>

</project>


text:
[![Build Status](https://secure.travis-ci.org/tblobaum/express-subdomains.png)](http://travis-ci.org/tblobaum/express-subdomains)

Subdomains are placed at the beginning of a route by default.

## Example

```javascript

var subdomains = require('express-subdomains')
    , express = require('express')
    , app = Express.createServer()

// example: api.example.com/user -> '/api/user'

subdomains
  .use('api')
  .use('other.vanity.domain')

app.use(subdomains.middleware)

app.get('/api/user' function (req, res, next) {
  // ..
})

app.listen()

````

## Tests

`npm install mocha -g` and `make test`

## Install

`npm install express-subdomains`

## License

MIT


text:
class App < Sinatra::Application
  before do
    @user = current_user(cookies[:auth])
  end

  get '/albums' do
    protected
    redirect url_for('/albums/1')
  end

  get '/album/:id' do
    protected
    album = Album[params[:id]]
    haml :files, locals: {prev: [], nxt: [], base: "#{url_for("/album/#{params[:id]}")}", assets: album.assets }
  end

  get '/albums/:page' do
    protected
    page = params[:page].to_i
    albums = Album.where(user_id: @user.id).order(:name).paginate(page, 50)
    haml :albums, locals: { albums: albums }
  end

  post '/albums' do
    protected
    album = Album.create(name: params[:name], user_id: @user.id)
    redirect("/album/#{album.id}")
  end

  post '/album/:id' do
    protected
    album = Album[params[:id]]
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <attr name="actionBarStyle" format="reference" />

    <attr name="colorPrimary" format="color" />
    <attr name="colorPrimaryDark" format="color" />
    <attr name="colorAccent" format="color" />

    <attr name="defaultItemSelector" format="reference" />

    <attr name="textAppearanceHeadline" format="reference" />
    <attr name="textAppearanceTitle" format="reference" />
    <attr name="textAppearanceTitleInverse" format="reference" />
    <attr name="textAppearanceSubhead" format="reference" />
    <attr name="textAppearanceSubheadInverse" format="reference" />
    <attr name="textAppearanceBody2" format="reference" />
    <attr name="textAppearanceBody2Inverse" format="reference" />
    <attr name="textAppearanceBody1" format="reference" />
    <attr name="textAppearanceBody1Inverse" format="reference" />
    <attr name="textAppearanceCaption" format="reference" />
    <attr name="textAppearanceCaptionInverse" format="reference" />
    <attr name="textAppearanceMenu" format="reference" />
    <attr name="textAppearanceButton" format="reference" />
    <attr name="colorPrimaryAlternate" format="reference" />
    <attr name="backgroundPrimary" format="reference" />
    <attr name="backgroundPrimaryInverse" format="reference" />
    <attr name="backgroundSecondary" format="reference" />
    <attr name="backgroundSecondaryInverse" format="reference" />
    <attr name="backgroundTertiary" format="reference" />
    <attr name="backgroundTertiaryInverse" format="reference" />

    <attr name="guideBackground" format="reference|color" />
    <attr name="borderlessButtonStyle" format="reference" />

    <attr name="displayOptions">
        <flag name="none" value="0x00000000" />
        <flag name="disableHome" value="0x00000020" />
        <flag name="homeAsUp" value="0x00000004" />
        <flag name="showCustom" value="0x00000010" />
        <flag name="showHome" value="0x00000002" />
        <flag name="showTitle" value="0x00000008" />
        <flag name="useLogo" value="0x00000001" />
    </attr>
    <attr name="titleTextStyle" format="reference" />
    <attr name="subtitleTextStyle" format="reference" />

    <attr name="contentInsetStart" format="dimension" />

    <attr name="quantumFabColor" format="color" />
    <attr name="quantumFabRippleColor" format="color" />
    <attr name="quantumSize">
        <enum name="normal" value="0" />
        <enum name="mini" value="1" />
    </attr>

    <attr name="selectableItemBackground" format="reference" />
    <attr name="selectableItemBackgroundBorderless" format="reference" />
</resources>


text:
(function($){
    $('.group-create').click(function(e){
	    e.preventDefault();
	    $('.group-creator').toggleClass('showed');
	})
	$('.closer-group').click(function(e){
		e.preventDefault();
	    $('.group-creator').toggleClass('showed');
	})
})(jQuery);