text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.automanage.implementation;

import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Headers;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.resourcemanager.automanage.fluent.ReportsClient;
import com.azure.resourcemanager.automanage.fluent.models.ReportInner;
import com.azure.resourcemanager.automanage.models.ReportList;
import reactor.core.publisher.Mono;

/** An instance of this class provides access to all the operations defined in ReportsClient. */
public final class ReportsClientImpl implements ReportsClient {
    /** The proxy service used to perform REST calls. */
    private final ReportsService service;

    /** The service client containing this operation class. */
    private final AutomanageClientImpl client;

    /**
     * Initializes an instance of ReportsClientImpl.
     *
     * @param client the instance of the service client containing this operation class.
     */
    ReportsClientImpl(AutomanageClientImpl client) {
        this.service = RestProxy.create(ReportsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
        this.client = client;
    }

    /**
     * The interface defining all the services for AutomanageClientReports to be used by the proxy service to perform
     * REST calls.
     */
    @Host("{$host}")
    @ServiceInterface(name = "AutomanageClientRepo")
    private interface ReportsService {
        @Headers({"Content-Type: application/json"})
        @Get(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute"
                + "/virtualMachines/{vmName}/providers/Microsoft.Automanage/configurationProfileAssignments"
                + "/{configurationProfileAssignmentName}/reports/{reportName}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<ReportInner>> get(
            @HostParam("$host") String endpoint,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("configurationProfileAssignmentName") String configurationProfileAssignmentName,
            @PathParam("reportName") String reportName,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("vmName") String vmName,
            @QueryParam("api-version") String apiVersion,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute"
                + "/virtualMachines/{vmName}/providers/Microsoft.Automanage/configurationProfileAssignments"
                + "/{configurationProfileAssignmentName}/reports")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<ReportList>> listByConfigurationProfileAssignments(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("configurationProfileAssignmentName") String configurationProfileAssignmentName,
            @PathParam("vmName") String vmName,
            @QueryParam("api-version") String apiVersion,
            @HeaderParam("Accept") String accept,
            Context context);
    }

    /**
     * Get information about a report associated with a configuration profile assignment run.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param configurationProfileAssignmentName The configuration profile assignment name.
     * @param reportName The report name.
     * @param vmName The name of the virtual machine.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return information about a report associated with a configuration profile assignment run along with {@link
     *     Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<ReportInner>> getWithResponseAsync(
        String resourceGroupName, String configurationProfileAssignmentName, String reportName, String vmName) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (configurationProfileAssignmentName == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter configurationProfileAssignmentName is required and cannot be null."));
        }
        if (reportName == null) {
            return Mono.error(new IllegalArgumentException("Parameter reportName is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (vmName == null) {
            return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .get(
                            this.client.getEndpoint(),
                            resourceGroupName,
                            configurationProfileAssignmentName,
                            reportName,
                            this.client.getSubscriptionId(),
                            vmName,
                            this.client.getApiVersion(),
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get information about a report associated with a configuration profile assignment run.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param configurationProfileAssignmentName The configuration profile assignment name.
     * @param reportName The report name.
     * @param vmName The name of the virtual machine.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return information about a report associated with a configuration profile assignment run along with {@link
     *     Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<ReportInner>> getWithResponseAsync(
        String resourceGroupName,
        String configurationProfileAssignmentName,
        String reportName,
        String vmName,
        Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (configurationProfileAssignmentName == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter configurationProfileAssignmentName is required and cannot be null."));
        }
        if (reportName == null) {
            return Mono.error(new IllegalArgumentException("Parameter reportName is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (vmName == null) {
            return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .get(
                this.client.getEndpoint(),
                resourceGroupName,
                configurationProfileAssignmentName,
                reportName,
                this.client.getSubscriptionId(),
                vmName,
                this.client.getApiVersion(),
                accept,
                context);
    }

    /**
     * Get information about a report associated with a configuration profile assignment run.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param configurationProfileAssignmentName The configuration profile assignment name.
     * @param reportName The report name.
     * @param vmName The name of the virtual machine.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return information about a report associated with a configuration profile assignment run on successful
     *     completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<ReportInner> getAsync(
        String resourceGroupName, String configurationProfileAssignmentName, String reportName, String vmName) {
        return getWithResponseAsync(resourceGroupName, configurationProfileAssignmentName, reportName, vmName)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Get information about a report associated with a configuration profile assignment run.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param configurationProfileAssignmentName The configuration profile assignment name.
     * @param reportName The report name.
     * @param vmName The name of the virtual machine.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return information about a report associated with a configuration profile assignment run.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ReportInner get(
        String resourceGroupName, String configurationProfileAssignmentName, String reportName, String vmName) {
        return getAsync(resourceGroupName, configurationProfileAssignmentName, reportName, vmName).block();
    }

    /**
     * Get information about a report associated with a configuration profile assignment run.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param configurationProfileAssignmentName The configuration profile assignment name.
     * @param reportName The report name.
     * @param vmName The name of the virtual machine.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return information about a report associated with a configuration profile assignment run along with {@link
     *     Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<ReportInner> getWithResponse(
        String resourceGroupName,
        String configurationProfileAssignmentName,
        String reportName,
        String vmName,
        Context context) {
        return getWithResponseAsync(resourceGroupName, configurationProfileAssignmentName, reportName, vmName, context)
            .block();
    }

    /**
     * Retrieve a list of reports within a given configuration profile assignment.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param configurationProfileAssignmentName The configuration profile assignment name.
     * @param vmName The name of the virtual machine.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of the list report operation along with {@link PagedResponse} on successful completion of
     *     {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<ReportInner>> listByConfigurationProfileAssignmentsSinglePageAsync(
        String resourceGroupName, String configurationProfileAssignmentName, String vmName) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (configurationProfileAssignmentName == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter configurationProfileAssignmentName is required and cannot be null."));
        }
        if (vmName == null) {
            return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .listByConfigurationProfileAssignments(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            resourceGroupName,
                            configurationProfileAssignmentName,
                            vmName,
                            this.client.getApiVersion(),
                            accept,
                            context))
            .<PagedResponse<ReportInner>>map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Retrieve a list of reports within a given configuration profile assignment.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param configurationProfileAssignmentName The configuration profile assignment name.
     * @param vmName The name of the virtual machine.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of the list report operation along with {@link PagedResponse} on successful completion of
     *     {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<ReportInner>> listByConfigurationProfileAssignmentsSinglePageAsync(
        String resourceGroupName, String configurationProfileAssignmentName, String vmName, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (configurationProfileAssignmentName == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter configurationProfileAssignmentName is required and cannot be null."));
        }
        if (vmName == null) {
            return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listByConfigurationProfileAssignments(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                resourceGroupName,
                configurationProfileAssignmentName,
                vmName,
                this.client.getApiVersion(),
                accept,
                context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null));
    }

    /**
     * Retrieve a list of reports within a given configuration profile assignment.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param configurationProfileAssignmentName The configuration profile assignment name.
     * @param vmName The name of the virtual machine.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of the list report operation as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<ReportInner> listByConfigurationProfileAssignmentsAsync(
        String resourceGroupName, String configurationProfileAssignmentName, String vmName) {
        return new PagedFlux<>(
            () ->
                listByConfigurationProfileAssignmentsSinglePageAsync(
                    resourceGroupName, configurationProfileAssignmentName, vmName));
    }

    /**
     * Retrieve a list of reports within a given configuration profile assignment.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param configurationProfileAssignmentName The configuration profile assignment name.
     * @param vmName The name of the virtual machine.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of the list report operation as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<ReportInner> listByConfigurationProfileAssignmentsAsync(
        String resourceGroupName, String configurationProfileAssignmentName, String vmName, Context context) {
        return new PagedFlux<>(
            () ->
                listByConfigurationProfileAssignmentsSinglePageAsync(
                    resourceGroupName, configurationProfileAssignmentName, vmName, context));
    }

    /**
     * Retrieve a list of reports within a given configuration profile assignment.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param configurationProfileAssignmentName The configuration profile assignment name.
     * @param vmName The name of the virtual machine.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of the list report operation as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<ReportInner> listByConfigurationProfileAssignments(
        String resourceGroupName, String configurationProfileAssignmentName, String vmName) {
        return new PagedIterable<>(
            listByConfigurationProfileAssignmentsAsync(resourceGroupName, configurationProfileAssignmentName, vmName));
    }

    /**
     * Retrieve a list of reports within a given configuration profile assignment.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param configurationProfileAssignmentName The configuration profile assignment name.
     * @param vmName The name of the virtual machine.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of the list report operation as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<ReportInner> listByConfigurationProfileAssignments(
        String resourceGroupName, String configurationProfileAssignmentName, String vmName, Context context) {
        return new PagedIterable<>(
            listByConfigurationProfileAssignmentsAsync(
                resourceGroupName, configurationProfileAssignmentName, vmName, context));
    }
}


text:
title:          Sample project
categories: Projects Cinematic Performatic Video Sound Collage
intro: Some intro text to be used on the header and frontpage
featured_image: /media/images/flowergirl.jpg
featured_video:

home_show: true
home_call: go to the project website
home_url:  http://XXXX

published: false
date:  2020-12-31 00:00:00 +0100
---

@todo

redpajama_set_name: RedPajamaGithub


text:
Display customization

<form action="#custom" method="POST" />

Sort method

  {{ display_form.sort_method }}

Show fields

  {% for field in dc.get_display_fields_config %}

    <input id="id_{{ field.codename }}" type="checkbox" name="{{ field.codename }}"{% if field.active %} checked="checked"{% endif %} />
    {{ field.description }}

  {% endfor %}

  <input type="submit" value="Save configuration" name="save_display" />
</form>


text:
#ifndef CORE_SCHEDULER_H
#define CORE_SCHEDULER_H

#include <buildinfo.h>

#include <stdint.h>

#include <hal/scheduler.h>

typedef struct SchedulerProcess_s {
     uint32_t id;
     int used;
     struct proc_regs registers;
     struct SchedulerProcess_s *prev;
     struct SchedulerProcess_s *next;
} SchedulerProcess;

void CoSchedulerHandler(void);
SchedulerProcess *CoSchedulerCurProcess(void);
uint32_t CoSchedulerNumProcesses(void);
SchedulerProcess *CoSchedulerPrevProcess(void);
SchedulerProcess *CoSchedulerNextProcess(void);
SchedulerProcess *CoSchedulerAllocateProcess();

/* Defined here for simplicitly,
 * however the function is in hal/scheduler.c
 */
void HalSchedulerRunProcess(SchedulerProcess *proc);

#endif /* end of include guard: CORE_SCHEDULER_H */


text:
/*
 * Minio Cloud Storage, (C) 2016, 2017, 2018 Minio, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package cmd

import (
	"context"
	"path"
	"sync"

	humanize "github.com/dustin/go-humanize"
	"github.com/minio/minio/cmd/logger"
)

const (
	// Block size used for all internal operations version 1.
	blockSizeV1 = 10 * humanize.MiByte

	// Staging buffer read size for all internal operations version 1.
	readSizeV1 = 1 * humanize.MiByte

	// Buckets meta prefix.
	bucketMetaPrefix = "buckets"

	// ETag (hex encoded md5sum) of empty string.
	emptyETag = "d41d8cd98f00b204e9800998ecf8427e"
)

// Global object layer mutex, used for safely updating object layer.
var globalObjLayerMutex *sync.RWMutex

// Global object layer, only accessed by newObjectLayerFn().
var globalObjectAPI ObjectLayer

//Global cacheObjects, only accessed by newCacheObjectsFn().
var globalCacheObjectAPI CacheObjectLayer

func init() {
	// Initialize this once per server initialization.
	globalObjLayerMutex = &sync.RWMutex{}
}

// Checks if the object is a directory, this logic uses
// if size == 0 and object ends with slashSeparator then
// returns true.
func isObjectDir(object string, size int64) bool {
	return hasSuffix(object, slashSeparator) && size == 0
}

// Converts just bucket, object metadata into ObjectInfo datatype.
func dirObjectInfo(bucket, object string, size int64, metadata map[string]string) ObjectInfo {
	// This is a special case with size as '0' and object ends with
	// a slash separator, we treat it like a valid operation and
	// return success.
	etag := metadata["etag"]
	delete(metadata, "etag")
	if etag == "" {
		etag = emptyETag
	}

	return ObjectInfo{
		Bucket:      bucket,
		Name:        object,
		ModTime:     UTCNow(),
		ContentType: "application/octet-stream",
		IsDir:       true,
		Size:        size,
		ETag:        etag,
		UserDefined: metadata,
	}
}

func deleteBucketMetadata(ctx context.Context, bucket string, objAPI ObjectLayer) {
	// Delete bucket access policy, if present - ignore any errors.
	removePolicyConfig(ctx, objAPI, bucket)

	// Delete notification config, if present - ignore any errors.
	removeNotificationConfig(ctx, objAPI, bucket)

	// Delete listener config, if present - ignore any errors.
	removeListenerConfig(ctx, objAPI, bucket)
}

// Depending on the disk type network or local, initialize storage API.
func newStorageAPI(endpoint Endpoint) (storage StorageAPI, err error) {
	if endpoint.IsLocal {
		return newPosix(endpoint.Path)
	}

	return newStorageRESTClient(endpoint)
}

// Cleanup a directory recursively.
func cleanupDir(ctx context.Context, storage StorageAPI, volume, dirPath string) error {
	var delFunc func(string) error
	// Function to delete entries recursively.
	delFunc = func(entryPath string) error {
		if !hasSuffix(entryPath, slashSeparator) {
			// Delete the file entry.
			err := storage.DeleteFile(volume, entryPath)
			logger.LogIf(ctx, err)
			return err
		}

		// If it's a directory, list and call delFunc() for each entry.
		entries, err := storage.ListDir(volume, entryPath, -1)
		// If entryPath prefix never existed, safe to ignore.
		if err == errFileNotFound {
			return nil
		} else if err != nil { // For any other errors fail.
			logger.LogIf(ctx, err)
			return err
		} // else on success..

		// Entry path is empty, just delete it.
		if len(entries) == 0 {
			err = storage.DeleteFile(volume, path.Clean(entryPath))
			logger.LogIf(ctx, err)
			return err
		}

		// Recurse and delete all other entries.
		for _, entry := range entries {
			if err = delFunc(pathJoin(entryPath, entry)); err != nil {
				return err
			}
		}
		return nil
	}
	err := delFunc(retainSlash(pathJoin(dirPath)))
	return err
}

// Removes notification.xml for a given bucket, only used during DeleteBucket.
func removeNotificationConfig(ctx context.Context, objAPI ObjectLayer, bucket string) error {
	// Verify bucket is valid.
	if !IsValidBucketName(bucket) {
		return BucketNameInvalid{Bucket: bucket}
	}

	ncPath := path.Join(bucketConfigPrefix, bucket, bucketNotificationConfig)
	return objAPI.DeleteObject(ctx, minioMetaBucket, ncPath)
}

// Remove listener configuration from storage layer. Used when a bucket is deleted.
func removeListenerConfig(ctx context.Context, objAPI ObjectLayer, bucket string) error {
	// make the path
	lcPath := path.Join(bucketConfigPrefix, bucket, bucketListenerConfig)
	return objAPI.DeleteObject(ctx, minioMetaBucket, lcPath)
}


text:
namespace LinuxPackages.Tools.Crawler.Models
{
    public class Package
    {
        public string Name { get; set; }

        public string Description { get; set; }

        public string CategoryName { get; set; }
    }
}


text:
package br.com.caelum.leilao.servico;

import java.util.Calendar;

public class RelogioDoSistema implements Relogio {
	public Calendar hoje() {
		return Calendar.getInstance();
	}
}


text:
import numpy as np
import sys
import math
import sklearn.cluster
from skfeature.utility.construct_W import construct_W

def ndfs(X, **kwargs):
    """
    This function implement unsupervised feature selection using nonnegative spectral analysis, i.e.,
    min_{F,W} Tr(F^T L F) + alpha*(||XW-F||_F^2 + beta*||W||_{2,1}) + gamma/2 * ||F^T F - I||_F^2
    s.t. F >= 0

    Input
    -----
    X: {numpy array}, shape (n_samples, n_features)
        input data
    kwargs: {dictionary}
        W: {sparse matrix}, shape {n_samples, n_samples}
            affinity matrix
        alpha: {float}
            Parameter alpha in objective function
        beta: {float}
            Parameter beta in objective function
        gamma: {float}
            a very large number used to force F^T F = I
        F0: {numpy array}, shape (n_samples, n_clusters)
            initialization of the pseudo label matirx F, if not provided
        n_clusters: {int}
            number of clusters
        verbose: {boolean}
            True if user want to print out the objective function value in each iteration, false if not

    Output
    ------
    W: {numpy array}, shape(n_features, n_clusters)
        feature weight matrix

    Reference:
        Li, Zechao, et al. "Unsupervised Feature Selection Using Nonnegative Spectral Analysis." AAAI. 2012.
    """

    # default gamma is 10e8
    if 'gamma' not in kwargs:
        gamma = 10e8
    else:
        gamma = kwargs['gamma']
    # use the default affinity matrix
    if 'W' not in kwargs:
        W = construct_W(X)
    else:
        W = kwargs['W']
    if 'alpha' not in kwargs:
        alpha = 1
    else:
        alpha = kwargs['alpha']
    if 'beta' not in kwargs:
        beta = 1
    else:
        beta = kwargs['beta']
    if 'F0' not in kwargs:
        if 'n_clusters' not in kwargs:
            print >>sys.stderr, "either F0 or n_clusters should be provided"
        else:
            # initialize F
            n_clusters = kwargs['n_clusters']
            F = kmeans_initialization(X, n_clusters)
    else:
        F = kwargs['F0']
    if 'verbose' not in kwargs:
        verbose = False
    else:
        verbose = kwargs['verbose']

    n_samples, n_features = X.shape

    # initialize D as identity matrix
    D = np.identity(n_features)
    I = np.identity(n_samples)

    # build laplacian matrix
    L = np.array(W.sum(1))[:, 0] - W

    max_iter = 1000
    obj = np.zeros(max_iter)
    for iter_step in range(max_iter):
        # update W
        T = np.linalg.inv(np.dot(X.transpose(), X) + beta * D + 1e-6*np.eye(n_features))
        W = np.dot(np.dot(T, X.transpose()), F)
        # update D
        temp = np.sqrt((W*W).sum(1))
        temp[temp < 1e-16] = 1e-16
        temp = 0.5 / temp
        D = np.diag(temp)
        # update M
        M = L + alpha * (I - np.dot(np.dot(X, T), X.transpose()))
        M = (M + M.transpose())/2
        # update F
        denominator = np.dot(M, F) + gamma*np.dot(np.dot(F, F.transpose()), F)
        temp = np.divide(gamma*F, denominator)
        F = F*np.array(temp)
        temp = np.diag(np.sqrt(np.diag(1 / (np.dot(F.transpose(), F) + 1e-16))))
        F = np.dot(F, temp)

        # calculate objective function
        obj[iter_step] = np.trace(np.dot(np.dot(F.transpose(), M), F)) + gamma/4*np.linalg.norm(np.dot(F.transpose(), F)-np.identity(n_clusters), 'fro')
        if verbose:
            print('obj at iter {0}: {1}'.format(iter_step+1, obj[iter_step]))

        if iter_step >= 1 and math.fabs(obj[iter_step] - obj[iter_step-1]) < 1e-3:
            break
    return W

def kmeans_initialization(X, n_clusters):
    """
    This function uses kmeans to initialize the pseudo label

    Input
    -----
    X: {numpy array}, shape (n_samples, n_features)
        input data
    n_clusters: {int}
        number of clusters

    Output
    ------
    Y: {numpy array}, shape (n_samples, n_clusters)
        pseudo label matrix
    """

    n_samples, n_features = X.shape
    kmeans = sklearn.cluster.KMeans(n_clusters=n_clusters, init='k-means++', n_init=10, max_iter=300,
                                    tol=0.0001, precompute_distances=True, verbose=0,
                                    random_state=None, copy_x=True, n_jobs=1)
    kmeans.fit(X)
    labels = kmeans.labels_
    Y = np.zeros((n_samples, n_clusters))
    for row in range(0, n_samples):
        Y[row, labels[row]] = 1
    T = np.dot(Y.transpose(), Y)
    F = np.dot(Y, np.sqrt(np.linalg.inv(T)))
    F = F + 0.02*np.ones((n_samples, n_clusters))
    return F

def calculate_obj(X, W, F, L, alpha, beta):
    """
    This function calculates the objective function of NDFS
    """
    # Tr(F^T L F)
    T1 = np.trace(np.dot(np.dot(F.transpose(), L), F))
    T2 = np.linalg.norm(np.dot(X, W) - F, 'fro')
    T3 = (np.sqrt((W*W).sum(1))).sum()
    obj = T1 + alpha*(T2 + beta*T3)
    return obj


text:
<?php

/**
 *
 * Author Rizki Mufrizal <mufrizalrizki@gmail.com>
 * Since Mar 30, 2016
 * Time 6:51:43 PM
 * Encoding UTF-8
 * Project Aplikasi-Kebudayaan-Aceh
 * Package Expression package is undefined on line 12, column 14 in Templates/Scripting/PHPClass.php.
 *
 */
class UserController extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->model('User');
    }

    public function halamanUser() {
        $this->load->view('admin/UserView', array(
            'error' => NULL,
            'name' => $this->security->get_csrf_token_name(),
            'hash' => $this->security->get_csrf_hash()
        ));
    }

    public function prosesLogin() {
        $email = $this->input->post('email');
        $password = $this->input->post('password');

        $user = $this->User->ambilUserUntukLogin($email);

        if (sizeof($user) == 0) {
            $error = array('error' => 'anda belum melakukan registrasi');
            $this->load->view('admin/UserView', $error);
        } else {
            if ($this->bcrypt->check_password($password, $user[0]->password)) {
                $this->session->set_userdata(array(
                    'isLogin' => TRUE,
                    'username' => $email
                ));
                redirect('admin');
            } else {
                $error = array('error' => 'username dan password anda salah');
                $this->load->view('admin/UserView', $error);
            }
        }
    }

    public function prosesLogout() {
        $this->session->unset_userdata(array('isLogin', 'username'));
        redirect('admin/login');
    }

}


text:
<?php

namespace AppBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use AppBundle\Entity\News;
use AppBundle\Form\NewsType;

/**
 * News controller.
 *
 * @Route("/news")
 */
class NewsController extends Controller {

    protected $activePage = 'news';

    /**
     * Lists all News entities.
     *
     * @Route("/", name="news")
     * @Method("GET")
     * @Template()
     */
    public function indexAction() {
        $em = $this->getDoctrine()->getManager();

        $entities = $em->getRepository('AppBundle:News')->findAll();

        return array(
            'entities' => $entities,
            'activePage' => $this->activePage,
        );
    }

    /**
     * Creates a new News entity.
     *
     * @Route("/", name="news_create")
     * @Method("POST")
     * @Template("AppBundle:News:new.html.twig")
     */
    public function createAction(Request $request) {
        $entity = new News();
        $form = $this->createCreateForm($entity);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $path = __DIR__ . '../../../../web/img/news/';
            $now = \DateTime::createFromFormat('U.u', microtime(true));
            $name = '/web/img/news/' . md5($now->format('Y-m-d H:i:s.u')) . '.jpg';

            $photo = $request->files->get('photo');
            if ($photo) {
                $photo->move($path, $name);
                $entity->setPhoto($name);
            }

            $em = $this->getDoctrine()->getManager();
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('news_show', array('id' => $entity->getId())));
        }

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
            'activePage' => $this->activePage,
        );
    }

    /**
     * Creates a form to create a News entity.
     *
     * @param News $entity The entity
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createCreateForm(News $entity) {
        $form = $this->createForm(new NewsType(), $entity, array(
            'action' => $this->generateUrl('news_create'),
            'method' => 'POST',
        ));

        $form->add('submit', 'submit', array('label' => 'Добавить'));

        return $form;
    }

    /**
     * Displays a form to create a new News entity.
     *
     * @Route("/new", name="news_new")
     * @Method("GET")
     * @Template()
     */
    public function newAction() {
        $entity = new News();
        $form = $this->createCreateForm($entity);

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
            'activePage' => $this->activePage,
        );
    }

    /**
     * Finds and displays a News entity.
     *
     * @Route("/{id}", name="news_show")
     * @Method("GET")
     * @Template()
     */
    public function showAction($id) {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('AppBundle:News')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find News entity.');
        }

        $deleteForm = $this->createDeleteForm($id);

        return array(
            'entity' => $entity,
            'delete_form' => $deleteForm->createView(),
            'activePage' => $this->activePage,
        );
    }

    /**
     * Displays a form to edit an existing News entity.
     *
     * @Route("/{id}/edit", name="news_edit")
     * @Method("GET")
     * @Template()
     */
    public function editAction($id) {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('AppBundle:News')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find News entity.');
        }

        $editForm = $this->createEditForm($entity);
        $deleteForm = $this->createDeleteForm($id);

        return array(
            'entity' => $entity,
            'edit_form' => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
            'activePage' => $this->activePage,
        );
    }

    /**
     * Creates a form to edit a News entity.
     *
     * @param News $entity The entity
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createEditForm(News $entity) {
        $form = $this->createForm(new NewsType(), $entity, array(
            'action' => $this->generateUrl('news_update', array('id' => $entity->getId())),
            'method' => 'PUT',
        ));

        $form->add('submit', 'submit', array('label' => 'Сохранить'));

        return $form;
    }

    /**
     * Edits an existing News entity.
     *
     * @Route("/{id}", name="news_update")
     * @Method("PUT")
     * @Template("AppBundle:News:edit.html.twig")
     */
    public function updateAction(Request $request, $id) {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('AppBundle:News')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find News entity.');
        }

        $deleteForm = $this->createDeleteForm($id);
        $editForm = $this->createEditForm($entity);
        $editForm->handleRequest($request);

        if ($editForm->isValid()) {
            $path = __DIR__ . '../../../../web/img/news/';
            $now = \DateTime::createFromFormat('U.u', microtime(true));
            $name = '/web/img/news/' . md5($now->format('Y-m-d H:i:s.u')) . '.jpg';

            $photo = $request->files->get('photo');
            if ($photo) {
                $photo->move($path, $name);
                $entity->setPhoto($name);
            }

            $em->flush();

            return $this->redirect($this->generateUrl('news_edit', array('id' => $id)));
        }

        return array(
            'entity' => $entity,
            'edit_form' => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
            'activePage' => $this->activePage,
        );
    }

    /**
     * Deletes a News entity.
     *
     * @Route("/{id}", name="news_delete")
     * @Method("DELETE")
     */
    public function deleteAction(Request $request, $id) {
        $form = $this->createDeleteForm($id);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $entity = $em->getRepository('AppBundle:News')->find($id);

            if (!$entity) {
                throw $this->createNotFoundException('Unable to find News entity.');
            }

            $em->remove($entity);
            $em->flush();
        }

        return $this->redirect($this->generateUrl('news'));
    }

    /**
     * Creates a form to delete a News entity by id.
     *
     * @param mixed $id The entity id
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createDeleteForm($id) {
        return $this->createFormBuilder()
                        ->setAction($this->generateUrl('news_delete', array('id' => $id)))
                        ->setMethod('DELETE')
                        ->add('submit', 'submit', array('label' => 'Удалить'))
                        ->getForm()
        ;
    }

}


text:
{% extends "layout.html" %}
{% block body %}
    {% if error %}
{{ error }}{% endif %}

Validate Repository

About

Related Projects

      <form id="valform" action="" method="post" class="form-horizontal">

                <input class="input-xlarge" value="{{ previous_url }}" name="basic_url" id="appendedInputButton" size="16" type="text" placeholder="URL to OAI-PMH endpoint" autofocus>
                <button class="btn" type="submit">Validate!</button>

        </form>
         Validating ...

          {{ results }}

The BASE OAI-PMH
        Validator is a service provided by Bielefeld Academic Search Engine (BASE).
        It has been designed to help repository managers to easily verify if their repository is
        compliant with the BASE requirements.

To validate your repository, enter its OAI-PMH endpoint URL and press "Validate!".

Note: We use caching to minimize the number of requests to the
        repository server. However, depending on the responsiveness of the
        server, the verification process may take some time.
        Also, each request currently times out after 20 seconds.

The source code of the back end application is available on GitHub:

  Get the Code!

        Related projects:

OAI-PMH Validator

DINI Validator

{% endblock %}


text:
/*
 * FullCalendar v1.4.10 Stylesheet
 *
 * Feel free to edit this file to customize the look of FullCalendar.
 * When upgrading to newer versions, please upgrade this file as well,
 * porting over any customizations afterwards.
 *
 * Date: Sat Jan 1 23:46:27 2011 -0800
 *
 */

/* TODO: make font sizes look the same in all doctypes */

.fc,
.fc .fc-header,
.fc .fc-content {
	font-size: 1em;
	}

.fc {
	direction: ltr;
	text-align: left;
	}

.fc table {
	border-collapse: collapse;
	border-spacing: 0;
	}

.fc td, .fc th {
	padding: 0;
	vertical-align: top;
	}

/* Header
------------------------------------------------------------------------*/

table.fc-header {
	width: 100%;
	}

.fc-header-left {
	width: 25%;
	}

.fc-header-left table {
	float: left;
	}

.fc-header-center {
	width: 50%;
	text-align: center;
	}

.fc-header-center table {
	margin: 0 auto;
	}

.fc-header-right {
	width: 25%;
	}

.fc-header-right table {
	float: right;
	}

.fc-header-title {
	margin-top: 0;
	white-space: nowrap;
	}

.fc-header-space {
	padding-left: 10px;
	}

/* right-to-left */

.fc-rtl .fc-header-title {
	direction: rtl;
	}

/* Buttons
------------------------------------------------------------------------*/

.fc-header .fc-state-default,
.fc-header .ui-state-default {
	margin-bottom: 1em;
	cursor: pointer;
	}

.fc-header .fc-state-default {
	border-width: 1px 0;
	padding: 0 1px;
	}

.fc-header .fc-state-default,
.fc-header .fc-state-default a {
	border-style: solid;
	}

.fc-header .fc-state-default a {
	display: block;
	border-width: 0 1px;
	margin: 0 -1px;
	width: 100%;
	text-decoration: none;
	}

.fc-header .fc-state-default span {
	display: block;
	border-style: solid;
	border-width: 1px 0 1px 1px;
	padding: 3px 5px;
	}

.fc-header .ui-state-default {
	padding: 4px 6px;
	}

.fc-header .fc-state-default span,
.fc-header .ui-state-default span {
	white-space: nowrap;
	}

/* for adjacent buttons */

.fc-header .fc-no-right {
	padding-right: 0;
	}

.fc-header .fc-no-right a {
	margin-right: 0;
	border-right: 0;
	}

.fc-header .ui-no-right {
	border-right: 0;
	}

/* for fake rounded corners */

.fc-header .fc-corner-left {
	margin-left: 1px;
	padding-left: 0;
	}

.fc-header .fc-corner-right {
	margin-right: 1px;
	padding-right: 0;
	}

/* DEFAULT button COLORS */

.fc-header .fc-state-default,
.fc-header .fc-state-default a {
	border-color: #777; /* outer border */
	color: #333;
	}

.fc-header .fc-state-default span {
	border-color: #fff #fff #d1d1d1; /* inner border */
	background: #e8e8e8;
	}

/* PRESSED button COLORS (down and active) */

.fc-header .fc-state-active a {
	color: #fff;
	}

.fc-header .fc-state-down span,
.fc-header .fc-state-active span {
	background: #888;
	border-color: #808080 #808080 #909090; /* inner border */
	}

/* DISABLED button COLORS */

.fc-header .fc-state-disabled a {
	color: #999;
	}

.fc-header .fc-state-disabled,
.fc-header .fc-state-disabled a {
	border-color: #ccc; /* outer border */
	}

.fc-header .fc-state-disabled span {
	border-color: #fff #fff #f0f0f0; /* inner border */
	background: #f0f0f0;
	}

/* Content Area & Global Cell Styles
------------------------------------------------------------------------*/

.fc-widget-content {
	border: 1px solid #ccc; /* outer border color */
	}

.fc-content {
	clear: both;
	}

.fc-content .fc-state-default {
	border-style: solid;
	border-color: #ccc; /* inner border color */
	}

.fc-content .fc-state-highlight { /* today */
	background: #ffc;
	}

.fc-content .fc-not-today { /* override jq-ui highlight (TODO: ui-widget-content) */
	background: none;
	}

.fc-cell-overlay { /* semi-transparent rectangle while dragging */
	background: #9cf;
	opacity: .2;
	filter: alpha(opacity=20); /* for IE */
	}

.fc-view { /* prevents dragging outside of widget */
	width: 100%;
	overflow: hidden;
	}

/* Global Event Styles
------------------------------------------------------------------------*/

.fc-event,
.fc-agenda .fc-event-time,
.fc-event a {
	border-style: solid;
	border-color: #36c;     /* default BORDER color (probably the same as background-color) */
	background-color: #36c; /* default BACKGROUND color */
	color: #fff;            /* default TEXT color */
	}

	/* Use the 'className' CalEvent property and the following
	 * example CSS to change event color on a per-event basis:
	 *
	 * .myclass,
	 * .fc-agenda .myclass .fc-event-time,
	 * .myclass a {
	 *     background-color: black;
	 *     border-color: black;
	 *     color: red;
	 *     }
	 */

.fc-event {
	text-align: left;
	}

.fc-event a {
	overflow: hidden;
	font-size: .85em;
	text-decoration: none;
	cursor: pointer;
	}

.fc-event-editable {
	cursor: pointer;
	}

.fc-event-time,
.fc-event-title {
	padding: 0 1px;
	}

/* for fake rounded corners */

.fc-event a {
	display: block;
	position: relative;
	width: 100%;
	height: 100%;
	}

/* right-to-left */

.fc-rtl .fc-event a {
	text-align: right;
	}

/* resizable */

.fc .ui-resizable-handle { /*** TODO: don't use ui-resizable anoymore, change class ***/
	display: block;
	position: absolute;
	z-index: 99999;
	border: 0 !important; /* important overrides pre jquery ui 1.7 styles */
	background: url(data:image/gif;base64,AAAA) !important; /* hover fix for IE */
	}

/* Horizontal Events
------------------------------------------------------------------------*/

.fc-event-hori {
	border-width: 1px 0;
	margin-bottom: 1px;
	}

.fc-event-hori a {
	border-width: 0;
	}

/* for fake rounded corners */

.fc-content .fc-corner-left {
	margin-left: 1px;
	}

.fc-content .fc-corner-left a {
	margin-left: -1px;
	border-left-width: 1px;
	}

.fc-content .fc-corner-right {
	margin-right: 1px;
	}

.fc-content .fc-corner-right a {
	margin-right: -1px;
	border-right-width: 1px;
	}

/* resizable */

.fc-event-hori .ui-resizable-e {
	top: 0           !important; /* importants override pre jquery ui 1.7 styles */
	right: -3px      !important;
	width: 7px       !important;
	height: 100%     !important;
	cursor: e-resize;
	}

.fc-event-hori .ui-resizable-w {
	top: 0           !important;
	left: -3px       !important;
	width: 7px       !important;
	height: 100%     !important;
	cursor: w-resize;
	}

.fc-event-hori .ui-resizable-handle {
	_padding-bottom: 14px; /* IE6 had 0 height */
	}

/* Month View, Basic Week View, Basic Day View
------------------------------------------------------------------------*/

.fc-grid table {
	width: 100%;
	}

.fc .fc-grid th {
	border-width: 0 0 0 1px;
	text-align: center;
	}

.fc .fc-grid td {
	border-width: 1px 0 0 1px;
	}

.fc-grid th.fc-leftmost,
.fc-grid td.fc-leftmost {
	border-left: 0;
	}

.fc-grid .fc-day-number {
	float: right;
	padding: 0 2px;
	}

.fc-grid .fc-other-month .fc-day-number {
	opacity: 0.3;
	filter: alpha(opacity=30); /* for IE */
	/* opacity with small font can sometimes look too faded
	   might want to set the 'color' property instead
	   making day-numbers bold also fixes the problem */
	}

.fc-grid .fc-day-content {
	clear: both;
	padding: 2px 2px 0; /* distance between events and day edges */
	}

/* event styles */

.fc-grid .fc-event-time {
	font-weight: bold;
	}

/* right-to-left */

.fc-rtl .fc-grid {
	direction: rtl;
	}

.fc-rtl .fc-grid .fc-day-number {
	float: left;
	}

.fc-rtl .fc-grid .fc-event-time {
	float: right;
	}

/* Agenda Week View, Agenda Day View
------------------------------------------------------------------------*/

.fc .fc-agenda th,
.fc .fc-agenda td {
	border-width: 1px 0 0 1px;
	}

.fc .fc-agenda .fc-leftmost {
	border-left: 0;
	}

.fc-agenda tr.fc-first th,
.fc-agenda tr.fc-first td {
	border-top: 0;
	}

.fc-agenda-head tr.fc-last th {
	border-bottom-width: 1px;
	}

.fc .fc-agenda-head td,
.fc .fc-agenda-body td {
	background: none;
	}

.fc-agenda-head th {
	text-align: center;
	}

/* the time axis running down the left side */

.fc-agenda .fc-axis {
	width: 50px;
	padding: 0 4px;
	vertical-align: middle;
	white-space: nowrap;
	text-align: right;
	font-weight: normal;
	}

/* all-day event cells at top */

.fc-agenda-head tr.fc-all-day th {
	height: 35px;
	}

.fc-agenda-head td {
	padding-bottom: 10px;
	}

.fc .fc-divider div {
	font-size: 1px; /* for IE6/7 */
	height: 2px;
	}

.fc .fc-divider .fc-state-default {
	background: #eee; /* color for divider between all-day and time-slot events */
	}

/* body styles */

.fc .fc-agenda-body td div {
	height: 20px; /* slot height */
	}

.fc .fc-agenda-body tr.fc-minor th,
.fc .fc-agenda-body tr.fc-minor td {
	border-top-style: dotted;
	}

.fc-agenda .fc-day-content {
	padding: 2px 2px 0; /* distance between events and day edges */
	}

/* vertical background columns */

.fc .fc-agenda-bg .ui-state-highlight {
	background-image: none; /* tall column, don't want repeating background image */
	}

/* Vertical Events
------------------------------------------------------------------------*/

.fc-event-vert {
	border-width: 0 1px;
	}

.fc-event-vert a {
	border-width: 0;
	}

/* for fake rounded corners */

.fc-content .fc-corner-top {
	margin-top: 1px;
	}

.fc-content .fc-corner-top a {
	margin-top: -1px;
	border-top-width: 1px;
	}

.fc-content .fc-corner-bottom {
	margin-bottom: 1px;
	}

.fc-content .fc-corner-bottom a {
	margin-bottom: -1px;
	border-bottom-width: 1px;
	}

/* event content */

.fc-event-vert span {
	display: block;
	position: relative;
	z-index: 2;
	}

.fc-event-vert span.fc-event-time {
	white-space: nowrap;
	_white-space: normal;
	overflow: hidden;
	border: 0;
	font-size: 10px;
	}

.fc-event-vert span.fc-event-title {
	line-height: 13px;
	}

.fc-event-vert span.fc-event-bg { /* makes the event lighter w/ a semi-transparent overlay  */
	position: absolute;
	z-index: 1;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: #fff;
	opacity: .3;
	filter: alpha(opacity=30); /* for IE */
	}

/* resizable */

.fc-event-vert .ui-resizable-s {
	bottom: 0        !important; /* importants override pre jquery ui 1.7 styles */
	width: 100%      !important;
	height: 8px      !important;
	line-height: 8px !important;
	font-size: 11px  !important;
	font-family: monospace;
	text-align: center;
	cursor: s-resize;
	}


text:
package abdi.formulario.rs;

/**
 *
 * @author Rogerio.Rodrigues
 */
public class Mensagem {

    private String descricao;

    public Mensagem(String descricao) {
        this.descricao = descricao;
    }

    /**
     * @return the descricao
     */
    public String getDescricao() {
        return descricao;
    }

    /**
     * @param descricao the descricao to set
     */
    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

}


text:
<title>OGRE: Ogre::VertexDeclaration Class Reference - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link type="text/css" rel="stylesheet" href="doxygen.css">
<link type="text/css" rel="stylesheet" href="tabs.css">

Main Page

Related Pages

Modules

Namespaces

Classes

Files

Directories

Class List

Class Index

Class Hierarchy

Class Members

Ogre

VertexDeclaration

Public Types |
Public Member Functions |
Static Public Member Functions |
Protected Attributes

Ogre::VertexDeclaration Class Reference
RenderSystem

This class declares the format of a set of vertex inputs, which can be issued to the rendering API through a RenderOperation.
 More...

#include <OgreHardwareVertexBuffer.h>

Inheritance diagram for Ogre::VertexDeclaration:

<map name="Ogre_1_1VertexDeclaration_inherit__map" id="Ogre_1_1VertexDeclaration_inherit__map">
<area shape="rect" id="node2" href="classOgre_1_1AllocatedObject.html" title="Superclass for all objects that wish to use custom memory allocators when their new / delete operator..." alt="" coords="28,5,145,35"/></map>
[legend]

List of all members.

Public Types

typedef list< VertexElement >::type 	VertexElementList

 	Defines the list of vertex elements that makes up this declaration.

Public Member Functions

 	VertexDeclaration ()

 	Standard constructor, not you should use HardwareBufferManager::createVertexDeclaration.

virtual 	~VertexDeclaration ()

size_t 	getElementCount (void)

 	Get the number of elements in the declaration.

const VertexElementList & 	getElements (void) const

 	Gets read-only access to the list of vertex elements.

const VertexElement * 	getElement (unsigned short index)

 	Get a single element.

void 	sort (void)

 	Sorts the elements in this list to be compatible with the maximum number of rendering APIs / graphics cards.

void 	closeGapsInSource (void)

 	Remove any gaps in the source buffer list used by this declaration.

VertexDeclaration * 	getAutoOrganisedDeclaration (bool skeletalAnimation, bool vertexAnimation)

 	Generates a new VertexDeclaration for optimal usage based on the current vertex declaration, which can be used with VertexData::reorganiseBuffers later if you wish, or simply used as a template.

unsigned short 	getMaxSource (void) const

 	Gets the index of the highest source value referenced by this declaration.

virtual const VertexElement & 	addElement (unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0)

 	Adds a new VertexElement to this declaration.

virtual const VertexElement & 	insertElement (unsigned short atPosition, unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0)

 	Inserts a new VertexElement at a given position in this declaration.

virtual void 	removeElement (unsigned short elem_index)

 	Remove the element at the given index from this declaration.

virtual void 	removeElement (VertexElementSemantic semantic, unsigned short index=0)

 	Remove the element with the given semantic and usage index.

virtual void 	removeAllElements (void)

 	Remove all elements.

virtual void 	modifyElement (unsigned short elem_index, unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0)

 	Modify an element in-place, params as addElement.

virtual const VertexElement * 	findElementBySemantic (VertexElementSemantic sem, unsigned short index=0)

 	Finds a VertexElement with the given semantic, and index if there is more than one element with the same semantic.

virtual VertexElementList 	findElementsBySource (unsigned short source)

 	Based on the current elements, gets the size of the vertex for a given buffer source.

virtual size_t 	getVertexSize (unsigned short source)

 	Gets the vertex size defined by this declaration for a given source.

virtual VertexDeclaration * 	clone (HardwareBufferManagerBase *mgr=0)

 	Clones this declaration.

bool 	operator== (const VertexDeclaration &rhs) const

bool 	operator!= (const VertexDeclaration &rhs) const

void * 	operator new (size_t sz, const char *file, int line, const char *func)

 	operator new, with debug line info

void * 	operator new (size_t sz)

void * 	operator new (size_t sz, void *ptr)

 	placement operator new

void * 	operator new[] (size_t sz, const char *file, int line, const char *func)

 	array operator new, with debug line info

void * 	operator new[] (size_t sz)

void 	operator delete (void *ptr)

void 	operator delete (void *ptr, void *)

void 	operator delete (void *ptr, const char *, int, const char *)

void 	operator delete[] (void *ptr)

void 	operator delete[] (void *ptr, const char *, int, const char *)

Static Public Member Functions

static bool 	vertexElementLess (const VertexElement &e1, const VertexElement &e2)

 	Sort routine for vertex elements.

Protected Attributes

VertexElementList 	mElementList

Detailed Description

This class declares the format of a set of vertex inputs, which can be issued to the rendering API through a RenderOperation.

Remarks:

You should be aware that the ordering and structure of the VertexDeclaration can be very important on DirectX with older cards,so if you want to maintain maximum compatibility with all render systems and all cards you should be careful to follow these rules:

VertexElements should be added in the following order, and the order of the elements within a shared buffer should be as follows: position, blending weights, normals, diffuse colours, specular colours, texture coordinates (in order, with no gaps)

You must not have unused gaps in your buffers which are not referenced by any VertexElement

You must not cause the buffer & offset settings of 2 VertexElements to overlap

Whilst GL and more modern graphics cards in D3D will allow you to defy these rules, sticking to them will ensure that your buffers have the maximum compatibility.

Like the other classes in this functional area, these declarations should be created and destroyed using the HardwareBufferManager.

Definition at line 305 of file OgreHardwareVertexBuffer.h.

Member Typedef Documentation

          typedef list<VertexElement>::type Ogre::VertexDeclaration::VertexElementList

Defines the list of vertex elements that makes up this declaration.

Definition at line 309 of file OgreHardwareVertexBuffer.h.

Constructor & Destructor Documentation

          Ogre::VertexDeclaration::VertexDeclaration
          (
          	)

Standard constructor, not you should use HardwareBufferManager::createVertexDeclaration.

          virtual Ogre::VertexDeclaration::~VertexDeclaration
          (
          	)
           [virtual]

Member Function Documentation

          virtual const VertexElement& Ogre::VertexDeclaration::addElement
          (
          unsigned short
          source,

          size_t
          offset,

          VertexElementType
          theType,

          VertexElementSemantic
          semantic,

          unsigned short
          index = 0

          )
          	 [virtual]

Adds a new VertexElement to this declaration.

Remarks:

This method adds a single element (positions, normals etc) to the end of the vertex declaration. Please read the information in VertexDeclaration about the importance of ordering and structure for compatibility with older D3D drivers.

Parameters:

source	The binding index of HardwareVertexBuffer which will provide the source for this element. See VertexBufferBindingState for full information.

offset	The offset in bytes where this element is located in the buffer

theType	The data format of the element (3 floats, a colour etc)

semantic	The meaning of the data (position, normal, diffuse colour etc)

index	Optional index for multi-input elements like texture coordinates

Returns:

A reference to the VertexElement added.

          virtual VertexDeclaration* Ogre::VertexDeclaration::clone
          (
          HardwareBufferManagerBase *
          mgr = 0	)
           [virtual]

Clones this declaration.

Parameters:

mgr	Optional HardwareBufferManager to use for creating the clone (if null, use the current default).

          void Ogre::VertexDeclaration::closeGapsInSource
          (
          void
          	)

Remove any gaps in the source buffer list used by this declaration.

Remarks:

This is useful if you've modified a declaration and want to remove any gaps in the list of buffers being used. Note, however, that if this declaration is already being used with a VertexBufferBinding, you will need to alter that too. This method is mainly useful when reorganising buffers based on an altered declaration.

Note:

This will cause the vertex declaration to be re-sorted.

          virtual const VertexElement* Ogre::VertexDeclaration::findElementBySemantic
          (
          VertexElementSemantic
          sem,

          unsigned short
          index = 0

          )
          	 [virtual]

Finds a VertexElement with the given semantic, and index if there is more than one element with the same semantic.

Remarks:

If the element is not found, this method returns null.

          virtual VertexElementList Ogre::VertexDeclaration::findElementsBySource
          (
          unsigned short
          source	)
           [virtual]

Based on the current elements, gets the size of the vertex for a given buffer source.

Parameters:

source	The buffer binding index for which to get the vertex size. Gets a list of elements which use a given source.

Remarks:

Note that the list of elements is returned by value therefore is separate from the declaration as soon as this method returns.

          VertexDeclaration* Ogre::VertexDeclaration::getAutoOrganisedDeclaration
          (
          bool
          skeletalAnimation,

          bool
          vertexAnimation

          )

Generates a new VertexDeclaration for optimal usage based on the current vertex declaration, which can be used with VertexData::reorganiseBuffers later if you wish, or simply used as a template.

Remarks:

Different buffer organisations and buffer usages will be returned depending on the parameters passed to this method.

Parameters:

skeletalAnimation	Whether this vertex data is going to be skeletally animated

vertexAnimation	Whether this vertex data is going to be vertex animated

          const VertexElement* Ogre::VertexDeclaration::getElement
          (
          unsigned short
          index	)

Get a single element.

          size_t Ogre::VertexDeclaration::getElementCount
          (
          void
          	)

Get the number of elements in the declaration.

Definition at line 320 of file OgreHardwareVertexBuffer.h.

          const VertexElementList& Ogre::VertexDeclaration::getElements
          (
          void
          	)
           const

Gets read-only access to the list of vertex elements.

          unsigned short Ogre::VertexDeclaration::getMaxSource
          (
          void
          	)
           const

Gets the index of the highest source value referenced by this declaration.

          virtual size_t Ogre::VertexDeclaration::getVertexSize
          (
          unsigned short
          source	)
           [virtual]

Gets the vertex size defined by this declaration for a given source.

          virtual const VertexElement& Ogre::VertexDeclaration::insertElement
          (
          unsigned short
          atPosition,

          unsigned short
          source,

          size_t
          offset,

          VertexElementType
          theType,

          VertexElementSemantic
          semantic,

          unsigned short
          index = 0

          )
          	 [virtual]

Inserts a new VertexElement at a given position in this declaration.

Remarks:

This method adds a single element (positions, normals etc) at a given position in this vertex declaration. Please read the information in VertexDeclaration about the importance of ordering and structure for compatibility with older D3D drivers.

Parameters:

source	The binding index of HardwareVertexBuffer which will provide the source for this element. See VertexBufferBindingState for full information.

offset	The offset in bytes where this element is located in the buffer

theType	The data format of the element (3 floats, a colour etc)

semantic	The meaning of the data (position, normal, diffuse colour etc)

index	Optional index for multi-input elements like texture coordinates

Returns:

A reference to the VertexElement added.

          virtual void Ogre::VertexDeclaration::modifyElement
          (
          unsigned short
          elem_index,

          unsigned short
          source,

          size_t
          offset,

          VertexElementType
          theType,

          VertexElementSemantic
          semantic,

          unsigned short
          index = 0

          )
          	 [virtual]

Modify an element in-place, params as addElement.

Remarks:

Please read the information in VertexDeclaration about the importance of ordering and structure for compatibility with older D3D drivers.

template<class Alloc >

          void Ogre::AllocatedObject< Alloc >::operator delete
          (
          void *
          ptr,

          void *

          )
          	 [inherited]

Definition at line 101 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

          void Ogre::AllocatedObject< Alloc >::operator delete
          (
          void *
          ptr	)
           [inherited]

Definition at line 95 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

          void Ogre::AllocatedObject< Alloc >::operator delete
          (
          void *
          ptr,

          const char *
          ,

          int
          ,

          const char *

          )
          	 [inherited]

Definition at line 107 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

          void Ogre::AllocatedObject< Alloc >::operator delete[]
          (
          void *
          ptr	)
           [inherited]

Definition at line 112 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

          void Ogre::AllocatedObject< Alloc >::operator delete[]
          (
          void *
          ptr,

          const char *
          ,

          int
          ,

          const char *

          )
          	 [inherited]

Definition at line 118 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

          void* Ogre::AllocatedObject< Alloc >::operator new
          (
          size_t
          sz,

          const char *
          file,

          int
          line,

          const char *
          func

          )
          	 [inherited]

operator new, with debug line info

Definition at line 67 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

          void* Ogre::AllocatedObject< Alloc >::operator new
          (
          size_t
          sz	)
           [inherited]

Definition at line 72 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

          void* Ogre::AllocatedObject< Alloc >::operator new
          (
          size_t
          sz,

          void *
          ptr

          )
          	 [inherited]

placement operator new

Definition at line 78 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

          void* Ogre::AllocatedObject< Alloc >::operator new[]
          (
          size_t
          sz	)
           [inherited]

Definition at line 90 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

          void* Ogre::AllocatedObject< Alloc >::operator new[]
          (
          size_t
          sz,

          const char *
          file,

          int
          line,

          const char *
          func

          )
          	 [inherited]

array operator new, with debug line info

Definition at line 85 of file OgreMemoryAllocatedObject.h.

          bool Ogre::VertexDeclaration::operator!=
          (
          const VertexDeclaration &
          rhs	)
           const

Definition at line 463 of file OgreHardwareVertexBuffer.h.

          bool Ogre::VertexDeclaration::operator==
          (
          const VertexDeclaration &
          rhs	)
           const

Definition at line 446 of file OgreHardwareVertexBuffer.h.

References mElementList.

          virtual void Ogre::VertexDeclaration::removeAllElements
          (
          void
          	)
           [virtual]

Remove all elements.

          virtual void Ogre::VertexDeclaration::removeElement
          (
          unsigned short
          elem_index	)
           [virtual]

Remove the element at the given index from this declaration.

          virtual void Ogre::VertexDeclaration::removeElement
          (
          VertexElementSemantic
          semantic,

          unsigned short
          index = 0

          )
          	 [virtual]

Remove the element with the given semantic and usage index.

Remarks:

In this case 'index' means the usage index for repeating elements such as texture coordinates. For other elements this will always be 0 and does not refer to the index in the vector.

          void Ogre::VertexDeclaration::sort
          (
          void
          	)

Sorts the elements in this list to be compatible with the maximum number of rendering APIs / graphics cards.

Remarks:

Older graphics cards require vertex data to be presented in a more rigid way, as defined in the main documentation for this class. As well as the ordering being important, where shared source buffers are used, the declaration must list all the elements for each source in turn.

          static bool Ogre::VertexDeclaration::vertexElementLess
          (
          const VertexElement &
          e1,

          const VertexElement &
          e2

          )
          	 [static]

Sort routine for vertex elements.

Member Data Documentation

          VertexElementList Ogre::VertexDeclaration::mElementList [protected]

Definition at line 313 of file OgreHardwareVertexBuffer.h.

Referenced by operator==().

The documentation for this class was generated from the following file:

OgreHardwareVertexBuffer.h

Copyright © 2008 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Last modified Sat Jan 14 2012 18:40:47


text:
<?php
/**
 * playlistScanItunes
 *
 * Itunes playlist ingest process
 *
 * @package    streeme
 * @author     Richard Hoar
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
$itunes_music_library   = sfConfig::get( 'app_itunes_xml_location' );
$mapped_drive_locations = sfConfig::get( 'app_mdl_mapped_drive_locations' );
$allowed_filetypes      = array_map( 'strtolower', sfConfig::get( 'app_aft_allowed_file_types' ) );
$itunes_parser          = new StreemeItunesPlaylistParser( $itunes_music_library );
$playlist_scan          = new PlaylistScan('itunes');
$playlist_name = $itunes_playlist_id = null;
$playlist_songs = array();
function mapItunes($collection)
{
  return array('filename'=> iconv( sfConfig::get( app_filesystem_encoding, 'ISO-8859-1' ), 'UTF-8//TRANSLIT', StreemeUtil::itunes_format_decode($collection['filename'], StreemeUtil::is_windows(), sfConfig::get( 'app_mdl_mapped_drive_locations'))));
}
while( $itunes_parser->getPlaylist( $playlist_name, $itunes_playlist_id, $playlist_songs ) )
{
  //There's no point scanning the entire library again, so we'll exclude the first record in iTunes
  if(!isset($first_skipped))
  {
    $first_skipped = true;
    continue;
  }

  //convert itunes filenames to system specific paths
  $playlist_songs = array_map(mapItunes, $playlist_songs);

  //update playlists
  if(count($playlist_songs) > 0)
  {
    $playlist_id = $playlist_scan->is_scanned(
                                             $playlist_scan->get_service_name(),
                                             $playlist_name,
                                             $itunes_playlist_id
                                           );

    $playlist_id = $playlist_scan->add_playlist(
                                             $playlist_name,
                                             $playlist_songs,
                                             $playlist_id,
                                             $playlist_scan->get_last_scan_id(),
                                             $playlist_scan->get_service_name(),
                                             $itunes_playlist_id
                                           );
  }
}
$playlist_scan->finalize_scan(PlaylistFilesTable::getInstance());
echo $playlist_scan->get_summary();


text:
/*==========================================
=            Controller: Header            =
==========================================*/
// Template:  /client/includes/_header.html

Template.Header.events({
  'click .logout': function(evt, template) {
    return Meteor.logout(function(error) {
      if (error) console.log("Error:" + error);
      Session.clearPersistent();
      // clear these sessions out when use logs out
      Session.clear('sTeamId');
      Session.clear('sGameId');
      Session.clear('sSeasonId');
      Session.clear('sLeagueId');
      Session.clear('sFormationChosen');
      Session.clear('sPositionsNamed');
      Session.clear('sRosterComplete');
      Session.clear('sRosterCreated');
      Session.clear('sTeamNew');
      Session.clear('sGameNew');
      Session.clear('sLeagueNew');
      Session.clear('sSeasonNew');
      Session.clear('sAddTeam');
      Session.clear('sAddGame');
      Session.clear('sAddLeague');
      Session.clear('sAddSeason');
      Router.go('Index');
    });
  }
});


text:
import { action } from 'mobx'
import state from './state'
import api from 'backendAPI'
import getBackoff from 'utils/getBackoff'

export function fetchRefs () {
  return api.gitRefs().then(action(refs =>
    refs.forEach(ref => state.refs.set(ref.name, ref.id))
  ))
}

export function fetchCommits (params) {
  return api.gitLogs(params).then(action(allCommits => {
    allCommits.forEach(commit =>
      state.rawCommits.set(commit.id, commit)
    )
    return allCommits
  }))
}

export class CommitsCrawler {
  constructor (opt) {
    this.commits = opt.commits
    this.size = opt.size

    this.eldestCommitId = 'pristine'
    this.isFetching = false
    this.backoff = getBackoff({
      delayMin: 1500,
      delayMax: 10000,
    })
  }

  reachTheEndCallback () {
    const retryDelay = this.backoff.duration()
    this.isFetching = true
    setTimeout(() => this.isFetching = false, retryDelay)
  }

  fetch () {
    if (this.isFetching) return
    const page = Math.floor((this.commits.size || this.commits.length) / this.size)
    this.isFetching = fetchCommits({ page, size: this.size })
      .catch(() => false)
      .then(allCommits => {
        if (!allCommits) return this.isFetching = false
        if (!allCommits.length) { return this.reachTheEndCallback() }

        const eldestCommit = allCommits.pop()
        if (this.eldestCommitId === eldestCommit.id) {
          this.reachTheEndCallback()
        } else {
          setTimeout(() => this.isFetching = false, 100)
          this.eldestCommitId = eldestCommit.id
        }
      })
  }
}


text: A set of file reader/writer middlewares


text:
class IndexController < ApplicationController
  def index
    page   = params[:page] || 1
    @title = "Реакции в GIF-картинках, страница #{page}"

    @reactions = Reaction.where(approved: true).order('id desc').page(page).per(5)
  end
end


text:
using namespace eddic;

bool mtac::optimize_branches::operator()(mtac::Function& function){
    bool optimized = false;

    for(auto& block : function){
        for(auto& quadruple : block->statements){
            if(quadruple.op == mtac::Operator::IF_FALSE_UNARY && boost::get<int>(&*quadruple.arg1)){
                int value = boost::get<int>(*quadruple.arg1);

                if(value == 0){
                    mtac::Quadruple goto_(quadruple.label(), mtac::Operator::GOTO);
                    goto_.block = quadruple.block;

                    quadruple = std::move(goto_);
                    optimized = true;

                    mtac::remove_edge(block, block->next);
                } else if(value == 1){
                    mtac::remove_edge(block, quadruple.block);

                    mtac::transform_to_nop(quadruple);
                    optimized = true;
                }
            } else if(quadruple.op == mtac::Operator::IF_UNARY && boost::get<int>(&*quadruple.arg1)){
                int value = boost::get<int>(*quadruple.arg1);

                if(value == 0){
                    mtac::remove_edge(block, quadruple.block);

                    mtac::transform_to_nop(quadruple);
                    optimized = true;
                } else if(value == 1){
                    auto goto_ = mtac::Quadruple(quadruple.label(), mtac::Operator::GOTO);
                    goto_.block = quadruple.block;

                    quadruple = std::move(goto_);
                    optimized = true;

                    mtac::remove_edge(block, block->next);
                }
            }
        }
    }

    return optimized;
}


text:
package me.clementsauvage;

import static org.junit.Assert.*;

/**
 * Created by csauvage on 10/03/2017.
 */
public class CalculousTest {
    @org.junit.Test
    public void sum() throws Exception {
        assertEquals(2, Calculous.sum(1,1));
        assertEquals(6, Calculous.sum(0,3));
    }

}


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package nl.nelen_schuurmans.aquo;

import java.util.Collection;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.TypedQuery;
import org.apache.log4j.Logger;

/**
 *
 * @author carsten.byrman@nelen-schuurmans.nl
 */
public class CompartmentDAO implements GenericDAO<Compartment> {

    private static final Logger logger = Logger.getLogger(CompartmentDAO.class);

    @Override
    public void createOrUpdate(Collection<Compartment> compartments) {
        for (Compartment compartment : compartments) {
            createOrUpdate(compartment);
        }
    }

    @Override
    public void createOrUpdate(Compartment compartment) {
        EntityManager em = JpaUtil.getCurrentEntityManager();
        Compartment compartment2 = findByCode(compartment.getCode());
        if (compartment2 == null) {
            logger.debug("Creating " + compartment);
            em.persist(compartment);
        } else {
            logger.debug("Updating " + compartment);
            compartment2.update(compartment);
        }
    }

    @Override
    public Compartment findByCode(String code) {
        EntityManager em = JpaUtil.getCurrentEntityManager();
        TypedQuery<Compartment> query =
                em.createNamedQuery("Compartment.findByCode", Compartment.class);
        try {
            return query.setParameter("code", code).getSingleResult();
        } catch (NoResultException ex) {
            return null;
        }
    }

    @Override
    public Compartment mostRecent() {
        EntityManager em = JpaUtil.getCurrentEntityManager();
        TypedQuery<Compartment> query =
                em.createNamedQuery("Compartment.mostRecent", Compartment.class);
        try {
            return query.setMaxResults(1).getSingleResult();
        } catch (NoResultException ex) {
            return null;
        }
    }
}