text:
/**
 * Created by paul on 5/12/15.
 */

'use strict';

describe('refreshProjects', function () {
	var tcProjects,
			tcCheckinTriggeredBuilds,
			tcDeploymentBuilds,
			tcUpdateSite,
			tcUpdateSite_AmazonWebServices,
			tcUpdateSite_AmazonWebServices_UpdatePwsEmailGateway,
			server;

	beforeAll(function () {
		tcProjects = JSON.parse(Assets.getText('testData/tcProjects.json'));
		tcCheckinTriggeredBuilds = JSON.parse(Assets.getText('testData/projects/tcCheckinTriggered.json'));
		tcDeploymentBuilds = JSON.parse(Assets.getText('testData/projects/tcDeploymentBuilds.json'));
		tcUpdateSite = JSON.parse(Assets.getText('testData/projects/tcUpdateSite.json'));
		tcUpdateSite_AmazonWebServices = JSON.parse(Assets.getText('testData/projects/tcUpdateSite_AmazonWebServices.json'));
		tcUpdateSite_AmazonWebServices_UpdatePwsEmailGateway = JSON.parse(Assets.getText('testData/projects/tcUpdateSite_AmazonWebServices_UpdatePwsEmailGateway.json'));
	});

	beforeEach(function () {
		spyOn(HTTP, 'get').and.callFake(function (url, opt, cb) {
			if (s(url).endsWith('/app/rest/projects')) {
				cb(null, tcProjects);
			} else  if(s(url).endsWith('/id:CheckInTriggeredBuilds')) {
				cb(null, tcCheckinTriggeredBuilds);
			} else if (s(url).endsWith('/id:DeploymentBuilds')) {
				cb(null, tcDeploymentBuilds);
			} else if (s(url).endsWith('/id:UpdateSite')) {
				cb(null, tcUpdateSite);
			} else if (s(url).endsWith('/id:UpdateSite_AmazonWebServices')) {
				cb(null, tcUpdateSite_AmazonWebServices);
			} else if (s(url).endsWith('/id:UpdateSite_AmazonWebServices_UpdatePwsEmailGateway')) {
				cb(null, tcUpdateSite_AmazonWebServices_UpdatePwsEmailGateway);
			}
		});

		server = Controllers.Servers.getServerByName('teamcity.test.server');
	});

	function runTests() {
		var projects = Controllers.Projects.getAllByServerId(server._id);
		expect(projects.count()).toBe(5);

		var DeploymentBuilds = Controllers.Projects.getByServiceProjectId(server._id, 'DeploymentBuilds'),
				UpdateSite  = Controllers.Projects.getByServiceProjectId(server._id, 'UpdateSite'),
				UpdateSite_AmazonWebServices  = Controllers.Projects.getByServiceProjectId(server._id, 'UpdateSite_AmazonWebServices'),
				UpdateSite_AmazonWebServices_UpdatePwsEmailGateway  = Controllers.Projects.getByServiceProjectId(server._id, 'UpdateSite_AmazonWebServices_UpdatePwsEmailGateway');

		expect(UpdateSite.parentId).toBe(null);
		expect(UpdateSite_AmazonWebServices.parentId).toBe(UpdateSite._id);
		expect(UpdateSite_AmazonWebServices_UpdatePwsEmailGateway.parentId).toBe(UpdateSite_AmazonWebServices._id);

		expect(DeploymentBuilds.serverId).toBe(server._id);
		expect(DeploymentBuilds.serviceProjectId).toBe('DeploymentBuilds');
		expect(DeploymentBuilds.serviceParentProjectId).toBe(null);
		expect(DeploymentBuilds.name).toBe('Deployment Builds');
		expect(DeploymentBuilds.href).toContain('/app/rest/projects/id:DeploymentBuilds');

		expect(UpdateSite.serverId).toBe(server._id);
		expect(UpdateSite.serviceParentProjectId).toBe(null);
		expect(UpdateSite.href).toContain('/app/rest/projects/id:UpdateSite');

		expect(UpdateSite_AmazonWebServices.serviceParentProjectId).toBe('UpdateSite');
		expect(UpdateSite_AmazonWebServices.href).toContain('/app/rest/projects/id:UpdateSite_AmazonWebServices');

		expect(UpdateSite_AmazonWebServices_UpdatePwsEmailGateway.serviceParentProjectId).toBe('UpdateSite_AmazonWebServices');

		var usPwsBuilds = Controllers.Builds.getAllByProjectId(UpdateSite_AmazonWebServices_UpdatePwsEmailGateway._id);
		expect(usPwsBuilds.count()).toBe(0);

		var usBuilds = Controllers.Builds.getAllByProjectId(UpdateSite._id);
		expect(usBuilds.count()).toBe(0);

		var usAwsBuilds = Controllers.Builds.getAllByProjectId(UpdateSite_AmazonWebServices._id);
		expect(usAwsBuilds.count()).toBe(16);

		var arrUsAwsBuilds = usAwsBuilds.fetch();
		arrUsAwsBuilds.forEach(function (build) {
			expect(build.serverId).toBe(server._id);
			expect(build.watchers.length).toBe(0);
			expect(build.isDisplayed).toBe(false);
			expect(build.isLastBuildSuccess).toBe(true);
			expect(build.isBuilding).toBeFalsy();

			if (build.serviceBuildId === 'UpdateSite_AmazonWebServices_UpdateAwsMissouri') {
				expect(build.name).toBe('Update AWS Missouri - EM API');
				expect(build.href).toContain('/app/rest/buildTypes/id:UpdateSite_AmazonWebServices_UpdateAwsMissouri');
			} else if (build.serviceBuildId === 'UpdateSite_AmazonWebServices_UpdateAwsCurrentWork') {
				expect(build.name).toBe('Update AWS Current Work - 53.9');
				expect(build.href).toContain('/app/rest/buildTypes/id:UpdateSite_AmazonWebServices_UpdateAwsCurrentWork');
			}
		});
	}

	it('should call and get the projects from Teamcity and add them to the database with their builds', function () {
		Controllers.Servers.onRefreshProjects(server._id);

		runTests();
	});

	it('should not change the values of the projects or builds when called a second time', function () {
		Controllers.Servers.onRefreshProjects(server._id);

		runTests();
	});
});


text: wget localhost

redpajama_set_name: RedPajamaGithub


text:
CC=g++
EXE=judge
SOURCES=$(wildcard *.cpp ../public/readConfig.cpp ../public/functions.cpp)
HEADERS=../public/readConfig.h ../public/functions.h ../public/config.h

executor:$(SOURCES) $(HEADERS)
	$(CC) -std=c++11 `pkg-config glib-2.0 --cflags --libs` $(SOURCES) -o $(EXE)


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Mail;
using Nop.Core.Domain.Messages;
using Nop.Services.Media;

namespace Nop.Services.Messages
{
    /// <summary>
    /// Email sender
    /// </summary>
    public partial class EmailSender : IEmailSender
    {
        private readonly IDownloadService _downloadService;

        public EmailSender(IDownloadService downloadService)
        {
            this._downloadService = downloadService;
        }

        /// <summary>
        /// Sends an email
        /// </summary>
        /// <param name="emailAccount">Email account to use</param>
        /// <param name="subject">Subject</param>
        /// <param name="body">Body</param>
        /// <param name="fromAddress">From address</param>
        /// <param name="fromName">From display name</param>
        /// <param name="toAddress">To address</param>
        /// <param name="toName">To display name</param>
        /// <param name="replyTo">ReplyTo address</param>
        /// <param name="replyToName">ReplyTo display name</param>
        /// <param name="bcc">BCC addresses list</param>
        /// <param name="cc">CC addresses list</param>
        /// <param name="attachmentFilePath">Attachment file path</param>
        /// <param name="attachmentFileName">Attachment file name. If specified, then this file name will be sent to a recipient. Otherwise, "AttachmentFilePath" name will be used.</param>
        /// <param name="attachedDownloadId">Attachment download ID (another attachedment)</param>
        public virtual void SendEmail(EmailAccount emailAccount, string subject, string body,
            string fromAddress, string fromName, string toAddress, string toName,
             string replyTo = null, string replyToName = null,
            IEnumerable<string> bcc = null, IEnumerable<string> cc = null,
            string attachmentFilePath = null, string attachmentFileName = null,
            int attachedDownloadId = 0)
        {
            var message = new MailMessage();
            //from, to, reply to
            message.From = new MailAddress(fromAddress, fromName);
            message.To.Add(new MailAddress(toAddress, toName));
            if (!String.IsNullOrEmpty(replyTo))
            {
                message.ReplyToList.Add(new MailAddress(replyTo, replyToName));
            }

            //BCC
            if (bcc != null)
            {
                foreach (var address in bcc.Where(bccValue => !String.IsNullOrWhiteSpace(bccValue)))
                {
                    message.Bcc.Add(address.Trim());
                }
            }

            //CC
            if (cc != null)
            {
                foreach (var address in cc.Where(ccValue => !String.IsNullOrWhiteSpace(ccValue)))
                {
                    message.CC.Add(address.Trim());
                }
            }

            //content
            message.Subject = subject;
            message.Body = body;
            message.IsBodyHtml = true;

            //create  the file attachment for this e-mail message
            if (!String.IsNullOrEmpty(attachmentFilePath) &&
                File.Exists(attachmentFilePath))
            {
                var attachment = new Attachment(attachmentFilePath);
                attachment.ContentDisposition.CreationDate = File.GetCreationTime(attachmentFilePath);
                attachment.ContentDisposition.ModificationDate = File.GetLastWriteTime(attachmentFilePath);
                attachment.ContentDisposition.ReadDate = File.GetLastAccessTime(attachmentFilePath);
                if (!String.IsNullOrEmpty(attachmentFileName))
                {
                    attachment.Name = attachmentFileName;
                }
                message.Attachments.Add(attachment);
            }
            //another attachment?
            if (attachedDownloadId > 0)
            {
                var download = _downloadService.GetDownloadById(attachedDownloadId);
                if (download != null)
                {
                    //we do not support URLs as attachments
                    if (!download.UseDownloadUrl)
                    {
                        string fileName = !String.IsNullOrWhiteSpace(download.Filename) ? download.Filename : download.Id.ToString();
                        fileName += download.Extension;

                        var ms = new MemoryStream(download.DownloadBinary);
                        var attachment = new Attachment(ms, fileName);
                        //string contentType = !String.IsNullOrWhiteSpace(download.ContentType) ? download.ContentType : "application/octet-stream";
                        //var attachment = new Attachment(ms, fileName, contentType);
                        attachment.ContentDisposition.CreationDate = DateTime.UtcNow;
                        attachment.ContentDisposition.ModificationDate = DateTime.UtcNow;
                        attachment.ContentDisposition.ReadDate = DateTime.UtcNow;
                        message.Attachments.Add(attachment);
                    }
                }
            }

            //send email
            using (var smtpClient = new SmtpClient())
            {
                smtpClient.UseDefaultCredentials = emailAccount.UseDefaultCredentials;
                smtpClient.Host = emailAccount.Host;
                smtpClient.Port = emailAccount.Port;
                smtpClient.EnableSsl = emailAccount.EnableSsl;
                smtpClient.Credentials = emailAccount.UseDefaultCredentials ?
                    CredentialCache.DefaultNetworkCredentials :
                    new NetworkCredential(emailAccount.Username, emailAccount.Password);
                smtpClient.Send(message);
            }
        }

    }
}


text:
LA LISTE DES EVALUATIONS

                Numero
                Code
                Decription
                Actions

                {{$index + 1}}
                {{depart.code}}
                {{depart.description}}
                  Modifier |   Supprimer

    <form>
        <button class="btn btn-primary" ng-click="afficherFenetre(undefined)"> Ajouter Evaluation</button>
    </form>


text:
<?php

namespace Amenophis\WHMCS\Adapter;

/**
 * Usually thrown if a request fails.
 * @author Daniel Chalk <snathcfrigate@gmail.com>
 */
class Exception extends \Exception
{

}


text:
package com.github.nmorel.gwtjackson.jackson.advanced.jsontype;

import com.github.nmorel.gwtjackson.jackson.AbstractJacksonTest;
import com.github.nmorel.gwtjackson.shared.advanced.jsontype.PolymorphismIdClassAsPropertyTester;
import org.junit.Test;

/**
 * @author Nicolas Morel
 */
public class PolymorphismIdClassAsPropertyJacksonTest extends AbstractJacksonTest {

    @Test
    public void testSerialize() {
        PolymorphismIdClassAsPropertyTester.INSTANCE.testSerialize( createWriter( PolymorphismIdClassAsPropertyTester.Person[].class ) );
    }

    @Test
    public void testDeserialize() {
        PolymorphismIdClassAsPropertyTester.INSTANCE.testDeserialize( createReader( PolymorphismIdClassAsPropertyTester.Person[].class ) );
    }
}