text:
from datetime import timedelta

from django.utils import timezone
from cms.test_utils.testcases import CMSTestCase

from ..models import PressMention, PressRelease
from ..cms_plugins import RecentPressMentionsPlugin, RecentPressReleasesPlugin

class RecentPressMentionsPluginTest(CMSTestCase):

    def setUp(self):
        super().setUp()

        self.mention = PressMention.objects.create(
            publisher='The Two Times Two',
            publication_date=timezone.now(),
            url='http://2x2.news/a-foundation-has-open-knowledge',
            title='Our foundation knows open',
            slug='our-foundation-knows-open',
            author='Rite R. von Nuus',
            notes='We are famous!',
            published=True
        )

        self.unpublished_mention = PressMention.objects.create(
            publisher='Runway',
            publication_date=timezone.now() - timedelta(days=1),
            url='http://www.runwaylive.com/open-fashion',
            title='Open Fashion is the way to go!',
            slug='open-fashion-is-the-new-black',
            author='Andrea Sachs',
            notes='Woo, open fashion!',
            published=False
        )

    def test_mention_rendered(self):
        plug = RecentPressMentionsPlugin()
        mentions = plug.render({}, plug, 'foo')['recent_mentions']['objects']

        self.assertIn(self.mention, mentions)
        self.assertNotIn(self.unpublished_mention, mentions)

class RecentPressReleasesPluginTest(CMSTestCase):

    def setUp(self):
        super().setUp()

        now = timezone.now()

        one_month_ago = now - timedelta(days=31)
        self.one_month_old = PressRelease.objects.create(
            title='Data printer',
            slug='ground-breaking-invention',
            body='You can now turn data to real world objects',
            release_date=one_month_ago
        )

        one_day_ago = now - timedelta(days=1)
        self.one_day_old = PressRelease.objects.create(
            title='Open Knowledge solves world hunger!',
            slug='april-fools',
            body='By turning food to data Open Knowledge solves world hunger',
            release_date=one_day_ago
        )

        ten_minutes_from_now = now + timedelta(minutes=10)
        self.in_ten_minutes = PressRelease.objects.create(
            title='Did you believe us',
            slug='okf-fools-everyone',
            body='We are not smart enought to use the printer that way',
            release_date=ten_minutes_from_now
        )

    def test_old_releases_rendered(self):
        plug = RecentPressReleasesPlugin()
        releases = plug.render({}, plug, 'foo')['recent_releases']['objects']

        self.assertIn(self.one_month_old, releases)
        self.assertIn(self.one_day_old, releases)

    def test_future_releases_not_rendered(self):
        plug = RecentPressReleasesPlugin()
        releases = plug.render({}, plug, 'foo')['recent_releases']['objects']

        self.assertNotIn(self.in_ten_minutes, releases)

redpajama_set_name: RedPajamaGithub


text:
MCU          = atmega32u4
ARCH         = AVR8
BOARD        = USBKEY
F_CPU        = 16000000
F_USB        = $(F_CPU)
OPTIMIZATION = s
TARGET       = keyboard
SRC          = $(TARGET).c \
               $(shell find src -name '*.c') \
               $(LUFA_SRC_USB) \
               $(LUFA_SRC_USBCLASS)
LUFA_PATH    = ./LUFA
CC_FLAGS     = -DUSE_LUFA_CONFIG_HEADER \
							 -DDEBOUNCE_ENABLED \
							 -DHOST_WAKEUP_ENABLED \
							 -Iinclude
LD_FLAGS     =

DFU          = dfu-programmer $(MCU)

default: hex

left: CC_FLAGS += -DKEYBOARD_LEFT
left: hex

right: hex

all-left: left flash launch
all-right: right flash launch

flash:
	$(DFU) erase; $(DFU) flash $(TARGET).hex

bootloader:
	avrdude -p m32u4 -c usbasp -e -U flash:w:bootloader/BootloaderDFU.hex

launch:
	$(DFU) reset

.PHONY: bootloader

# Include LUFA build script makefiles
include $(LUFA_PATH)/Build/lufa_sources.mk
include $(LUFA_PATH)/Build/lufa_build.mk
include $(LUFA_PATH)/Build/lufa_cppcheck.mk
include $(LUFA_PATH)/Build/lufa_dfu.mk


text:
<?php

namespace document\Repositories;

use document\User;
use InfyOm\Generator\Common\BaseRepository;
use Helpers\Image;
use Hash;

class UserRepository extends BaseRepository
{
    /**
     * @var array
     */
    protected $fieldSearchable = [
        'name','email'
    ];

    /**
     * Configure the Model
     **/
    public function model()
    {
        return User::class;
    }

    /**
     * @param  array $input
     * @return mixed
     */
    public function register($input){

      $input['password'] = Hash::make($input['password']);
      $input['email'] = strtolower($input['email']);

      return $this->create($input);

    }

    /**
     * @param  array $input
     * @param  int $id
     * @return mixed
     */
    public function editRegister($input,$id){

        $user = $this->find($id);
        if(trim($input['password']) != ''){
          $input['password'] = Hash::make($input['password']);
        }

        $input['email'] = strtolower($input['email']);

        if (empty($user)) {
            return Response::json(ResponseUtil::makeError('User not found'), 404);
        }

        return $this->update($input, $id);

    }

    public function validateRepeatUser($user){

      $arr = $this->findWhere(['email'=>$user]);

      if( count($arr) > 0 ){
        return true;
      }else{
        return false;
      }

    }

}


text:
title: Updating Assemblies in a Project
page_title: Updating Assemblies in a Project
description: Learn how to use a specific version of the Telerik UI for WinForms suite in your project.
slug: winforms/installation-deployment-and-distribution/updating-assemblies-in-a-project
tags: update, assemblies, project
published: True
position: 4
---

# Updating Assemblies in a Project

The following topic will show you how to use a specific version of the Telerik UI for WinForms suite in your project. The same instructions should be followed when applying a [Latest Internal Build]({%slug winforms/installation-deployment-and-distribution/latest-internal-builds%}).

![updating-assemblies-in-a-project 001](images/updating-assemblies-in-a-project001.png)

When you [download a .zip containing all binaries]({%slug winforms/installation-deployment-and-distribution/download-product-files%}) for a specific version from your account, you need to replace the already existing assemblies in your project. Follow the steps:

1. Unzip the downloaded archive.
2. Select your project in Visual Studio >> Solution Explorer and expand the *References* section.

	![updating-assemblies-in-a-project 002](images/updating-assemblies-in-a-project002.png)

3. Select the already added Telerik assemblies and delete them:

	![updating-assemblies-in-a-project 003](images/updating-assemblies-in-a-project003.png)

4. Right-click over *References* and select *Add reference...*

	![updating-assemblies-in-a-project 004](images/updating-assemblies-in-a-project004.png)

5. Navigate to the unzipped folder and select the necessary references:

	![updating-assemblies-in-a-project 005](images/updating-assemblies-in-a-project005.png)

Now, you are ready to build and run your project with the downloaded version from your account.

# See Also

* [Download Product Files]({%slug winforms/installation-deployment-and-distribution/download-product-files%})
* [Latest Internal Builds]({%slug winforms/installation-deployment-and-distribution/latest-internal-builds%})
* [How to Upgrade a Telerik UI for WinForms Project]({%slug how-to-upgrade-a-project%})