text:
This module provides a canvas-like object in hybrid enviroment (Weex and ReactNative), so you can use the canvsa-like object to do your own job, just like on Web. Besides canvas, it also provide an Image-like class, so you can use the it  instead of Image on Web.

## Usage in Weex

First, you should install this package from npm:

```
npm install @gcanvas/core --save
```

Put a `gcanvas` element in template. Note that if you want to downgrade weex native to html, you should put a `canvas` element when is in browser enviroment.

```vue
<template>
	<div>
		<gcanvas v-if="isWeex" ref="canvas_holder" style="top: 0; width:750;height:750;position:absolute; background-color:rgba(0,0,0,0.1)" ></gcanvas>
		<canvas v-if="!isWeex" ref="canvas_holder" style="width:750px;height:750px;background-color:rgba(0,0,0,0)"></canvas>
	</div>
</template>
```

And then revolve in your own progress using weex-toolkit.

```javascript
const { enable, WeexBridge, Image: GImage } = require('@gcanvas/core');
const EnvImage = isWeex ? Image : GImage;
```

Notice that we create a EnvImage variable, on web enviroment, it's the native Image class (HTMLImageElement), while on hybrid it's a class defined in gcanvas.js. You can use EnvImage just as the Image object :

```
// this works on both browser and hybrid enviroment
const image = new EnvImage();
image.onload = function(){
    console.log('loaded');
}
image.src = theUrl;
```

Then you should call `enable` before everything starts, and pass WeexBridge as the `bridge` option in.

```
mounted: function() {
let ref = this.$refs.canvas_holder;

// some size operations

if (isWeex) {
    ref = enable(ref, {bridge: WeexBridge});
}

// here ref is a canvas-like object
}
```

After this, ref is a canvas-like object, you can call `ref.getContext('2d')` or `ref.getContext('webgl')` and go on your own application. Everything is familiar, right?

## Usage in ReactNative

First, you should install this package from npm:

```
npm install react-native-gcanvas --save
npm install @gcanvas/core --save
```

Second,  import ReactNative modules, and  `GCanvasView `  component, `GCanvasView`.

```javascript
import {
  Platform,
  StyleSheet,
  Text,
  View,
  TouchableHighlight
} from 'react-native';

import {
  requireNativeComponent,
  findNodeHandle,
  NativeModules
} from 'react-native';

import {
  GCanvasView,
} from 'react-native-gcanvas';
```

Third, import  `enable`, `ReactNativeBridge` and `image` from  `@gcanvas/core`,  initialize `ReactNativeBridge` with native module and platform.

```javascript
const { enable, ReactNativeBridge, Image: GImage } = require('@gcanvas/core');

ReactNativeBridge.GCanvasModule = NativeModules.GCanvasModule;
ReactNativeBridge.Platform = Platform;
```

Finally, you can use GCanvas in ReactNative App. Notice that before you `enable` GCanvas, convert`GCanvasView` reactTag to a string.
```
export default class App extends Component<{}> {

  //draw something with gcanvas
  draw() => {
	var ref = this.refs.canvas_holder;

	//must convert canvas tag to a string
    var canvas_tag = findNodeHandle(ref);
    var el = { ref:""+canvas_tag, style:{width:414, height:376}};
    ref = enable(el, {bridge: ReactNativeBridge});

    //TODO get context by yourself
    var ctx = ref.getContext('2d');
    //rect
    ctx.fillStyle = 'green';
    ctx.fillRect(0, 0, 100, 100);

    //rect
    ctx.fillStyle = 'black';
    ctx.fillRect(100, 100, 100, 100);
    ctx.fillRect(25, 205, 414-50, 5);

    //circle
    ctx.arc(200, 315, 100, 0, Math.PI * 2, true);
    ctx.fill();

    var image = new GImage();
    image.onload = function(){
      ctx.drawImage(image, 150, 0);
      ctx.drawImage(image, 150, 450);
    }
    image.src = '//gw.alicdn.com/tfs/TB1KwRTlh6I8KJjy0FgXXXXzVXa-225-75.png';
  }

  //render
  render(){
      return  <GCanvasView ref='canvas_holder' style={top: 20,width: 414,height :700,backgroundColor: '#FF000030'}></GCanvasView>
  }

}
```

## Writing your own bridge

Notice that we pass in the bridge object calling `enable`. Actually in this module we provide WeexBridge and ReactNativeBridge, if you want to define a custom bridge, you need to implement the same functions WeexBridge implemented. These functions are:

| function name          | arguments                   | return              |
| ---------------------- | --------------------------- | ------------------- |
| callEnable             | ref, configArray            | gcanvas             |
| callEnableDebug        |                             |                     |
| callEnableDisableCombo |                             |                     |
| callSetContextType     | componentId, context_type   |                     |
| render                 | componentId                 |                     |
| render2d               | componentId, commands       |                     |
| flushNative            | componentId                 |                     |
| callNative             | componentId, cmdArgs, cache | flush native result |
| texImage2D             | componentId, ...args        |                     |
| texSubImage2D          | componentId, ...args        |                     |
| bindImageTexture       | componentId, src, imageId   |                     |
| preloadImage           | [url, id], callback         |                     |

You can check `src/bridge/bridge-weex.js` for detail.

This module is the javascript part of the js-native bridge. About writing the native part, you can refer to [Custom GCanvas Bridge](https://alibaba.github.io/GCanvas/docs/Custom%20Bridge.html).


text:
import sys
from operator import itemgetter

def adder(tagN,tagW):                   # Adder Function which maintains Top N list
    l = len(topNTags)
    if len(topNTags) == None:l = 0
    if l < N or topNTags[N-1][1] < totalWeight:
        if l == N:topNTags.pop()
        topNTags.append([oldTag,totalWeight])
    topNTags.sort(key=itemgetter(1), reverse=True)

N = 10                                  # Change This to get Top N List
oldTag = None
totalWeight = 0
topNTags = []

for line in sys.stdin:
    data = line.strip().split("\t")
    if len(data) != 2:					# Something has gone wrong. Skip this line.
        continue

    thisTag, thisWeight = data

    if oldTag and oldTag != thisTag:
        adder(oldTag, totalWeight)
        totalWeight = 0

    oldTag = thisTag
    totalWeight += int(thisWeight)      # Adds Particular Weight of Tag

adder(oldTag, totalWeight)
for i in range(len(topNTags)):
    print topNTags[i][0],"\t",topNTags[i][1]

redpajama_set_name: RedPajamaGithub


text:
/*
 * IoT - Industrial Internet Framework
 * Apache License Version 2.0, January 2004
 * Released as a part of Helsinki University
 * Software Engineering Lab in summer 2015
 */
package fi.iot.iiframework.errors;

import fi.iot.iiframework.services.errors.ErrorService;
import java.util.List;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Create and save new errors to database.
 */
@Component
public class ErrorLogger {

    private static ErrorService staticErrorService;

    @Autowired
    private ErrorService errorService;

    /**
     * Class needed to allow using Autowired -annotation in a static class
     */
    @PostConstruct
    public void ErrorLogger() {
        staticErrorService = this.errorService;
    }

    /**
     * Creates a new error and calls newError to save it to database
     *
     * @param type ErrorType of error
     * @param severity ErrorSeverity of error
     * @param desc Description of error
     * @param additionalInformation Additional information about this error.
     */
    public static void log(ErrorType type, ErrorSeverity severity, String desc, String additionalInformation) {
        SysError error = new SysError(type, severity, trimString(desc));
        error.setAdditionalInformation(trimString(additionalInformation));
        saveError(error);
    }

    /**
     * Creates a new error and calls newError to save it to database with
     * location obtained from the stack trace.
     *
     * @param type ErrorType of error
     * @param severity ErrorSeverity of error
     * @param desc Optional description
     *
     * @see ErrorType
     * @see ErrorSeverity
     */
    public static void log(ErrorType type, ErrorSeverity severity, String desc) {
        SysError error = new SysError(type, severity, trimString(desc));

        StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
        error.setLocation(stackTraceElements[2].toString());

        saveError(error);
    }

    /**
     * Saves a predefined SysError to the database.
     *
     * @param error Error to add
     * @see SysError
     */
    public static void log(SysError error) {
        StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
        error.setLocation(stackTraceElements[2].toString());
        error.setDescription(trimString(error.getDescription()));
        error.setAdditionalInformation(trimString(error.getAdditionalInformation()));
        saveError(error);
    }

    /**
     * Uses ErrorService to save SysError to database.
     *
     * @param error SysError to be saved
     */
    private static void saveError(SysError error) {
        staticErrorService.save(error);
    }

    /**
     * Returns all systems found in the ErrorService as a list.
     *
     * @return List of SysErrors
     * @see SysError
     */
    public static List<SysError> getAllErrors() {
        return staticErrorService.getAll();
    }

    private static String trimString(String string) {
        if (string == null || string.length() < 2) {
            string = "NaN";
        }

        return string.trim();
    }

}


text:
import java.io.IOException;

import org.antlr.v4.runtime.ANTLRInputStream;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.tree.ParseTree;

public class Calc {

    public static void main(String[] args) throws IOException
    {
	ANTLRInputStream is = new ANTLRInputStream(System.in);
	LabeledExprLexer lexer = new LabeledExprLexer(is);
	CommonTokenStream cts = new CommonTokenStream(lexer);
	LabeledExprParser parser = new LabeledExprParser(cts);

	ParseTree tree = parser.init();

	EvalVisitor eval = new EvalVisitor();
	eval.visit(tree);
    }

}


text:
package org.apache.druid.query.aggregation.datasketches.theta.oldapi;

import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.databind.jsontype.NamedType;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.google.inject.Binder;
import org.apache.druid.initialization.DruidModule;
import org.apache.druid.query.aggregation.datasketches.theta.SketchBuildComplexMetricSerde;
import org.apache.druid.query.aggregation.datasketches.theta.SketchHolder;
import org.apache.druid.query.aggregation.datasketches.theta.SketchHolderJsonSerializer;
import org.apache.druid.query.aggregation.datasketches.theta.SketchMergeComplexMetricSerde;
import org.apache.druid.query.aggregation.datasketches.theta.SketchModule;
import org.apache.druid.segment.serde.ComplexMetrics;

import java.util.Collections;
import java.util.List;

public class OldApiSketchModule implements DruidModule
{

  public static final String SET_SKETCH = "setSketch";
  public static final String SKETCH_BUILD = "sketchBuild";
  public static final String SKETCH_MERGE = "sketchMerge";

  @Override
  public void configure(Binder binder)
  {
    if (ComplexMetrics.getSerdeForType(SKETCH_BUILD) == null) {
      ComplexMetrics.registerSerde(SKETCH_BUILD, new SketchBuildComplexMetricSerde());
    }

    if (ComplexMetrics.getSerdeForType(SET_SKETCH) == null) {
      ComplexMetrics.registerSerde(SET_SKETCH, new SketchMergeComplexMetricSerde());
    }

    if (ComplexMetrics.getSerdeForType(SKETCH_MERGE) == null) {
      ComplexMetrics.registerSerde(SKETCH_MERGE, new SketchMergeComplexMetricSerde());
    }

    if (ComplexMetrics.getSerdeForType(SketchModule.THETA_SKETCH) == null) {
      ComplexMetrics.registerSerde(SketchModule.THETA_SKETCH, new SketchMergeComplexMetricSerde());
    }

    if (ComplexMetrics.getSerdeForType(SketchModule.THETA_SKETCH_MERGE_AGG) == null) {
      ComplexMetrics.registerSerde(SketchModule.THETA_SKETCH_MERGE_AGG, new SketchMergeComplexMetricSerde());
    }

    if (ComplexMetrics.getSerdeForType(SketchModule.THETA_SKETCH_BUILD_AGG) == null) {
      ComplexMetrics.registerSerde(SketchModule.THETA_SKETCH_BUILD_AGG, new SketchBuildComplexMetricSerde());
    }
  }

  @Override
  public List<? extends Module> getJacksonModules()
  {
    return Collections.<Module>singletonList(
        new SimpleModule("OldThetaSketchModule")
            .registerSubtypes(
                new NamedType(OldSketchBuildAggregatorFactory.class, SKETCH_BUILD),
                new NamedType(OldSketchMergeAggregatorFactory.class, SKETCH_MERGE),
                new NamedType(OldSketchEstimatePostAggregator.class, "sketchEstimate"),
                new NamedType(OldSketchSetPostAggregator.class, "sketchSetOper")
            )
            .addSerializer(SketchHolder.class, new SketchHolderJsonSerializer())
    );
  }
}


text:
<!doctype html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

  <title>OSW Impact Report - Crisis (Off the Streets and into Work) | Jo Clarke - Freelance Charity and Public Sector Copywriter London</title>

  <meta name="description" content="London freelance charity and public sector copywriter. Creative, strategic award-winning copywriter working across global, national and boutique brands. ">

    <meta name="viewport" content="width=device-width,initial-scale=1">

    <link rel="author" href="https://plus.google.com/103776498229887717815/posts"/>
    <link rel="publisher" href="https://plus.google.com/103776498229887717815"/>

  <link rel="stylesheet" href="/css/style.min.css">

<meta property="og:locale" content="en_GB" />
    <meta property="og:type" content="article" />
    <meta property="og:title" content="Jo Clarke - Freelance Copywriter London" />
    <meta property="og:description" content="London freelance copywriter. Creative, strategic award-winning copywriter working across global, national and boutique brands." />
    <meta property="og:url" content="https://joannaclarke.co.uk/" />
    <meta property="og:site_name" content="Jo Clarke - Freelance Copywriter London" />
    <meta property="og:image" content="https://joannaclarke.co.uk/img/jo-clarke.jpeg" />
    <meta property="og:image:width" content="500" />
    <meta property="og:image:height" content="500" />

    <meta name="twitter:card" content="summary_large_image" />
    <meta name="twitter:description" content="London freelance copywriter. Creative, strategic award-winning copywriter working across global, national and boutique brands." />
    <meta name="twitter:title" content="Jo Clarke - Freelance Copywriter London" />
    <meta name="twitter:site" content="@JoClarkeWrites" />
    <meta name="twitter:image" content="https://joannaclarke.co.uk/img/jo-clarke.jpeg" />
    <meta name="twitter:creator" content="@JoClarkeWrites" />

Jo Clarke Freelance Copywriter 07886 407921

Home

Clients

About

Contact

Crisis (Off the Streets and into Work) Projects

OSW Impact Report

Crisis (Off the Streets and into Work)

Impact Report

Copywriting for a 36 page impact report highlighting the issues facing the homeless and marketing the results of a £5 million initiative.

OSW has since merged with Crisis.

Space NK

Liz Earle

Neal's Yard Remedies

TK Maxx

Crisis

drinkaware.co.uk

EVE LOM

change4life

Breast Cancer Care

NotOnTheHighStreet.com

hello@joannaclarke.co.uk

07886 407921


text:
1. [Overview](#overview)
2. [Module Description - What the module does and why it is useful](#module-description)
3. [Setup - The basics of getting started with download_file](#setup)
    * [What download_file affects](#what-download_file-affects)
    * [Setup requirements](#setup-requirements)
    * [Beginning with download_file](#beginning-with-download_file)
4. [Usage - Configuration options and additional functionality](#usage)
5. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
5. [Limitations - OS compatibility, etc.](#limitations)
6. [Development - Guide for contributing to the module](#development)

##Overview
The download_file module allows you to download files on Windows

[![Build Status](https://travis-ci.org/opentable/puppet-download_file.png?branch=master)](https://travis-ci.org/opentable/puppet-download_file)

##Module Description

The download_file module introduced a small define `download_file` that will allow you to download a file over http(s) for usage during an installation.
This was created because the package resource does not support http as a source for packages.
It is only supported on Windows.

##Setup
###What download_file affects
* Downloads files onto each node

###Setup Requirements
* download_file makes use of Powershell so you will need to have at least version 2.0 installed in order to use this module.

##Beginning

To download dotnet 4.0

```puppet
    download_file { "Download dotnet 4.0" :
      url                   => 'http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe',
      destination_directory => 'c:\temp'
    }
```

To download dotnet 4.0 using a proxy

```puppet
    download_file { "Download dotnet 4.0" :
      url                   => 'http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe',
      destination_directory => 'c:\temp',
      proxy_address         => 'http://corporateproxy.net:8080'
    }
```

The proxy will be used as part of the download using PowerShell. This does not set a system wide proxy

##Usage

###Classes and Defined Types

####Defined Type: `download_file`

**Parameters within `download_file`:**
#####`url`
The http(s) destination of the file that you are looking to download

#####`destination_directory`
The full path to the directory on the system where the file will be downloaded to

#####`destination_file`
The optional name of the file to download onto the system.

#####`proxy_address`
The optional http proxy address to use when downloading the file

##Reference

###Defined Types
####Public Types
* [`download_file`](#defined-download_file): Download a give file

##Limitations

This module is tested on the following platforms:

* Windows 2008
* Windows 2008 R2
* Windows 2012
* Windows 2012 R2

It is tested with the OSS version of Puppet only.

###Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for full details on contributing to this project.


text:
package bd.com.ronnie.lekhoni2.service;

import bd.com.ronnie.lekhoni2.domain.Account;
import bd.com.ronnie.lekhoni2.dto.AccountDTO;
import bd.com.ronnie.lekhoni2.repository.AccountRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class AccountService {

    private final AccountRepository accountRepository;

    public void create(AccountDTO accountDTO) {
        Account account = new Account();
        account.setName(accountDTO.getName());
        account.setEmail(accountDTO.getEmail());
        account.setPhone(accountDTO.getPhone());
        account.setPassword(new BCryptPasswordEncoder().encode(accountDTO.getPassword()));
        accountRepository.save(account);
    }

}


text:
"""
    uri_exception_filter.py -- uris on the exception list will not have data updates
"""

__author__ = "Michael Conlon"
__copyright__ = "Copyright 2015 (c) Michael Conlon"
__license__ = "New BSD License"
__version__ = "0.01"

from vivopump import read_csv_fp, write_csv_fp
import shelve
import sys

uri_exception_shelve = shelve.open('uri_exceptions.db')
uri_exceptions = set(uri_exception_shelve.keys())  # a set of uris that will not have data updates
data_in = read_csv_fp(sys.stdin)
data_out = {}
exempt_count = 0
for row, data in data_in.items():
    new_data = dict(data)
    if 'uri' in new_data and new_data['uri'] in uri_exceptions:
        for name in new_data.keys():
            if name != 'uri' and name != 'UFID':
                new_data[name] = ''
        exempt_count += 1
    data_out[row] = new_data
print >>sys.stderr, 'Exempt count', exempt_count
write_csv_fp(sys.stdout, data_out)
uri_exception_shelve.close()


text:
package com.wt.studio.plugin.pagedesigner.gef.model;

import org.eclipse.draw2d.geometry.Dimension;

import com.wt.studio.plugin.modeldesigner.editor.model.Element;

public class ConnectionBendpoint extends Element {

	/**
	 *
	 */
	private static final long serialVersionUID = 6608511826633749834L;
	private float weight = 0.5f;
	private Dimension d1, d2;

	public ConnectionBendpoint() {}

	public Dimension getFirstRelativeDimension() {
		return d1;
	}

	public Dimension getSecondRelativeDimension() {
		return d2;
	}

	public float getWeight() {
		return weight;
	}

	public void setRelativeDimensions(Dimension dim1, Dimension dim2) {
		d1 = dim1;
		d2 = dim2;
	}

	public void setWeight(float w) {
		weight = w;
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>43.0</apiVersion>
    <packageVersions>
        <majorNumber>3</majorNumber>
        <minorNumber>11</minorNumber>
        <namespace>npe01</namespace>
    </packageVersions>
    <packageVersions>
        <majorNumber>3</majorNumber>
        <minorNumber>7</minorNumber>
        <namespace>npe5</namespace>
    </packageVersions>
    <packageVersions>
        <majorNumber>3</majorNumber>
        <minorNumber>11</minorNumber>
        <namespace>npo02</namespace>
    </packageVersions>
    <status>Active</status>
</ApexClass>


text:
package com.yimei.ext.hessian.serializer;

import com.caucho.hessian.io.AbstractHessianOutput;
import com.caucho.hessian.io.AbstractSerializer;

import java.io.IOException;

/**
 *
 *
 */
public abstract class AbstractJava8Serializer extends AbstractSerializer {

    @Override
    public void writeObject(Object obj, AbstractHessianOutput out) throws IOException {
        if (obj == null) {
            out.writeNull();
        } else {
            if (out.addRef(obj)) {
                return;
            }

            Class<?> cl = obj.getClass();

            int ref = out.writeObjectBegin(cl.getName());

            if (ref < -1) {
                out.writeString("value");
                out.writeString(objectToString(obj));
                out.writeMapEnd();
            } else {
                if (ref == -1) {
                    out.writeInt(1);
                    out.writeString("value");
                    out.writeObjectBegin(cl.getName());
                }

                out.writeString(objectToString(obj));
            }
        }
    }

    protected abstract String objectToString(Object obj);
}


text:
from itertools import groupby

from django.contrib import messages
from django.db.models import Count, Q
from django.utils.timezone import now
from django.utils.translation import ugettext_lazy as _
from django.http import HttpResponse
from django.shortcuts import redirect, render
from django.utils.functional import cached_property
from django.views.generic import ListView, DetailView, TemplateView, View
from pretix.base.models import Order, Quota, OrderPosition, ItemCategory
from pretix.base.services.orders import mark_order_paid
from pretix.base.signals import register_payment_providers
from pretix.control.forms.orders import ExtendForm
from pretix.control.permissions import EventPermissionRequiredMixin

class OrderList(EventPermissionRequiredMixin, ListView):
    model = Order
    context_object_name = 'orders'
    template_name = 'pretixcontrol/orders/index.html'
    paginate_by = 30
    permission = 'can_view_orders'

    def get_queryset(self):
        qs = Order.objects.current.filter(
            event=self.request.event
        )
        if self.request.GET.get("user", "") != "":
            u = self.request.GET.get("user", "")
            qs = qs.filter(
                Q(user__identifier__icontains=u) | Q(user__email__icontains=u)
                | Q(user__givenname__icontains=u) | Q(user__familyname__icontains=u)
            )
        if self.request.GET.get("status", "") != "":
            s = self.request.GET.get("status", "")
            qs = qs.filter(status=s)
        return qs.select_related("user")

class OrderView(EventPermissionRequiredMixin, DetailView):
    context_object_name = 'order'
    model = Order

    def get_object(self, queryset=None):
        return Order.objects.current.get(
            event=self.request.event,
            code=self.kwargs['code'].upper()
        )

    @cached_property
    def order(self):
        return self.get_object()

    @cached_property
    def payment_provider(self):
        responses = register_payment_providers.send(self.request.event)
        for receiver, response in responses:
            provider = response(self.request.event)
            if provider.identifier == self.order.payment_provider:
                return provider

class OrderDetail(OrderView):
    template_name = 'pretixcontrol/order/index.html'
    permission = 'can_view_orders'

    def get_context_data(self, **kwargs):
        ctx = super().get_context_data(**kwargs)
        ctx['items'] = self.get_items()
        ctx['event'] = self.request.event
        ctx['payment'] = self.payment_provider.order_control_render(self.request, self.object)
        return ctx

    def get_items(self):
        queryset = self.object.positions.all()

        cartpos = queryset.order_by(
            'item', 'variation'
        ).select_related(
            'item', 'variation'
        ).prefetch_related(
            'variation__values', 'variation__values__prop', 'item__questions',
            'answers'
        )

        # Group items of the same variation
        # We do this by list manipulations instead of a GROUP BY query, as
        # Django is unable to join related models in a .values() query
        def keyfunc(pos):
            if (pos.item.admission and self.request.event.settings.attendee_names_asked) \
                    or pos.item.questions.all():
                return pos.id, "", "", ""
            return "", pos.item_id, pos.variation_id, pos.price

        positions = []
        for k, g in groupby(sorted(list(cartpos), key=keyfunc), key=keyfunc):
            g = list(g)
            group = g[0]
            group.count = len(g)
            group.total = group.count * group.price
            group.has_questions = k[0] != ""
            group.cache_answers()
            positions.append(group)

        return {
            'positions': positions,
            'raw': cartpos,
            'total': self.object.total,
            'payment_fee': self.object.payment_fee,
        }

class OrderTransition(OrderView):
    permission = 'can_change_orders'

    def post(self, *args, **kwargs):
        to = self.request.POST.get('status', '')
        if self.order.status == 'n' and to == 'p':
            try:
                mark_order_paid(self.order, manual=True)
            except Quota.QuotaExceededException as e:
                messages.error(self.request, str(e))
            else:
                messages.success(self.request, _('The order has been marked as paid.'))
        elif self.order.status == 'n' and to == 'c':
            order = self.order.clone()
            order.status = Order.STATUS_CANCELLED
            order.save()
            messages.success(self.request, _('The order has been cancelled.'))
        elif self.order.status == 'p' and to == 'n':
            order = self.order.clone()
            order.status = Order.STATUS_PENDING
            order.payment_manual = True
            order.save()
            messages.success(self.request, _('The order has been marked as not paid.'))
        elif self.order.status == 'p' and to == 'r':
            ret = self.payment_provider.order_control_refund_perform(self.request, self.order)
            if ret:
                return redirect(ret)
        return redirect('control:event.order',
                        event=self.request.event.slug,
                        organizer=self.request.event.organizer.slug,
                        code=self.order.code)

    def get(self, *args, **kwargs):
        to = self.request.GET.get('status', '')
        if self.order.status == 'n' and to == 'c':
            return render(self.request, 'pretixcontrol/order/cancel.html', {
                'order': self.order,
            })
        elif self.order.status == 'p' and to == 'r':
            return render(self.request, 'pretixcontrol/order/refund.html', {
                'order': self.order,
                'payment': self.payment_provider.order_control_refund_render(self.order),
            })
        else:
            return HttpResponse(status=405)

class OrderExtend(OrderView):
    permission = 'can_change_orders'

    def post(self, *args, **kwargs):
        if self.order.status != Order.STATUS_PENDING:
            messages.error(self.request, _('This action is only allowed for pending orders.'))
            return self._redirect_back()
        oldvalue = self.order.expires

        if self.form.is_valid():
            if oldvalue > now():
                self.form.save()
            else:
                is_available, _quotas_locked = self.order._is_still_available(keep_locked=False)
                if is_available is True:
                    self.form.save()
                    messages.success(self.request, _('The payment term has been changed.'))
                else:
                    messages.error(self.request, is_available)
            return self._redirect_back()
        else:
            return self.get(*args, **kwargs)

    def _redirect_back(self):
        return redirect('control:event.order',
                        event=self.request.event.slug,
                        organizer=self.request.event.organizer.slug,
                        code=self.order.code)

    def get(self, *args, **kwargs):
        if self.order.status != Order.STATUS_PENDING:
            messages.error(self.request, _('This action is only allowed for pending orders.'))
            return self._redirect_back()
        return render(self.request, 'pretixcontrol/order/extend.html', {
            'order': self.order,
            'form': self.form,
        })

    @cached_property
    def form(self):
        return ExtendForm(instance=self.order,
                          data=self.request.POST if self.request.method == "POST" else None)

class OverView(EventPermissionRequiredMixin, TemplateView):
    template_name = 'pretixcontrol/orders/overview.html'
    permission = 'can_view_orders'

    def get_context_data(self, **kwargs):
        ctx = super().get_context_data()
        items = self.request.event.items.all().select_related(
            'category',  # for re-grouping
        ).prefetch_related(
            'properties',  # for .get_all_available_variations()
        ).order_by('category__position', 'category_id', 'name')

        num_total = {
            (p['item'], p['variation']): p['cnt']
            for p in
            OrderPosition.objects.current.filter(order__event=self.request.event).values('item', 'variation').annotate(
                cnt=Count('id'))
        }
        num_cancelled = {
            (p['item'], p['variation']): p['cnt']
            for p in (OrderPosition.objects.current
                      .filter(order__event=self.request.event, order__status=Order.STATUS_CANCELLED)
                      .values('item', 'variation')
                      .annotate(cnt=Count('id')))
        }
        num_refunded = {
            (p['item'], p['variation']): p['cnt']
            for p in (OrderPosition.objects.current
                      .filter(order__event=self.request.event, order__status=Order.STATUS_REFUNDED)
                      .values('item', 'variation')
                      .annotate(cnt=Count('id')))
        }
        num_pending = {
            (p['item'], p['variation']): p['cnt']
            for p in (OrderPosition.objects.current
                      .filter(order__event=self.request.event,
                              order__status__in=(Order.STATUS_PENDING, Order.STATUS_EXPIRED))
                      .values('item', 'variation')
                      .annotate(cnt=Count('id')))
        }
        num_paid = {
            (p['item'], p['variation']): p['cnt']
            for p in (OrderPosition.objects.current
                      .filter(order__event=self.request.event, order__status=Order.STATUS_PAID)
                      .values('item', 'variation')
                      .annotate(cnt=Count('id')))
        }

        for item in items:
            item.all_variations = sorted(item.get_all_variations(),
                                         key=lambda vd: vd.ordered_values())
            for var in item.all_variations:
                variid = var['variation'].identity if 'variation' in var else None
                var.num_total = num_total.get((item.identity, variid), 0)
                var.num_pending = num_pending.get((item.identity, variid), 0)
                var.num_cancelled = num_cancelled.get((item.identity, variid), 0)
                var.num_refunded = num_refunded.get((item.identity, variid), 0)
                var.num_paid = num_paid.get((item.identity, variid), 0)
            item.has_variations = (len(item.all_variations) != 1
                                   or not item.all_variations[0].empty())
            item.num_total = sum(var.num_total for var in item.all_variations)
            item.num_pending = sum(var.num_pending for var in item.all_variations)
            item.num_cancelled = sum(var.num_cancelled for var in item.all_variations)
            item.num_refunded = sum(var.num_refunded for var in item.all_variations)
            item.num_paid = sum(var.num_paid for var in item.all_variations)

        nonecat = ItemCategory(name=_('Uncategorized'))
        # Regroup those by category
        ctx['items_by_category'] = sorted(
            [
                # a group is a tuple of a category and a list of items
                (cat if cat is not None else nonecat, [i for i in items if i.category == cat])
                for cat in set([i.category for i in items])
                # insert categories into a set for uniqueness
                # a set is unsorted, so sort again by category
            ],
            key=lambda group: (group[0].position, group[0].identity) if group[0] is not None else (0, "")
        )
        for c in ctx['items_by_category']:
            c[0].num_total = sum(item.num_total for item in c[1])
            c[0].num_pending = sum(item.num_pending for item in c[1])
            c[0].num_cancelled = sum(item.num_cancelled for item in c[1])
            c[0].num_refunded = sum(item.num_refunded for item in c[1])
            c[0].num_paid = sum(item.num_paid for item in c[1])

        ctx['total'] = {
            'num_total': sum(c.num_total for c, i in ctx['items_by_category']),
            'num_pending': sum(c.num_pending for c, i in ctx['items_by_category']),
            'num_cancelled': sum(c.num_cancelled for c, i in ctx['items_by_category']),
            'num_refunded': sum(c.num_refunded for c, i in ctx['items_by_category']),
            'num_paid': sum(c.num_total for c, i in ctx['items_by_category'])
        }

        return ctx

class OrderGo(EventPermissionRequiredMixin, View):
    permission = 'can_view_orders'

    def get(self, request, *args, **kwargs):
        code = request.GET.get("code")
        try:
            order = Order.objects.current.get(code=code, event=request.event)
            return redirect('control:event.order', event=request.event.slug, organizer=request.event.organizer.slug,
                            code=order.code)
        except Order.DoesNotExist:
            messages.error(request, _('There is no order with the given order code.'))
            return redirect('control:event.orders', event=request.event.slug, organizer=request.event.organizer.slug)


text:
using System;
using Hyena;
using Tripod.Sources;

namespace Tripod.Actions
{
    public interface IPhotoAction
    {
        void InitializeWith (IPhoto photo);
        void ApplyTo (IPhoto photo);
        void UndoTo (IPhoto photo);
    }
}


text:
package Chipmunk::Constraint;

# ABSTRACT: Opaque constraint

use strict;
use warnings;
use Alien::Chipmunk;

require XSLoader;
XSLoader::load( 'Chipmunk::Constraint', $Chipmunk::Constraint::VERSION );

1;

__END__

=head1 SYNOPSIS

=head1 DESCRIPTION

A constraint is something that describes how two bodies interact with
each other. (how they constrain each other) Constraints can be simple
joints that allow bodies to pivot around each other like the bones in
your body, or they can be more abstract like the gear joint or motors.

=head2 What constraints are and what they are not

Constraints in Chipmunk are all velocity based constraints. This means
that they act primarily by synchronizing the velocity of two bodies. A
pivot joint holds two anchor points on two separate bodies together by
defining equations that say that the velocity of the anchor points must
be the same and calculating impulses to apply to the bodies to try and
keep it that way. A constraint takes a velocity as it's primary input
and produces a velocity change as it's output. Some constraints,
(joints in particular) apply velocity changes to correct differences
in positions. More about this in the next section.

A spring connected between two bodies is not a constraint. It's very
constraint-like as it creates forces that affect the velocities of the
two bodies, but a spring takes distances as input and produces forces
as it's output. If a spring is not a constraint, then why do I have
two varieties of spring constraints you ask? The reason is because
they are damped springs. The damping associated with the spring is a
true constraint that creates velocity changes based on the relative
velocities of the two bodies it links. As it is convenient to put a
damper and a spring together most of the time, I figured I might as well
just apply the spring force as part of the constraint instead of having
a damper constraint and having the user calculate and apply their own
spring forces separately.

=head1 METHODS

=head2 activate_bodies

=over 4

=item Arguments: none

=item Return Value: not defined

=back

    $constraint->activate_bodies();

=head2 get_space

=over 4

=item Arguments: none

=item Return Value: L<$space|Chipmunk::Space>

=back

Get the L<Space|Chipmunk::Space> that the constraint has been added
to.

    $space = $constraint->get_space();

=head2 get_a

=over 4

=item Arguments: none

=item Return Value: L<$body|Chipmunk::Body>

=back

Get the first body the constraint is attached to.

    $body_a = $constraint->get_a();

=head2 get_b

=over 4

=item Arguments: none

=item Return Value: L<$body|Chipmunk::Body>

=back

Get the second body the constraint is attached to.

    $body_b = $constraint->get_b();

=head2 get_max_force

=over 4

=item Arguments: none

=item Return Value: $max_force

=back

Get the maximum force that the constraint can use to act on the
two bodies. Defaults to INFINITY.

    $max_force = $constraint->get_max_force();

=head2 set_max_force

=over 4

=item Arguments: $max_force

=item Return Value: not defined

=back

Set the maximum force that the constraint can use to act on the
two bodies. Defaults to INFINITY.

=head2 get_error_bias

=over 4

=item Arguments: none

=item Return Value: $error_bias

=back

Get the percentage of joint error that remains unfixed after a second.
This works exactly the same as the collision bias property of a space,
but applies to fixing error (stretching) of joints instead of
overlapping collisions.

=head2 set_error_bias

=over 4

=item Arguments: $error_bias

=item Return Value: not defined

=back

Set the percentage of joint error that remains unfixed after a second.
This works exactly the same as the collision bias property of a space,
but applies to fixing error (stretching) of joints instead of
overlapping collisions.

=head2 get_max_bias

=over 4

=item Arguments: none

=item Return Value: $max_bias

=back

Get the maximum speed at which the constraint can apply error
correction. Defaults to INFINITY.

=head2 set_max_bias

=over 4

=item Arguments: $max_bias

=item Return Value: not defined

=back

Set the maximum speed at which the constraint can apply error
correction. Defaults to INFINITY.

=head2 get_user_data

=over 4

=item Arguments: none

=item Return Value: $user_data

=back

Get user data pointer. Use this pointer to get a reference to the game
object that owns this constraint from callbacks.

=head2 set_user_data

=over 4

=item Arguments: $user_data

=item Return Value: not defined

=back

Set user data pointer. Use this pointer to get a reference to the game
object that owns this constraint from callbacks.

=head2 get_impulse

=over 4

=item Arguments: none

=item Return Value: $impulse

=back

The most recent impulse that this constraint applied. To convert this to
a force, divide by the timestep passed to L<step|Chipmunk::Space/step>.
You can use this to implement breakable joints to check if the force
they attempted to apply exceeded a certain threshold.

=head1 SEE ALSO

L<Chipmunk::DampedRotarySpring>, L<Chipmunk::DampedSpring>,
L<Chipmunk::GearJoint>, L<Chipmunk::GrooveJoint>, L<Chipmunk::PinJoint>,
L<Chipmunk::PivotJoint>, L<Chipmunk::RatchetJoint>,
L<Chipmunk::RotaryLimitJoint>, L<Chipmunk::SimpleMotor>,
L<Chipmunk::SlideJoint>

=cut


text:
import logging
import re
import os
import stat

from ..base import Antivirus

log = logging.getLogger(__name__)

class AVGAntiVirusFree(Antivirus):
    _name = "AVG AntiVirus Free (Linux)"

    # ==================================
    #  Constructor and destructor stuff
    # ==================================

    def __init__(self, *args, **kwargs):
        # class super class constructor
        super(AVGAntiVirusFree, self).__init__(*args, **kwargs)
        # scan tool variables
        self._scan_args = (
            "--heur "      # use heuristics for scanning
            "--paranoid "  # Enable paranoid mode. Scan for less dangerous
                           # malware and more time consuming algoritms.
            "--arc "       # scan through archives
            "--macrow "    # report documents with macros.
            "--pwdw "      # report password protected files
            "--pup "       # scan for Potentially Unwanted Programs
        )
        self._scan_patterns = [
            re.compile(r'(?P<file>.*)'
                       r'\s+(Found|Virus found|Potentially harmful program|'
                       r'Virus identified|Trojan horse)\s+'
                       r'(?P<name>.*)(\\n)*.*$', re.IGNORECASE)
        ]

        def is_error_fn(x):
            return x in [1, 2, 3, 6, 7, 8, 9, 10]

        # NOTE: do 'man avgscan' for return codes
        self._scan_retcodes[self.ScanResult.CLEAN] = lambda x: x in [0]
        self._scan_retcodes[self.ScanResult.INFECTED] = lambda x: x in [4, 5]
        self._scan_retcodes[self.ScanResult.ERROR] = lambda x: is_error_fn(x)

    # ==========================================
    #  Antivirus methods (need to be overriden)
    # ==========================================

    def get_version(self):
        """return the version of the antivirus"""
        result = None
        if self.scan_path:
            cmd = self.build_cmd(self.scan_path, '-v')
            retcode, stdout, stderr = self.run_cmd(cmd)
            if not retcode:
                matches = re.search(r'(?P<version>\d+(\.\d+)+)',
                                    stdout,
                                    re.IGNORECASE)
                if matches:
                    result = matches.group('version').strip()
        return result

    def get_database(self):
        """return list of files in the database"""
        # extract folder where are installed definition files
        avg_path = '/opt/avg/'
        # NOTE: the structure/location of the update folders are documented in
        # the /var/lib/avast/Setup/avast.setup script.
        search_paths = map(lambda x:
                           '{avg_path}/av/update/{folder}/'
                           ''.format(avg_path=avg_path, folder=x),
                           ['backup', 'download', 'prepare'])
        database_patterns = [
            '*',
        ]
        results = []
        for pattern in database_patterns:
            result = self.locate(pattern, search_paths, syspath=False)
            results.extend(result)
        return results if results else None

    def get_scan_path(self):
        """return the full path of the scan tool"""
        paths = self.locate("avgscan")
        return paths[0] if paths else None


text:
package com.cusnews.app.fragments;

import java.util.List;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.widget.LinearLayoutManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;

import com.chopping.utils.Utils;
import com.cusnews.R;
import com.cusnews.app.App;
import com.cusnews.app.adapters.TopicListAdapter;
import com.cusnews.bus.SelectedTopicsEvent;
import com.cusnews.databinding.TopicListBinding;
import com.cusnews.ds.Topic;
import com.cusnews.ds.TopicsFactory;
import com.cusnews.gcm.SubscribeIntentService;
import com.cusnews.gcm.UnsubscribeIntentService;
import com.cusnews.utils.Prefs;

import de.greenrobot.event.EventBus;

/**
 * A list of all topics that will be subscribed to push.
 *
 * @author Xinyue Zhao
 */
public final class TopicListFragment extends DialogFragment {
	/**
	 * Main layout for this component.
	 */
	private static final int LAYOUT = R.layout.fragment_topic_list;
	/**
	 * Pre-defined list of push-topics.
	 */
	private List<Topic>       mTopicList;
	/**
	 * Data-binding.
	 */
	private TopicListBinding  mBinding;
	/**
	 * Listener while subscribe push-topic.
	 */
	private BroadcastReceiver mSubscribeReceiver;
	/**
	 * Listener while unsubscribe push-topic.
	 */
	private BroadcastReceiver mUnsubscribeReceiver;

	public static TopicListFragment newInstance( Context context ) {
		return (TopicListFragment) Fragment.instantiate( context, TopicListFragment.class.getName() );
	}

	@Override
	public void onCreate( Bundle savedInstanceState ) {
		super.onCreate( savedInstanceState );
		mTopicList = TopicsFactory.create();

		mSubscribeReceiver = new BroadcastReceiver() {
			@Override
			public void onReceive( Context context, Intent intent ) {
				String  name   = intent.getStringExtra( SubscribeIntentService.SUBSCRIBE_NAME );
				boolean result = intent.getBooleanExtra( SubscribeIntentService.SUBSCRIBE_RESULT, false );

				mBinding.getTopicsAdapter().notifyDataSetChanged();
				if( !result ) {
					Utils.showLongToast( App.Instance, getString( R.string.lbl_subscribe_fail, name ) );
				}
			}
		};
		mUnsubscribeReceiver = new BroadcastReceiver() {
			@Override
			public void onReceive( Context context, Intent intent ) {
				String  name   = intent.getStringExtra( UnsubscribeIntentService.UNSUBSCRIBE_NAME );
				boolean result = intent.getBooleanExtra( UnsubscribeIntentService.UNSUBSCRIBE_RESULT, false );

				mBinding.getTopicsAdapter().notifyDataSetChanged();
				if( !result ) {
					Utils.showLongToast( App.Instance, getString( R.string.lbl_unsubscribe_fail, name ) );
				}
			}
		};
	}

	@Override
	public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState ) {
		return inflater.inflate( LAYOUT, container, false );
	}

	@Override
	public void onResume() {
		super.onResume();
		LocalBroadcastManager.getInstance( getActivity() ).registerReceiver(
				mSubscribeReceiver, new IntentFilter( SubscribeIntentService.SUBSCRIBE_COMPLETE ) );
		LocalBroadcastManager.getInstance( getActivity() ).registerReceiver(
				mUnsubscribeReceiver, new IntentFilter( UnsubscribeIntentService.UNSUBSCRIBE_COMPLETE ) );
	}

	@Override
	public void onPause() {
		LocalBroadcastManager.getInstance( getActivity() ).unregisterReceiver( mSubscribeReceiver );
		LocalBroadcastManager.getInstance( getActivity() ).unregisterReceiver( mUnsubscribeReceiver );
		super.onPause();
	}

	@Override
	public void onViewCreated( View view, Bundle savedInstanceState ) {
		super.onViewCreated( view, savedInstanceState );
		mBinding = DataBindingUtil.bind( view.findViewById( R.id.topic_list_ll ) );
		mBinding.topicListRv.setLayoutManager( new LinearLayoutManager( getActivity() ) );
		mBinding.setTopicsAdapter( new TopicListAdapter( mTopicList ) );
		mBinding.closeBtn.setOnClickListener( new OnClickListener() {
			@Override
			public void onClick( View v ) {
				Activity activity = getActivity();
				if( activity != null ) {
					ActivityCompat.finishAfterTransition( activity );
				}
			}
		} );
	}

	@Override
	public void onDestroyView() {
		super.onDestroyView();
		Prefs prefs = Prefs.getInstance();
		prefs.setPushSelections( null );
		StringBuilder list   = new StringBuilder();
		List<Topic>   topics = mBinding.getTopicsAdapter().getData();
		for( Topic topic : topics ) {
			if( topic.getSubscribed() ) {
				list.append( topic.getApiName() );
				list.append( "," );
			}
		}
		if( list.length() > 0 ) {
			list.delete( list.length() - 1, list.length() );//Remove last ","
		}
		prefs.setPushSelections( list.toString() );
		EventBus.getDefault().post( new SelectedTopicsEvent() );
	}
}


text:
<!DOCTYPE html>

    <meta charset="utf-8"/>
    <title>twister</title>
    <link id="stylecss" rel="stylesheet" href="css/style.css" type="text/css"/>
    <link id="profilecss" rel="stylesheet" href="css/profile.css" type="text/css"/>

    <link rel="icon" type="image/png" href="img/twister_mini.png" />

        Home

Network

Profile

              Fulano da Silva
              View

            Options
            Network config
            Setup account
            Following users
            Change user
            Switch to Promoted posts
            Direct Messages

          0

          0

        <input type="text" class="userMenu-search-field" placeholder="search"/>

Fulano

Outro Fulano

Mais outro

                  @

                <button class="follow">Follow</button>

              0Mentions

              0Messages

              Edit profile

          View

 Posts

 Following

 Followers *

          <form class="post-area-new">
            <textarea placeholder="New Post..."></textarea>

              140
              <button class="undo-unicode disabled" disabled="true">undo</button>
              <button class="post-submit disabled" disabled="true">post</button>

          </form>

        Postboard

        <button class="postboard-news selectable_theme theme_original theme_calm" style="display: none;"></button>

Normal posts

Promoted posts

          <form class="post-area-new">
            <textarea placeholder="New Post..."></textarea>

             140
                <button class="undo-unicode disabled" disabled="true">undo</button>
                <button class="post-submit disabled" disabled="true">post</button>

          </form>

Who to Follow

        .
        Refresh
        .
        View All

Top Trends

        .
        Refresh

Who's celebrating Twistday

        .
        Refresh

Today's luckies:

Upcoming ones:

            Followed by

        ×
        <button class="follow">Follow</button>

                twisted again by

            Expand

                Reply
                Retransmit

                            Retransmits

                    <form class="post-area-new">
                        <textarea placeholder="Reply..."></textarea>

                            140
                            <button class="undo-unicode disabled" disabled="true">undo</button>
                            <button class="post-submit disabled" disabled="true">post</button>

                    </form>

                Show more in this conversation...

            ×
            <

        ×

        <button class="modal-cancel prompt-close">Cancel</button>
        <button class="modal-propagate">Retransmit</button>

        <form class="post-area-new open">
          <textarea placeholder="New Post..."></textarea>

            140
            <button class="undo-unicode disabled" disabled="true">undo</button>
            <button class="post-submit disabled" disabled="true">post</button>

        </form>

        @
        10min

      10min

      <form class="post-area-new open">
        <textarea placeholder="New direct message..."></textarea>

          140
          <button class="undo-unicode disabled" disabled="true">undo</button>
          <button  title="Direct messages are encrypted, only you and receiver can read them" style="margin-right:7.5%;" class="dm-submit disabled" disabled="true">send</button>

      </form>

@

                  TOX

                  BitMessage

 Posts

 Following

 Followers

                <button class="follow" href="#">Follow</button>
                <button class="direct-messages-with-user" href="#">Direct Messages</button>
                <button class="mentions-from-user" href="#">Mentions</button>

              Posts

              <button class="postboard-news" style="display:none;"></button>

              Posts

              <button class="postboard-news" style="display:none;"></button>

All users publicly followed by @

                        Fulano da Silva
                        @

Which way do you want to follow @:

                <button class="public-following">Public</button>
                <button class="public-following private">Private</button>

  <audio id="player"></audio>
  <audio id="playerSec"></audio>


text:
<?php

declare(strict_types=1);

namespace Sylius\Behat\Context\Setup;

use Behat\Behat\Context\Context;
use Behat\Mink\Element\NodeElement;
use Doctrine\Common\Persistence\ObjectManager;
use Sylius\Component\Core\Formatter\StringInflector;
use Sylius\Component\Core\Model\ImageInterface;
use Sylius\Component\Core\Model\TaxonInterface;
use Sylius\Component\Core\Uploader\ImageUploaderInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
use Sylius\Component\Taxonomy\Generator\TaxonSlugGeneratorInterface;
use Sylius\Component\Taxonomy\Model\TaxonTranslationInterface;
use Symfony\Component\HttpFoundation\File\UploadedFile;

final class TaxonomyContext implements Context
{
    /** @var RepositoryInterface */
    private $taxonRepository;

    /** @var FactoryInterface */
    private $taxonFactory;

    /** @var FactoryInterface */
    private $taxonTranslationFactory;

    /** @var FactoryInterface */
    private $taxonImageFactory;

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

    /** @var ImageUploaderInterface */
    private $imageUploader;

    /** @var TaxonSlugGeneratorInterface */
    private $taxonSlugGenerator;

    /** @var array */
    private $minkParameters;

    public function __construct(
        RepositoryInterface $taxonRepository,
        FactoryInterface $taxonFactory,
        FactoryInterface $taxonTranslationFactory,
        FactoryInterface $taxonImageFactory,
        ObjectManager $objectManager,
        ImageUploaderInterface $imageUploader,
        TaxonSlugGeneratorInterface $taxonSlugGenerator,
        array $minkParameters
    ) {
        $this->taxonRepository = $taxonRepository;
        $this->taxonFactory = $taxonFactory;
        $this->taxonTranslationFactory = $taxonTranslationFactory;
        $this->taxonImageFactory = $taxonImageFactory;
        $this->objectManager = $objectManager;
        $this->imageUploader = $imageUploader;
        $this->taxonSlugGenerator = $taxonSlugGenerator;
        $this->minkParameters = $minkParameters;
    }

    /**
     * @Given the store has :firstTaxonName taxonomy
     * @Given the store classifies its products as :firstTaxonName
     * @Given the store classifies its products as :firstTaxonName and :secondTaxonName
     * @Given the store classifies its products as :firstTaxonName, :secondTaxonName and :thirdTaxonName
     * @Given the store classifies its products as :firstTaxonName, :secondTaxonName, :thirdTaxonName and :fourthTaxonName
     */
    public function storeClassifiesItsProductsAs(...$taxonsNames)
    {
        foreach ($taxonsNames as $taxonName) {
            $this->taxonRepository->add($this->createTaxon($taxonName));
        }
    }

    /**
     * @Given /^the store has taxonomy named "([^"]+)" in ("[^"]+" locale) and "([^"]+)" in ("[^"]+" locale)$/
     */
    public function theStoreHasTaxonomyNamedInAndIn($firstName, $firstLocale, $secondName, $secondLocale)
    {
        $translationMap = [
            $firstLocale => $firstName,
            $secondLocale => $secondName,
        ];

        $this->taxonRepository->add($this->createTaxonInManyLanguages($translationMap));
    }

    /**
     * @Given /^the ("[^"]+" taxon)(?:| also) has an image "([^"]+)" with "([^"]+)" type$/
     */
    public function theTaxonHasAnImageWithType(TaxonInterface $taxon, $imagePath, $imageType)
    {
        $filesPath = $this->getParameter('files_path');

        /** @var ImageInterface $taxonImage */
        $taxonImage = $this->taxonImageFactory->createNew();
        $taxonImage->setFile(new UploadedFile($filesPath . $imagePath, basename($imagePath)));
        $taxonImage->setType($imageType);
        $this->imageUploader->upload($taxonImage);

        $taxon->addImage($taxonImage);

        $this->objectManager->persist($taxon);
        $this->objectManager->flush();
    }

    /**
     * @Given /^the ("[^"]+" taxon) has children taxon "([^"]+)" and "([^"]+)"$/
     */
    public function theTaxonHasChildrenTaxonAnd(TaxonInterface $taxon, $firstTaxonName, $secondTaxonName)
    {
        $taxon->addChild($this->createTaxon($firstTaxonName));
        $taxon->addChild($this->createTaxon($secondTaxonName));

        $this->objectManager->persist($taxon);
        $this->objectManager->flush();
    }

    /**
     * @param string $name
     *
     * @return TaxonInterface
     */
    private function createTaxon($name)
    {
        /** @var TaxonInterface $taxon */
        $taxon = $this->taxonFactory->createNew();
        $taxon->setName($name);
        $taxon->setCode(StringInflector::nameToCode($name));
        $taxon->setSlug($this->taxonSlugGenerator->generate($taxon));

        return $taxon;
    }

    /**
     * @return TaxonInterface
     */
    private function createTaxonInManyLanguages(array $names)
    {
        /** @var TaxonInterface $taxon */
        $taxon = $this->taxonFactory->createNew();
        $taxon->setCode(StringInflector::nameToCode($names['en_US']));
        foreach ($names as $locale => $name) {
            /** @var TaxonTranslationInterface $taxonTranslation */
            $taxonTranslation = $this->taxonTranslationFactory->createNew();
            $taxonTranslation->setLocale($locale);
            $taxonTranslation->setName($name);

            $taxon->addTranslation($taxonTranslation);

            $taxonTranslation->setSlug($this->taxonSlugGenerator->generate($taxon, $locale));
        }

        return $taxon;
    }

    /**
     * @param string $name
     *
     * @return NodeElement
     */
    private function getParameter($name)
    {
        return $this->minkParameters[$name] ?? null;
    }
}


text:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Admin extends HighController {

	public function __construct() {
		parent::__construct();
		$this->load->model('login_model');
		$this->load->library(array('session','form_validation'));
		$this->load->helper(array('url','form'));
		$this->load->database('default');
		$this->removeCache();
	}

	public function index()
	{
		if($this->session->userdata('profile') == FALSE || $this->session->userdata('profile') != 'administrador')
		{
			redirect(base_url().'home');
		}

		$data = array(
                'title' => 'Admin - Curriculums',
                'username' => $this->session->userdata('username'),
                'reclutador' => $this->login_model->get_users_1(),
                'postulante' => $this->login_model->get_users_2(),
                'mails' => $this->login_model->get_data_tbl(1,'System'),
 		);
		$this->load->view('template/head', $data);
    	$this->load->view('template/header_admin');
		$this->load->view('admin');
		$this->load->view('template/footer_admin');
	}
    public function settings(){
        if ($this->input->server('REQUEST_METHOD') === 'POST'){
            $this->form_validation->set_rules('protocol', 'Protocolo', 'required|trim|min_length[3]|max_length[9]');
            $this->form_validation->set_rules('host', 'Host', 'required|trim|min_length[5]|max_length[40]');
            $this->form_validation->set_rules('port', 'Puerto', 'required|trim|min_length[1]|max_length[5]');
            $this->form_validation->set_rules('pass', 'Contraseña', 'required|trim|min_length[4]|max_length[50]');
            $this->form_validation->set_rules('mail', 'Correo', 'required|trim|valid_email|min_length[5]|max_length[45]');

            //$this->form_validation->set_rules('photo', 'Foto', 'required');
            $this->form_validation->set_message('valid_email', 'El %s no es válido');
            $this->form_validation->set_message('required','Campo Necesario!.');
            $this->form_validation->set_message('min_length','Tamaño Minimo %s');
            $this->form_validation->set_message('max_length','Tamaño Maximo %s');
            $this->form_validation->set_error_delimiters('
warning ', '
');

             if ($this->form_validation->run() == false){
                $this->index();
             }else{
                $data = array(
                    'protocol' => $this->input->post('protocol'),
                    'pass' => $this->input->post('pass'),
                    'host' => $this->input->post('host'),
                    'port' => $this->input->post('port'),
                    'mail' => $this->input->post('mail'),
                );
                if($this->login_model->update_data_tbl(1, $data, 'System') == TRUE){
                    $this->session->set_flashdata('info','Modificaciones Realizadas.');
                    $this->index();
                }else{
                    $this->session->set_flashdata('info','Algo ha ido mal, Intente nuevamente.');
                    $this->index();
                }
            }
        }else{
            $this->index();
        }
    }

	public function aView()
	{
		$data = array(
                'title' => 'Actualizar Cuenta de Admin',
                'username' => $this->session->userdata('username'),
                'url' => 'admin/account/update',
                'mails' => $this->login_model->get_data_tbl(1,'System'),
                'data' => $this->login_model->get_user(($this->session->userdata('idUser')),($this->session->userdata('profile')))
 		);
		$this->load->view('template/head', $data);
    	$this->load->view('template/header_admin');
		$this->load->view('admin_edit');
		$this->load->view('template/footer_admin');
	}

	public function logout()
	{
		$this->session->sess_destroy();
		redirect('admin');
	}

	public function update()
    {
        if ($this->input->server('REQUEST_METHOD') === 'POST')
        {
            //form validation
            $this->form_validation->set_rules('username', 'Nombre de Usuario', 'required|trim|min_length[4]|max_length[20]');
            $this->form_validation->set_rules('password', 'Contraseña', 'required|trim|min_length[5]|max_length[50]');
            $this->form_validation->set_rules('name', 'Nombre', 'required|trim|min_length[3]|max_length[30]');
            $this->form_validation->set_rules('surname', 'Apellido', 'required|trim|min_length[4]|max_length[30]');
            $this->form_validation->set_rules('mail', 'Correo', 'required|trim|valid_email|min_length[5]|max_length[45]');
            $this->form_validation->set_rules('idCard', 'Identificacion', 'required|trim|min_length[7]|max_length[20]');
            //$this->form_validation->set_rules('photo', 'Foto', 'required');
            $this->form_validation->set_message('valid_email', 'El %s no es válido');
            $this->form_validation->set_message('required','Campo Necesario!.');
            $this->form_validation->set_message('min_length','Tamaño Minimo %s');
            $this->form_validation->set_message('max_length','Tamaño Maximo %s');
            $this->form_validation->set_error_delimiters('
warning ', '
');

            //if the form has passed through the validation
            if ($this->form_validation->run() == true)
            {
            	$path = "./assets/img/photos/";
        		//chmod($path, 0777);
            	$config['upload_path']= $path;
            	$config['allowed_types']="jpg|png|jpeg";
		        $config['max_size']     = '4000';
				$config['max_width'] = '3048';
				$config['max_height'] = '3080';
            	$this->upload->initialize($config);

        		$data_user = array(
                    'username' => $this->input->post('username'),
                    'password' => sha1($this->input->post('password'))
                    );
                $data_bdp = array(
                	'gender' => $this->input->post('gender'),
                    'name' => $this->input->post('name'),
                    'surname' => $this->input->post('surname'),
                    'idCard' => $this->input->post('idCard'),
                    'photo' => $this->input->post('photo')
                );
                $data_mail['mail']= $this->input->post('mail');
                $idUser = $this->session->userdata('idUser');
                $photo = $this->input->post('photo');
                //if the insert has returned true then we show the flash message

                if ($this->login_model->check_photo($photo,$idUser)) {
                	if($this->login_model->update_user($idUser, $data_user, $data_bdp, $data_mail) == TRUE){
                		$this->session->set_flashdata('Message','El Usuario Ha Sido Modificado!.');
        		   		redirect(base_url().'admin/account/view/','refresh');
            		}else{
            			$this->session->set_flashdata('Message','Ha Ocurrrido Usuarion Error, Porfavor Intente Otra Vez!.');
        				redirect(base_url().'admin/account/view/','refresh');
            		}
                }else{
                	$this->upload->initialize($config);
                	if (!$this->upload->do_upload('userfile')) {
            			$error = $this->upload->display_errors();
            			$this->session->set_flashdata('imagen', $error);
            			redirect(base_url().'admin/account/view/', 'refresh');
            		}else{
            			if($this->login_model->update_user($idUser, $data_user, $data_bdp, $data_mail) == TRUE){
	                		$this->session->set_flashdata('Message','El Usuario Ha Sido Modificado!.');
	        		   		redirect(base_url().'admin/account/view/','refresh');
	            		}else{
	            			$this->session->set_flashdata('Message','Ha Ocurrrido Usuarion Error, Porfavor Intente Otra Vez!.');
	        				redirect(base_url().'admin/account/view/','refresh');
	            		}
            		}
                }

            }//validation run
            else{
            	$data = array(
                        'title' => 'Actualizar Cuenta de Admin',
                        'username' => $this->session->userdata('username'),
                        'url' => 'admin/account/update',
                        'mails' => $this->login_model->get_data_tbl(1,'System'),
                        'data' => $this->login_model->get_user(($this->session->userdata('idUser')),($this->session->userdata('profile')))
                );
                $this->load->view('template/head', $data);
                $this->load->view('template/header_admin');
                $this->load->view('admin_edit');
                $this->load->view('template/footer_admin');
            }

        }
        else{
        	redirect(base_url().'admin/account/view','refresh');
        }

    }//update

    public function uView()
	{
		$idUser = $this->uri->segment(4);
		$data = array(
                'title' => 'Actualizando Cuenta de Reclutador',
                'username' => $this->session->userdata('username'),
                'mails' => $this->login_model->get_data_tbl(1,'System'),
                'data' => $this->login_model->get_user($idUser,'reclutador'),
                'url' => ('admin/user/update/')
 		);
		$this->load->view('template/head', $data);
    	$this->load->view('template/header_admin');
		$this->load->view('admin_user_edit');
		$this->load->view('template/footer_admin');
	}
	public function uUpdate()
    {
        if ($this->input->server('REQUEST_METHOD') === 'POST')
        {
            //form validation
        	$idUser = $this->uri->segment(4);
            $this->form_validation->set_rules('username', 'Nombre de Usuario', 'required|trim|min_length[4]|max_length[25]');
            $this->form_validation->set_rules('password', 'Contraseña', 'trim|min_length[5]|max_length[30]');
            $this->form_validation->set_rules('name', 'Nombre', 'required|trim|min_length[3]|max_length[50]');
            $this->form_validation->set_rules('surname', 'Apellido', 'required|trim|min_length[4]|max_length[50]');
            $this->form_validation->set_rules('mail', 'Correo', 'required|trim|valid_email|min_length[5]|max_length[45]');
            $this->form_validation->set_rules('idCard', 'Identificacion', 'required|trim|min_length[7]|max_length[20]');
            //$this->form_validation->set_rules('photo', 'Foto', 'required');
            $this->form_validation->set_message('valid_email', 'El %s no es válido');
            $this->form_validation->set_message('required','Campo Necesario!.');
            $this->form_validation->set_message('min_length','Tamaño Minimo %s');
            $this->form_validation->set_message('max_length','Tamaño Maximo %s');
            $this->form_validation->set_error_delimiters('
warning ', '
');

            //if the form has passed through the validation
            if ($this->form_validation->run() == true)
            {
            	$path = "./assets/img/photos/";
        		//chmod($path, 0777);
            	$config['upload_path']= $path;
            	$config['allowed_types']="jpg|png|jpeg";
		        $config['max_size']     = '3000';
				$config['max_width'] = '3048';
				$config['max_height'] = '3080';

                if ($this->input->post('password') != '') {
                    $data_user = array(
                        'isActive' => $this->input->post('isActive'),
                    );
                }else{
                    $data_user = array(
                        'isActive' => $this->input->post('isActive'),
                        'password' => sha1($this->input->post('password'))
                    );
                }

                $data_bdp = array(
                	'gender' => $this->input->post('gender'),
                    'name' => $this->input->post('name'),
                    'surname' => $this->input->post('surname'),
                    'idCard' => $this->input->post('idCard'),
                    'photo' => $this->input->post('photo')
                    );
                $data_mail['mail']= $this->input->post('mail');
                $photo = $this->input->post('photo');
                //if the insert has returned true then we show the flash message

                if ($this->login_model->check_photo($photo,$idUser)) {
                	if($this->login_model->update_user($idUser, $data_user, $data_bdp, $data_mail) == TRUE){
                		$this->session->set_flashdata('Message','El Usuario Ha Sido Modificado!.');
        		   		redirect(base_url().'admin/user/view/'.$idUser,'refresh');
            		}else{
            			$this->session->set_flashdata('Message','Ha Ocurrrido Usuarion Error, Porfavor Intente Otra Vez!.');
        				redirect(base_url().'admin/user/view/'.$idUser,'refresh');
            		}
                }else{
                	$this->upload->initialize($config);
                	if (!$this->upload->do_upload('userfile')) {
            			$error = $this->upload->display_errors();
            			$this->session->set_flashdata('imagen', $error);
            			redirect(base_url().'admin/user/view/'.$idUser, 'refresh');
            		}else{
            			if($this->login_model->update_user($idUser, $data_user, $data_bdp, $data_mail) == TRUE){
	                		$this->session->set_flashdata('Message','El Usuario Ha Sido Modificado!.');
	        		   		redirect(base_url().'admin/user/view/'.$idUser,'refresh');
	            		}else{
	            			$this->session->set_flashdata('Message','Ha Ocurrrido Usuarion Error, Porfavor Intente Otra Vez!.');
	        				redirect(base_url().'admin/user/view/'.$idUser,'refresh');
	            		}
            		}
                }

            }//validation run
            else{
            	$data = array(
		                'title' => 'Actualizando Cuenta de Reclutador',
		                'username' => $this->session->userdata('username'),
                        'mails' => $this->login_model->get_data_tbl(1,'System'),
		                'data' => $this->login_model->get_user($idUser,'reclutador'),
		                'url' => ('admin/user/update/')
		 		);
				$this->load->view('template/head', $data);
		    	$this->load->view('template/header_admin');
				$this->load->view('admin_user_edit');
				$this->load->view('template/footer_admin');
		            }

        }
        else{
        	redirect(base_url().'admin/user/view/'.$idUser,'refresh');
        }

    }//update
    public function pView()
	{
		$idUser = $this->uri->segment(4);
		$data = array(
                'title' => 'Actualizando Cuenta de Postulantes',
                'username' => $this->session->userdata('username'),
                'mails' => $this->login_model->get_data_tbl(1,'System'),
                'data' => $this->login_model->get_user($idUser,'postulante'),
                'url' => ('admin/users/update/')
 		);
		$this->load->view('template/head', $data);
    	$this->load->view('template/header_admin');
		$this->load->view('admin_user_edit');
		$this->load->view('template/footer_admin');
	}
	public function pUpdate()
    {
        if ($this->input->server('REQUEST_METHOD') === 'POST')
        {
            //form validation
        	$idUser = $this->uri->segment(4);
            $this->form_validation->set_rules('username', 'Nombre de Usuario', 'required|trim|min_length[4]|max_length[25]');
            $this->form_validation->set_rules('password', 'Contraseña', 'trim|min_length[5]|max_length[30]');
            $this->form_validation->set_rules('name', 'Nombre', 'required|trim|min_length[3]|max_length[50]');
            $this->form_validation->set_rules('surname', 'Apellido', 'required|trim|min_length[4]|max_length[50]');
            $this->form_validation->set_rules('mail', 'Correo', 'required|trim|valid_email|min_length[5]|max_length[45]');
            $this->form_validation->set_rules('idCard', 'Identificacion', 'required|trim|min_length[7]|max_length[20]');
            //$this->form_validation->set_rules('photo', 'Foto', 'required');
            $this->form_validation->set_message('valid_email', 'El %s no es válido');
            $this->form_validation->set_message('required','Campo Necesario!.');
            $this->form_validation->set_message('min_length','Tamaño Minimo %s');
            $this->form_validation->set_message('max_length','Tamaño Maximo %s');
            $this->form_validation->set_error_delimiters('
warning ', '
');

            //if the form has passed through the validation
            if ($this->form_validation->run() == true)
            {
            	$path = "./assets/img/photos/";
        		//chmod($path, 0777);
            	$config['upload_path']= $path;
            	$config['allowed_types']="jpg|png|jpeg";
		        $config['max_size']     = '3000';
				$config['max_width'] = '3048';
				$config['max_height'] = '3080';

            	if ($this->input->post('password') != '') {
                    $data_user = array(
                        'isActive' => $this->input->post('isActive'),
                    );
                }else{
                    $data_user = array(
                        'isActive' => $this->input->post('isActive'),
                        'password' => sha1($this->input->post('password'))
                    );
                }
                $data_bdp = array(
                	'gender' => $this->input->post('gender'),
                    'name' => $this->input->post('name'),
                    'surname' => $this->input->post('surname'),
                    'idCard' => $this->input->post('idCard'),
                    'photo' => $this->input->post('photo')
                    );
                $photo = $this->input->post('photo');
                $data_mail['mail']= $this->input->post('mail');
                //if the insert has returned true then we show the flash message

                if ($this->login_model->check_photo($photo,$idUser)) {
                	if($this->login_model->update_user($idUser, $data_user, $data_bdp, $data_mail) == TRUE){
                		$this->session->set_flashdata('Message','El Usuario Ha Sido Modificado!.');
        		   		redirect(base_url().'admin/users/view/'.$idUser,'refresh');
            		}else{
            			$this->session->set_flashdata('Message','Ha Ocurrrido Usuarion Error, Porfavor Intente Otra Vez!.');
        				redirect(base_url().'admin/users/view/'.$idUser,'refresh');
            		}
                }else{
                	$this->upload->initialize($config);
                	if (!$this->upload->do_upload('userfile')) {
            			$error = $this->upload->display_errors();
            			$this->session->set_flashdata('imagen', $error);
            			redirect(base_url().'admin/user/view/'.$idUser, 'refresh');
            		}else{
            			if($this->login_model->update_user($idUser, $data_user, $data_bdp, $data_mail) == TRUE){
	                		$this->session->set_flashdata('Message','El Usuario Ha Sido Modificado!.');
	        		   		redirect(base_url().'admin/users/view/'.$idUser,'refresh');
	            		}else{
	            			$this->session->set_flashdata('Message','Ha Ocurrrido Usuarion Error, Porfavor Intente Otra Vez!.');
	        				redirect(base_url().'admin/users/view/'.$idUser,'refresh');
	            		}
            		}
                }

                //redirect(base_url().'admin/updateView');

            }//validation run
            else{
            	$idUser = $this->uri->segment(4);
                $data = array(
                        'title' => 'Actualizando Cuenta de Postulantes',
                        'username' => $this->session->userdata('username'),
                        'mails' => $this->login_model->get_data_tbl(1,'System'),
                        'data' => $this->login_model->get_user($idUser,'postulante'),
                        'url' => ('admin/users/update/')
                );
                $this->load->view('template/head', $data);
                $this->load->view('template/header_admin');
                $this->load->view('admin_user_edit');
                $this->load->view('template/footer_admin');
            }

        }
        else{
        	redirect(base_url().'admin/users/view/'.$idUser,'refresh');
        }

    }//update

    public function cView()
	{
		$data = array(
                'title' => 'Crear Cuenta de Postulantes',
                'mails' => $this->login_model->get_data_tbl(1,'System'),
                'username' => $this->session->userdata('username'),
                'url' => ('admin/account/creating/')
 		);
		$this->load->view('template/head', $data);
    	$this->load->view('template/header_admin');
		$this->load->view('user_create');
		$this->load->view('template/footer_admin');
	}
	public function create()
    {
        if ($this->input->server('REQUEST_METHOD') === 'POST')
        {
            //form validation
            $this->form_validation->set_rules('username', 'Nombre de Usuario', 'required|trim|min_length[4]|max_length[25]');
            $this->form_validation->set_rules('password', 'Contraseña', 'required|trim|min_length[5]|max_length[30]');
            $this->form_validation->set_rules('name', 'Nombre', 'required|trim|min_length[3]|max_length[50]');
            $this->form_validation->set_rules('surname', 'Apellido', 'required|trim|min_length[4]|max_length[50]');
            $this->form_validation->set_rules('mail', 'Correo', 'required|trim|valid_email|min_length[5]|max_length[45]');
            $this->form_validation->set_rules('idCard', 'Identificacion', 'required|trim|min_length[7]|max_length[20]');
            //$this->form_validation->set_rules('photo', 'Foto', 'required');
            $this->form_validation->set_message('valid_email', 'El %s no es válido');
            $this->form_validation->set_message('required','Campo Necesario!.');
            $this->form_validation->set_message('min_length','Tamaño Minimo %s');
            $this->form_validation->set_message('max_length','Tamaño Maximo %s');
            $this->form_validation->set_error_delimiters('
warning ', '
');

            //if the form has passed through the validation
            if ($this->form_validation->run() == true)
            {
            	$path = "./assets/img/photos/";
        		//chmod($path, 0777);
            	$config['upload_path']= $path;
            	$config['allowed_types']="jpg|png|jpeg";
		        $config['max_size']     = '3000';
				$config['max_width'] = '3048';
				$config['max_height'] = '3080';

            	$data_user = array(
            			'idBDP' => '',
            			'username' => $this->input->post('username'),
            			'profile' => 'reclutador',
	                    'password' => sha1($this->input->post('password'))
	                    );
                $data_bdp = array(
                	'gender' => $this->input->post('gender'),
                    'name' => $this->input->post('name'),
                    'surname' => $this->input->post('surname'),
                    'idCard' => $this->input->post('idCard'),
                    'photo' => 'default.png'
                    );
                $data_mail = array('mail' => $this->input->post('mail'),
                	'idBDP' => '',
                	);
                $document = $this->input->post('idCard');

                if (($this->login_model->check_ID($document))==true) {
                	$this->session->set_flashdata('Message','El usuario que intenta crear ya existe si olvido su contrasena pongase en contacto con el administrador');
        		   redirect(base_url().'admin/account/create/','refresh');

                }elseif (($this->login_model->check_username($this->input->post('username')))==true) {
                	$this->session->set_flashdata('Message','El nombre de usuario no esta disponible, porfavor pruebe con otro');
        		   redirect(base_url().'admin/account/create/','refresh');

                }elseif (($this->login_model->check_mail($this->input->post('mail')))==true) {
                	$this->session->set_flashdata('Message','El correo ya esta en uso, pruebe con otro');
        		   redirect(base_url().'admin/account/create/','refresh');
                }else{
                	if ($this->input->post('photo') != '') {
	                	$this->upload->initialize($config);
	                	$data_bdp['photo'] = $this->input->post('photo');

	                	if (!$this->upload->do_upload('userfile')) {
	            			$error = $this->upload->display_errors();
	            			$this->session->set_flashdata('imagen', $error);
	            			redirect(base_url().'admin/account/create/', 'refresh');
	            		}
	            		if($this->login_model->create_user($data_user, $data_bdp, $data_mail) == TRUE){
	            			redirect(base_url().'admin/');
		            	}else{
		                    $this->session->set_flashdata('Message','Los datos introducidos son incorrectos');
	            			redirect(base_url().'admin/account/create/','refresh');
		                }
		                $this->index();
	            	}
	            	else{
	            		if($this->login_model->create_user($data_user, $data_bdp, $data_mail) == TRUE){
	            			redirect(base_url().'admin/');
		            	}else{
		                    $this->session->set_flashdata('Message','Los datos introducidos son incorrectos');
	            			redirect(base_url().'admin/account/create/','refresh');
		                }
		                $this->index();
	            	}
	            }
	                //redirect(base_url().'admin/updateView');

            }//validation run
            else{
                $data = array(
                        'title' => 'Crear Cuenta de Postulantes',
                        'username' => $this->session->userdata('username'),
                        'mails' => $this->login_model->get_data_tbl(1,'System'),
                        'url' => ('admin/account/creating/')
                );
                $this->load->view('template/head', $data);
                $this->load->view('template/header_admin');
                $this->load->view('user_create');
                $this->load->view('template/footer_admin');
            }

        }

    }//update
    //-------------------------------------------------------------------
    public function loadMore()
    {
        sleep(3);
        if($this->input->is_ajax_request() && $this->input->post("lastId"))
        {
            $datos = $this->login_model->get_users_3((int)$this->input->post("lastId"));
            if($datos !== FALSE)
            {
                echo json_encode(array("res" => "success", "users" => $datos));
            }
            else
            {
                echo json_encode(array("res" => "empty"));
            }
        }
    }

}


text:
package sarama

import (
	"reflect"
	"testing"
)

var (
	syncGroupResponseV0NoError = []byte{
		0x00, 0x00, // No error
		0, 0, 0, 3, 0x01, 0x02, 0x03, // Member assignment data
	}

	syncGroupResponseV0WithError = []byte{
		0, 27, // ErrRebalanceInProgress
		0, 0, 0, 0, // No member assignment data
	}

	syncGroupResponseV1NoError = []byte{
		0, 0, 0, 100, // ThrottleTimeMs
		0x00, 0x00, // No error
		0, 0, 0, 3, 0x01, 0x02, 0x03, // Member assignment data
	}
)

func TestSyncGroupResponse(t *testing.T) {
	tests := []struct {
		CaseName     string
		Version      int16
		MessageBytes []byte
		Message      *SyncGroupResponse
	}{
		{
			"v0-noErr",
			0,
			syncGroupResponseV0NoError,
			&SyncGroupResponse{
				Version:          0,
				Err:              ErrNoError,
				MemberAssignment: []byte{1, 2, 3},
			},
		},
		{
			"v0-Err",
			0,
			syncGroupResponseV0WithError,
			&SyncGroupResponse{
				Version:          0,
				Err:              ErrRebalanceInProgress,
				MemberAssignment: []byte{},
			},
		},
		{
			"v1-noErr",
			1,
			syncGroupResponseV1NoError,
			&SyncGroupResponse{
				ThrottleTime:     100,
				Version:          1,
				Err:              ErrNoError,
				MemberAssignment: []byte{1, 2, 3},
			},
		},
	}
	for _, c := range tests {
		response := new(SyncGroupResponse)
		testVersionDecodable(t, c.CaseName, response, c.MessageBytes, c.Version)
		if !reflect.DeepEqual(c.Message, response) {
			t.Errorf("case %s decode failed, expected:%+v got %+v", c.CaseName, c.Message, response)
		}
		testEncodable(t, c.CaseName, c.Message, c.MessageBytes)
	}
}


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="keywords" content="{% block meta-keywords %}{% endblock %}" />
    <meta name="description" content="{% block meta-description %}{% endblock %}" />
    <title>{% block meta-title %}{% block title %}{% endblock %} - No base template{% endblock %}</title>

    <meta property="og:type" content="{% block og-type %}website{% endblock %}" />
    <meta property="og:image" content="http://{{ request.get_host }}{% block og-image %}{{ STATIC_URL }}logo.jpg{% endblock %}" />
    <meta property="og:description" content="{% block og-description %}{% endblock %}" />

    {% block link %}{% endblock %}

    {% block script %}{% endblock %}

{% block staff_toolbar %}{% endblock %}{# fix template extends of old project templates #}

No base template is set for django-fluent-blogs

To configure the blog base template, either:

create a template named: fluent_blogs/base.html.

set FLUENT_BLOGS_BASE_TEMPLATE to the desired base template file.

The template needs to provide the following blocks:

content	The block for the main content.

title	The contents for the <title> tag.

link	The placeholder for <link> tags for RSS feeds and CSS.

script	The placeholder for <script> tags.

meta-title	The content for the <title> tag, completely overriding the default title.

meta-description	The content for the <meta name="description"> tag.

meta-keywords	The content for the <meta name="keywords"> tag.

og-type	The content for the <meta property="og:type"> tag for Facebook (optional)

og-description	The content for the <meta property="og:type"> tag for Facebook (optional)

The blog contents is displayed below:

{% block content %}{% endblock %}


text:
from django import template
from django.db import models

class HiiCartTemplateError(Exception):
  pass

register = template.Library()

_google_periods = {(1, "DAY"): "DAILY",
                   (7, "DAY"): "WEEKLY",
                   (15, "DAY"): "SEMI_MONTHLY",
                   (1, "MONTH"): "MONTHLY",
                   (2, "MONTH"): "EVERY_TWO_MONTHS",
                   (3, "MONTH"): "QUARTERLY",
                   (365, "YEAR"): "YEARLY",
                   (12, "MONTH"): "YEARLY"}

@register.simple_tag
def google_recur_period(item):
    """Get the Google-friendly subscription period.

    Valid values are DAILY, WEEKLY, SEMI_MONTHLY, MONTHLY,
    EVERY_TWO_MONTHS, QUARTERLY, and YEARLY.
    """
    period = (item.duration, item.duration_unit)
    if period not in _google_periods:
      raise HiiCartTemplateError("Invalid subscription period provided for Google Checkout.")
    return _google_periods[period]
google_recur_period.is_safe = True