text:
#ifndef __CONFIG_H
#define __CONFIG_H

/* ARM asynchronous clock */
#define CONFIG_SYS_AT91_SLOW_CLOCK	32768		/* slow clock xtal */
#define CONFIG_SYS_AT91_MAIN_CLOCK	18432000	/* 18.432 MHz crystal */
#define CONFIG_SYS_HZ			1000

#ifdef CONFIG_AT91SAM9G10
#define CONFIG_AT91SAM9G10EK		/* It's an Atmel AT91SAM9G10 EK*/
#else
#define CONFIG_AT91SAM9261EK		/* It's an Atmel AT91SAM9261 EK*/
#endif

#include <asm/hardware.h>

#define CONFIG_ARCH_CPU_INIT
#undef CONFIG_USE_IRQ			/* we don't need IRQ/FIQ stuff	*/

#define CONFIG_CMDLINE_TAG		/* enable passing of ATAGs */
#define CONFIG_SETUP_MEMORY_TAGS
#define CONFIG_INITRD_TAG

#define CONFIG_SKIP_LOWLEVEL_INIT

#define CONFIG_DISPLAY_CPUINFO

#define CONFIG_ATMEL_LEGACY
#define CONFIG_SYS_TEXT_BASE		0x21f00000

/*
 * Hardware drivers
 */

/* gpio */
#define CONFIG_AT91_GPIO
#define CONFIG_AT91_GPIO_PULLUP		1

/* serial console */
#define CONFIG_ATMEL_USART
#define CONFIG_USART_BASE		ATMEL_BASE_DBGU
#define CONFIG_USART_ID			ATMEL_ID_SYS
#define CONFIG_BAUDRATE			115200
#define CONFIG_SYS_BAUDRATE_TABLE	{115200, 57600, 38400, 19200, 9600}

/* LCD */
#define CONFIG_LCD
#define LCD_BPP				LCD_COLOR8
#define CONFIG_LCD_LOGO
#undef LCD_TEST_PATTERN
#define CONFIG_LCD_INFO
#define CONFIG_LCD_INFO_BELOW_LOGO
#define CONFIG_SYS_WHITE_ON_BLACK
#define CONFIG_ATMEL_LCD
#ifdef CONFIG_AT91SAM9261EK
#define CONFIG_ATMEL_LCD_BGR555
#endif

#define CONFIG_SYS_CONSOLE_IS_IN_ENV

/* LED */
#define CONFIG_AT91_LED
#define	CONFIG_RED_LED		AT91_PIN_PA23	/* this is the power led */
#define	CONFIG_GREEN_LED	AT91_PIN_PA13	/* this is the user1 led */
#define	CONFIG_YELLOW_LED	AT91_PIN_PA14	/* this is the user2 led */

#define CONFIG_BOOTDELAY	3

/*
 * BOOTP options
 */
#define CONFIG_BOOTP_BOOTFILESIZE
#define CONFIG_BOOTP_BOOTPATH
#define CONFIG_BOOTP_GATEWAY
#define CONFIG_BOOTP_HOSTNAME

/*
 * Command line configuration.
 */
#include <config_cmd_default.h>
#undef CONFIG_CMD_BDI
#undef CONFIG_CMD_FPGA
#undef CONFIG_CMD_IMI
#undef CONFIG_CMD_IMLS
#undef CONFIG_CMD_LOADS
#undef CONFIG_CMD_SOURCE

#define CONFIG_CMD_PING
#define CONFIG_CMD_DHCP
#define CONFIG_CMD_NAND
#define CONFIG_CMD_USB

/* SDRAM */
#define CONFIG_NR_DRAM_BANKS		1
#define CONFIG_SYS_SDRAM_BASE		0x20000000
#define CONFIG_SYS_SDRAM_SIZE		0x04000000
#define CONFIG_SYS_INIT_SP_ADDR \
	(ATMEL_BASE_SRAM + 0x1000 - GENERATED_GBL_DATA_SIZE)

/* DataFlash */
#define CONFIG_ATMEL_DATAFLASH_SPI
#define CONFIG_HAS_DATAFLASH
#define CONFIG_SYS_SPI_WRITE_TOUT		(5*CONFIG_SYS_HZ)
#define CONFIG_SYS_MAX_DATAFLASH_BANKS		2
#define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0	0xC0000000	/* CS0 */
#define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS3	0xD0000000	/* CS3 */
#define AT91_SPI_CLK				15000000
#define DATAFLASH_TCSS				(0x1a << 16)
#define DATAFLASH_TCHS				(0x1 << 24)

/* NAND flash */
#ifdef CONFIG_CMD_NAND
#define CONFIG_NAND_ATMEL
#define CONFIG_SYS_MAX_NAND_DEVICE		1
#define CONFIG_SYS_NAND_BASE			0x40000000
#define CONFIG_SYS_NAND_DBW_8
/* our ALE is AD22 */
#define CONFIG_SYS_NAND_MASK_ALE		(1 << 22)
/* our CLE is AD21 */
#define CONFIG_SYS_NAND_MASK_CLE		(1 << 21)
#define CONFIG_SYS_NAND_ENABLE_PIN		AT91_PIN_PC14
#define CONFIG_SYS_NAND_READY_PIN		AT91_PIN_PC15

#endif

/* NOR flash - no real flash on this board */
#define CONFIG_SYS_NO_FLASH

/* Ethernet */
#define CONFIG_NET_MULTI
#define CONFIG_DRIVER_DM9000
#define CONFIG_DM9000_BASE		0x30000000
#define DM9000_IO			CONFIG_DM9000_BASE
#define DM9000_DATA			(CONFIG_DM9000_BASE + 4)
#define CONFIG_DM9000_USE_16BIT
#define CONFIG_DM9000_NO_SROM
#define CONFIG_NET_RETRY_COUNT		20
#define CONFIG_RESET_PHY_R

/* USB */
#define CONFIG_USB_ATMEL
#define CONFIG_USB_OHCI_NEW
#define CONFIG_DOS_PARTITION
#define CONFIG_SYS_USB_OHCI_CPU_INIT
#define CONFIG_SYS_USB_OHCI_REGS_BASE		0x00500000	/* AT91SAM9261_UHP_BASE */
#ifdef CONFIG_AT91SAM9G10EK
#define CONFIG_SYS_USB_OHCI_SLOT_NAME		"at91sam9g10"
#else
#define CONFIG_SYS_USB_OHCI_SLOT_NAME		"at91sam9261"
#endif
#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	2
#define CONFIG_USB_STORAGE
#define CONFIG_CMD_FAT

#define CONFIG_SYS_LOAD_ADDR			0x22000000	/* load address */

#define CONFIG_SYS_MEMTEST_START		CONFIG_SYS_SDRAM_BASE
#define CONFIG_SYS_MEMTEST_END			0x23e00000

#ifdef CONFIG_SYS_USE_DATAFLASH_CS0

/* bootstrap + u-boot + env + linux in dataflash on CS0 */
#define CONFIG_ENV_IS_IN_DATAFLASH
#define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400)
#define CONFIG_ENV_OFFSET	0x4200
#define CONFIG_ENV_ADDR		(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + CONFIG_ENV_OFFSET)
#define CONFIG_ENV_SIZE		0x4200
#define CONFIG_BOOTCOMMAND	"cp.b 0xC0042000 0x22000000 0x210000; bootm"
#define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
				"root=/dev/mtdblock0 "			\
				"mtdparts=atmel_nand:-(root) "		\
				"rw rootfstype=jffs2"

#elif CONFIG_SYS_USE_DATAFLASH_CS3

/* bootstrap + u-boot + env + linux in dataflash on CS3 */
#define CONFIG_ENV_IS_IN_DATAFLASH
#define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS3 + 0x8400)
#define CONFIG_ENV_OFFSET	0x4200
#define CONFIG_ENV_ADDR		(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS3 + CONFIG_ENV_OFFSET)
#define CONFIG_ENV_SIZE		0x4200
#define CONFIG_BOOTCOMMAND	"cp.b 0xD0042000 0x22000000 0x210000; bootm"
#define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
				"root=/dev/mtdblock0 "			\
				"mtdparts=atmel_nand:-(root) "		\
				"rw rootfstype=jffs2"

#else /* CONFIG_SYS_USE_NANDFLASH */

/* bootstrap + u-boot + env + linux in nandflash */
#define CONFIG_ENV_IS_IN_NAND
#define CONFIG_ENV_OFFSET		0x60000
#define CONFIG_ENV_OFFSET_REDUND	0x80000
#define CONFIG_ENV_SIZE		0x20000		/* 1 sector = 128 kB */
#define CONFIG_BOOTCOMMAND	"nand read 0x22000000 0xA0000 0x200000; bootm"
#define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
				"root=/dev/mtdblock5 "			\
				"mtdparts=atmel_nand:128k(bootstrap)ro,"	\
				"256k(uboot)ro,128k(env1)ro,"		\
				"128k(env2)ro,2M(linux),-(root) "	\
				"rw rootfstype=jffs2"

#endif

#define CONFIG_SYS_PROMPT		"U-Boot> "
#define CONFIG_SYS_CBSIZE		256
#define CONFIG_SYS_MAXARGS		16
#define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
#define CONFIG_SYS_LONGHELP
#define CONFIG_CMDLINE_EDITING

/*
 * Size of malloc() pool
 */
#define CONFIG_SYS_MALLOC_LEN		ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000)

#define CONFIG_STACKSIZE		(32*1024)	/* regular stack */

#ifdef CONFIG_USE_IRQ
#error CONFIG_USE_IRQ not supported
#endif

#endif

redpajama_set_name: RedPajamaGithub


I originally wrote this piece for the March/April 2012 SCBWI Bulletin.
Among the very first books that I ever touched, were the five Little Bear books by Else Holmelund Minarik and illustrated by Maurice Sendak. The bittersweet episode in which Little Bear thinks his mother has forgotten about his birthday was especially fascinating to me as a young child. The story is touching and beautifully told, but what really got into my guts, and stayed there forever, are those perfect ink drawings. The disappointment you could see on Little Bear's expressions; the different personalities of Hen, Duck, and Cat; the melancholy of the humble birthday soup: all this is illuminated by Sendak's pen in such a sensitive manner. The last time I took a good look at those drawings was years ago, but if I close my eyes I can still see them so clearly.
As an adolescent, I began imagining for myself a future as a visual storyteller of some kind. Looking around for inspiration, I encountered Hieronymus Bosch, Alfred Kubin, Elzie Crisler Segar, George Herriman, Wilhelm Busch, and other artists in various fields. Since I didn't go through any kind of formal education to speak of, these people and their work were fundamental in my artistic progress, for better or worse. But when I sat down at my table to learn how to use that wonderful drafting tool that is the dip pen, I knew what to keep near at hand: Maurice Sendak's drawings.
In Italy, where I was born and grew up, most of Sendak's books were not nearly as popular as they were in the United States and elsewhere in the world. Only when I moved to New York in the mid nineties did I fully understand the range and importance of his work. I began collecting his books, which kept me company on my path to the profession.
One day in February of 2011, opening the mailbox to clear it up from the usual utility bills and advertisements, I found a curious item: a letter. It was addressed to me, and bore the letterhead The Sendak Fellowship. I opened it, expecting to read a request for a donation to a children's literacy program or something of that nature. Instead, the letter was an invitation to spend four weeks in Connecticut, in a house a few steps from Maurice Sendak's, in the fall. I would be given a studio where to work on my projects, if I felt like it. In fact, there was no obligation to produce anything specific, or anything at all. In addition to this, and to me most importantly, I would have a chance to meet Maurice Sendak. Maurice Sendak! I said yes, but I was scared.
The notion that Sendak actually knew my books enough to invite me to his place was unsettling. I have always been afraid that one day I'll hear a knock at the door and some stranger in a uniform, an Art Police officer, will notify me of my lack of qualifications and therefore my inadequacy to be in this business. I will have to surrender my pen and nibs and my India ink, my watercolors and my paper. Something like this might happen one day, and I was afraid the time had come. Sendak himself was to notify me personally.
A few months before the fellowship began, I learned the names of the three other fellows who would be in Connecticut with me (four illustrators are invited each year): Denise Saldutti, Frann Preston-Gannon, and Ali Bahrampour. I was very familiar with Bahrampour's picture book, Otto. The Story of a Mirror, a wonderful, truly original book. I thought: if he is also being invited, maybe I don't have to be too afraid. After making that first book, he seemed to have disappeared from the children's book world, so they couldn't possibly want him out, as he already was out. I began to think that the Sendak Fellowship must have been some kind of rehabilitation center for picture storytellers. And for me, it was.
Everything in my stay was delightful: the convivial atmosphere; the incredible kindness and efficiency of Dona McAdams and Lynn Caponera, who organize the program; my studio, with windows that looked into the woods, populated by birds, frogs, toads, turtles, chipmunks, deer, and very long and fat earthworms. In that studio, I was able to draw and think freely, with no deadlines or pressure of any kind, just for the pleasure of it.
The main reason why I draw and tell stories is to be in that state of grace and intimate isolation you reach when you are completely immersed in your creation. We all know it is often a delusive state, but still. In that world that you are building, you want to be honest, you want to be true to yourself. But when you make picture books for children, there are so many hurdles, taboos, things that you are not allowed to show or tell. You get used to this notion; you come to accept it as a given; you censor yourself. And you produce books that are not as good as they could be. You forget why you are doing this.
Sendak reminded me that it doesn't have to be that way. He is a very warm, sweet and witty person, but also very honest. He told me what he liked in my books and what he didn't like. His main concern was that some of my choices were too safe and tame. "You need to be brave," he said to me. I tried to blame the publishers, and he did acknowledge that today's industry, at least in the United States, is not as favorable and nurturing as it was forty or fifty years ago. But that, he told me, should not be an excuse. He is completely right, and I already knew that. But talking with him, while walking in the woods with his dog Herman, made me remember why I draw and tell stories.
This entry was posted on February 24, 2013 at 3:28 pm and is filed under Blog. You can follow any responses to this entry through the RSS 2.0 feed.
Wise words. Thank you. Now… back to the drawing board!


There's no right or wrong when it comes to celebrating your loved one and honoring their life, accomplishments, and individuality.
We approach every funeral as a blank canvas. As your funeral directors, we will give you the tools necessary to co-create a service that will serve as a beautiful portrait of the life that is being honored.
Our funeral home is a stage in which the life of your loved one can be played out in front of every guest that attends the visitation or service.
We'll create a beautiful video tribute to your loved one by combining family photographs with music of your choice, and professional effects to share your loved one's special journey during the service and provide your family and friends with a meaningful keepsake after the ceremony is over.
From the register book and memorial folders to prayer cards and thank-you notes, our high-quality stationery sets are customized to honor your loved one's hobbies, style, and unique life path.


How is Amy Rutberg's Married Life? Who is her husband?
How much is the Net worth of Amy Rutberg?
Amy Rutberg entered the limelight with her portrayal as Marci Stahl in Daredevil. She has also acted in some of the most popular shows such as The Good Wife, Law and Order and the list goes on. She proves herself as the actress to watch out for.
Amy Rutberg is doing well in her career getting cast on hit shows along with well-liked stars. The viewers also cannot help but approve her skills as an actor. So, how is her personal life? Is she taken? What about her earning? Let's start the quest for information!
Amy Rutberg is living a happy married life with husband, Shane Lucas Rahmani. The pair tied the knot on 28 August 2011 in presence of their family and friends; however, the actress keeps her family away from the media attention.
Amy Rutberg with her husband Shane Rahmani at a party.
From their togetherness, the duo shares a daughter together, too. Moreover, they are busy living well and there are not any reports to extra-marital affairs so far. And we do hope that the small happy family remains the same.
Don't Miss: Shoshannah Stern' Married Life!
She usually posts pictures and videos of herself with her co-stars, friends, and family on social media like Instagram and Twitter. It is proof that she maintains both professionalism and private life pretty well.
From her many years of hard work, Amy Rutberg has an estimated net worth of $250 Thousand. The average salary of an American actress is $71 thousand. She gathers her assets from her television and film roles.
The Hard Sell (2016) actress is an avid animal lover as well and owns a pet dog breed Poodle. Typically, a Miniature Poodle dog costs around $800-$3,000 at the market.
YouTube: Amy Rutberg's series Daredevil clip.
The 37-year-old was popular as Marci Stahl in the web T.V. series Daredevil by Netflix. In the action thriller series, she played alongside Charlie Cox, Deborah Ann Woll, and Elden Henson.
Read, Also: Loreto Peralta's Net Worth!
The dazzling actress also appeared in the biographical drama, Rebel in the Rye in 2017. Not to mention, she acted alongside Nicholas Hoult and Zoey Deutch. The movie made $378,294 in the box office.
When and where was Amy Rutberg born?
How old is Amy Rutberg?
Which nationality does Amy Rutberg belong to?
What is the ethnicity of Rutberg?
Which university did Amy Rutberg attend?
What is Rutberg's birth sign?
Which color of hair does Amy Rutberg have?
What is the color of the eyes of Amy Rutberg?
How tall is Amy Rutberg?
How much does Amy Rutberg weigh?


This month has just about killed me. My family has run into so many troubles this month that I don't think I can do anything else but stay afloat. A week after my roof opened up and leaked into my bedroom and office, I rear-ended a pick-up and totaled my car. My insurance has to be shaking its head about now.
It's gotten me to realize that I need to take a bit of a break. Old School Evil is going to go on hiatus for the rest of the year - with a few exceptions, in case Banzai Retro Club is going to have a crossover post for Christmas. With the 8th round of Bad Guy Beatdown just finished up, the first tier is halfway done, so it feels like a good time to take a break. I'll post a summary in the beginning of January and we'll go on to our next fight - Overloard vs Overloard, Spiral Zone's and Blackstar's villains.
Once the new year starts, I'll jump back in to editing, writing, and design works for Old School Evil and the sequel. But until then... I'm done with 2017.


We Have researched amusement park camp grounds around the country to come up with the 3 best amusement park camp grounds for you and your family.
We have compiled a list of clean, easily accessible and affordable camp grounds at 3 different locations in the United States.
Worlds of Fun and Oceans of Fun Kansas City, Missouri. There are two separate camp grounds on the campus of Worlds of Fun and Oceans of Fun in Kansas City, Missouri. One camp ground is made exclusively for RVs with complete hook-ups and the other is for tents.
Holiday World and Splashin Safari and Lake Rudolph Camp ground and RV resort in Santa Claus, Indiana. This camp ground is overflowing with amenities from golf carts to get around the large campus to paddleboats, fishing and free wifi.
Hersheypark and Dutch Wonderland at Highmeadow Campground in Hershey Pennsylvania. This camp ground attached to the Dutch Wonderland and Hersheypark is complete with nearly 300 camp sites and 22 cabins. The park also offers free wifi and laundry services as well as a swimming pool and a recreation center for kids with a game and arcade room.


text:
import logging

from django.core.urlresolvers import reverse
from django import http

from mox import IsA

from horizon import exceptions
from horizon.workflows.views import WorkflowView

from openstack_dashboard import api
from openstack_dashboard.test import helpers as test
from openstack_dashboard.usage import quotas

from .workflows import CreateProject
from .workflows import UpdateProject

INDEX_URL = reverse('horizon:admin:projects:index')

@test.create_stubs({api.keystone: ('tenant_list',)})
class TenantsViewTests(test.BaseAdminViewTests):
    def test_index(self):
        api.keystone.tenant_list(IsA(http.HttpRequest), paginate=True) \
                    .AndReturn([self.tenants.list(), False])
        self.mox.ReplayAll()

        res = self.client.get(INDEX_URL)
        self.assertTemplateUsed(res, 'admin/projects/index.html')
        self.assertItemsEqual(res.context['table'].data, self.tenants.list())

class CreateProjectWorkflowTests(test.BaseAdminViewTests):
    def _get_project_info(self, project):
        project_info = {"name": project.name,
                        "description": project.description,
                        "enabled": project.enabled}
        return project_info

    def _get_workflow_fields(self, project):
        project_info = {"name": project.name,
                        "description": project.description,
                        "enabled": project.enabled}
        return project_info

    def _get_quota_info(self, quota):
        cinder_quota = self.cinder_quotas.first()
        quota_data = {}
        for field in quotas.NOVA_QUOTA_FIELDS:
            quota_data[field] = int(quota.get(field).limit)
        for field in quotas.CINDER_QUOTA_FIELDS:
            quota_data[field] = int(cinder_quota.get(field).limit)
        return quota_data

    def _get_workflow_data(self, project, quota):
        project_info = self._get_workflow_fields(project)
        quota_data = self._get_quota_info(quota)
        project_info.update(quota_data)
        return project_info

    @test.create_stubs({api.keystone: ('get_default_role',
                                       'user_list',
                                       'role_list'),
                        quotas: ('get_default_quota_data',)})
    def test_add_project_get(self):
        quota = self.quotas.first()
        default_role = self.roles.first()
        users = self.users.list()
        roles = self.roles.list()

        quotas.get_default_quota_data(IsA(http.HttpRequest)).AndReturn(quota)

        # init
        api.keystone.get_default_role(IsA(http.HttpRequest)) \
            .AndReturn(default_role)
        api.keystone.user_list(IsA(http.HttpRequest)).AndReturn(users)
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        self.mox.ReplayAll()

        url = reverse('horizon:admin:projects:create')
        res = self.client.get(url)

        self.assertTemplateUsed(res, WorkflowView.template_name)

        workflow = res.context['workflow']
        self.assertEqual(res.context['workflow'].name, CreateProject.name)

        step = workflow.get_step("createprojectinfoaction")
        self.assertEqual(step.action.initial['ram'], quota.get('ram').limit)
        self.assertEqual(step.action.initial['injected_files'],
                         quota.get('injected_files').limit)
        self.assertQuerysetEqual(workflow.steps,
                            ['<CreateProjectInfo: createprojectinfoaction>',
                             '<UpdateProjectMembers: update_members>',
                             '<UpdateProjectQuota: update_quotas>'])

    @test.create_stubs({api.keystone: ('get_default_role',
                                       'add_tenant_user_role',
                                       'tenant_create',
                                       'user_list',
                                       'role_list'),
                        quotas: ('get_default_quota_data',),
                        api.cinder: ('tenant_quota_update',),
                        api.nova: ('tenant_quota_update',)})
    def test_add_project_post(self):
        project = self.tenants.first()
        quota = self.quotas.first()
        default_role = self.roles.first()
        users = self.users.list()
        roles = self.roles.list()

        # init
        quotas.get_default_quota_data(IsA(http.HttpRequest)).AndReturn(quota)

        api.keystone.get_default_role(IsA(http.HttpRequest)) \
            .AndReturn(default_role)
        api.keystone.user_list(IsA(http.HttpRequest)).AndReturn(users)
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        # contribute
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        # handle
        project_details = self._get_project_info(project)
        quota_data = self._get_quota_info(quota)

        api.keystone.tenant_create(IsA(http.HttpRequest), **project_details) \
                    .AndReturn(project)

        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        workflow_data = {}
        for role in roles:
            if "role_" + role.id in workflow_data:
                ulist = workflow_data["role_" + role.id]
                for user_id in ulist:
                    api.keystone.add_tenant_user_role(IsA(http.HttpRequest),
                                                      project=self.tenant.id,
                                                      user=user_id,
                                                      role=role.id)

        nova_updated_quota = dict([(key, quota_data[key]) for key in
                                   quotas.NOVA_QUOTA_FIELDS])
        api.nova.tenant_quota_update(IsA(http.HttpRequest),
                                     project.id,
                                     **nova_updated_quota)
        cinder_updated_quota = dict([(key, quota_data[key]) for key in
                                   quotas.CINDER_QUOTA_FIELDS])
        api.cinder.tenant_quota_update(IsA(http.HttpRequest),
                                       project.id,
                                       **cinder_updated_quota)

        self.mox.ReplayAll()

        workflow_data.update(self._get_workflow_data(project, quota))

        url = reverse('horizon:admin:projects:create')
        res = self.client.post(url, workflow_data)

        self.assertNoFormErrors(res)
        self.assertRedirectsNoFollow(res, INDEX_URL)

    @test.create_stubs({api.keystone: ('user_list',
                                       'role_list',
                                       'get_default_role'),
                        quotas: ('get_default_quota_data',)})
    def test_add_project_quota_defaults_error(self):
        default_role = self.roles.first()
        users = self.users.list()
        roles = self.roles.list()

        # init
        quotas.get_default_quota_data(IsA(http.HttpRequest)) \
            .AndRaise(self.exceptions.nova)

        api.keystone.get_default_role(IsA(http.HttpRequest)) \
            .AndReturn(default_role)
        api.keystone.user_list(IsA(http.HttpRequest)).AndReturn(users)
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        self.mox.ReplayAll()

        url = reverse('horizon:admin:projects:create')
        res = self.client.get(url)

        self.assertTemplateUsed(res, WorkflowView.template_name)
        self.assertContains(res, "Unable to retrieve default quota values")

    @test.create_stubs({api.keystone: ('tenant_create',
                                       'user_list',
                                       'role_list',
                                       'get_default_role'),
                        quotas: ('get_default_quota_data',)})
    def test_add_project_tenant_create_error(self):
        project = self.tenants.first()
        quota = self.quotas.first()
        default_role = self.roles.first()
        users = self.users.list()
        roles = self.roles.list()

        # init
        quotas.get_default_quota_data(IsA(http.HttpRequest)).AndReturn(quota)

        api.keystone.get_default_role(IsA(http.HttpRequest)) \
            .AndReturn(default_role)
        api.keystone.user_list(IsA(http.HttpRequest)).AndReturn(users)
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        # contribute
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        # handle
        project_details = self._get_project_info(project)

        api.keystone.tenant_create(IsA(http.HttpRequest), **project_details) \
            .AndRaise(self.exceptions.keystone)

        self.mox.ReplayAll()

        workflow_data = self._get_workflow_data(project, quota)

        url = reverse('horizon:admin:projects:create')
        res = self.client.post(url, workflow_data)

        self.assertNoFormErrors(res)
        self.assertRedirectsNoFollow(res, INDEX_URL)

    @test.create_stubs({api.keystone: ('tenant_create',
                                       'user_list',
                                       'role_list',
                                       'get_default_role',
                                       'add_tenant_user_role'),
                        quotas: ('get_default_quota_data',),
                        api.nova: ('tenant_quota_update',)})
    def test_add_project_quota_update_error(self):
        project = self.tenants.first()
        quota = self.quotas.first()
        default_role = self.roles.first()
        users = self.users.list()
        roles = self.roles.list()

        # init
        quotas.get_default_quota_data(IsA(http.HttpRequest)).AndReturn(quota)

        api.keystone.get_default_role(IsA(http.HttpRequest)) \
            .AndReturn(default_role)
        api.keystone.user_list(IsA(http.HttpRequest)).AndReturn(users)
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        # contribute
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        # handle
        project_details = self._get_project_info(project)
        quota_data = self._get_quota_info(quota)

        api.keystone.tenant_create(IsA(http.HttpRequest), **project_details) \
            .AndReturn(project)

        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        workflow_data = {}
        for role in roles:
            if "role_" + role.id in workflow_data:
                ulist = workflow_data["role_" + role.id]
                for user_id in ulist:
                    api.keystone.add_tenant_user_role(IsA(http.HttpRequest),
                                                      project=self.tenant.id,
                                                      user=user_id,
                                                      role=role.id)

        nova_updated_quota = dict([(key, quota_data[key]) for key in
                                   quotas.NOVA_QUOTA_FIELDS])
        api.nova.tenant_quota_update(IsA(http.HttpRequest),
                                     project.id,
                                     **nova_updated_quota) \
           .AndRaise(self.exceptions.nova)

        self.mox.ReplayAll()

        workflow_data.update(self._get_workflow_data(project, quota))

        url = reverse('horizon:admin:projects:create')
        res = self.client.post(url, workflow_data)

        self.assertNoFormErrors(res)
        self.assertRedirectsNoFollow(res, INDEX_URL)

    @test.create_stubs({api.keystone: ('tenant_create',
                                       'user_list',
                                       'role_list',
                                       'get_default_role',
                                       'add_tenant_user_role'),
                        quotas: ('get_default_quota_data',),
                        api.cinder: ('tenant_quota_update',),
                        api.nova: ('tenant_quota_update',)})
    def test_add_project_user_update_error(self):
        project = self.tenants.first()
        quota = self.quotas.first()
        default_role = self.roles.first()
        users = self.users.list()
        roles = self.roles.list()

        # init
        quotas.get_default_quota_data(IsA(http.HttpRequest)).AndReturn(quota)

        api.keystone.get_default_role(IsA(http.HttpRequest)) \
            .AndReturn(default_role)
        api.keystone.user_list(IsA(http.HttpRequest)).AndReturn(users)
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        # contribute
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        # handle
        project_details = self._get_project_info(project)
        quota_data = self._get_quota_info(quota)

        api.keystone.tenant_create(IsA(http.HttpRequest), **project_details) \
                    .AndReturn(project)

        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        workflow_data = {}
        for role in roles:
            if "role_" + role.id in workflow_data:
                ulist = workflow_data["role_" + role.id]
                for user_id in ulist:
                    api.keystone.add_tenant_user_role(IsA(http.HttpRequest),
                                                      project=self.tenant.id,
                                                      user=user_id,
                                                      role=role.id) \
                       .AndRaise(self.exceptions.keystone)
                    break
            break

        nova_updated_quota = dict([(key, quota_data[key]) for key in
                                   quotas.NOVA_QUOTA_FIELDS])
        api.nova.tenant_quota_update(IsA(http.HttpRequest),
                                     project.id,
                                     **nova_updated_quota)

        cinder_updated_quota = dict([(key, quota_data[key]) for key in
                                    quotas.CINDER_QUOTA_FIELDS])
        api.cinder.tenant_quota_update(IsA(http.HttpRequest),
                                       project.id,
                                       **cinder_updated_quota)

        self.mox.ReplayAll()

        workflow_data.update(self._get_workflow_data(project, quota))

        url = reverse('horizon:admin:projects:create')
        res = self.client.post(url, workflow_data)

        self.assertNoFormErrors(res)
        self.assertRedirectsNoFollow(res, INDEX_URL)

    @test.create_stubs({api.keystone: ('user_list',
                                       'role_list',
                                       'get_default_role'),
                        quotas: ('get_default_quota_data',)})
    def test_add_project_missing_field_error(self):
        project = self.tenants.first()
        quota = self.quotas.first()
        default_role = self.roles.first()
        users = self.users.list()
        roles = self.roles.list()

        # init
        quotas.get_default_quota_data(IsA(http.HttpRequest)).AndReturn(quota)

        api.keystone.get_default_role(IsA(http.HttpRequest)) \
            .AndReturn(default_role)
        api.keystone.user_list(IsA(http.HttpRequest)).AndReturn(users)
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        # contribute
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        self.mox.ReplayAll()

        workflow_data = self._get_workflow_data(project, quota)
        workflow_data["name"] = ""

        url = reverse('horizon:admin:projects:create')
        res = self.client.post(url, workflow_data)

        self.assertContains(res, "field is required")

class UpdateProjectWorkflowTests(test.BaseAdminViewTests):
    def _get_quota_info(self, quota):
        cinder_quota = self.cinder_quotas.first()
        quota_data = {}
        for field in quotas.NOVA_QUOTA_FIELDS:
            quota_data[field] = int(quota.get(field).limit)
        for field in quotas.CINDER_QUOTA_FIELDS:
            quota_data[field] = int(cinder_quota.get(field).limit)
        return quota_data

    @test.create_stubs({api.keystone: ('get_default_role',
                                       'roles_for_user',
                                       'tenant_get',
                                       'user_list',
                                       'role_list'),
                        quotas: ('get_tenant_quota_data',)})
    def test_update_project_get(self):
        project = self.tenants.first()
        quota = self.quotas.first()
        default_role = self.roles.first()
        users = self.users.list()
        roles = self.roles.list()

        api.keystone.tenant_get(IsA(http.HttpRequest),
                                self.tenant.id, admin=True) \
            .AndReturn(project)
        quotas.get_tenant_quota_data(IsA(http.HttpRequest),
                                     tenant_id=self.tenant.id) \
            .AndReturn(quota)

        api.keystone.get_default_role(IsA(http.HttpRequest)) \
            .AndReturn(default_role)
        api.keystone.user_list(IsA(http.HttpRequest)).AndReturn(users)
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        for user in users:
            api.keystone.roles_for_user(IsA(http.HttpRequest),
                                        user.id,
                                        self.tenant.id).AndReturn(roles)

        self.mox.ReplayAll()

        url = reverse('horizon:admin:projects:update',
                      args=[self.tenant.id])
        res = self.client.get(url)

        self.assertTemplateUsed(res, WorkflowView.template_name)

        workflow = res.context['workflow']
        self.assertEqual(res.context['workflow'].name, UpdateProject.name)

        step = workflow.get_step("update_info")
        self.assertEqual(step.action.initial['ram'], quota.get('ram').limit)
        self.assertEqual(step.action.initial['injected_files'],
                         quota.get('injected_files').limit)
        self.assertEqual(step.action.initial['name'], project.name)
        self.assertEqual(step.action.initial['description'],
                         project.description)
        self.assertQuerysetEqual(workflow.steps,
                            ['<UpdateProjectInfo: update_info>',
                             '<UpdateProjectMembers: update_members>',
                             '<UpdateProjectQuota: update_quotas>'])

    @test.create_stubs({api.keystone: ('tenant_get',
                                       'tenant_update',
                                       'get_default_role',
                                       'roles_for_user',
                                       'remove_tenant_user_role',
                                       'add_tenant_user_role',
                                       'user_list',
                                       'role_list'),
                        api.nova: ('tenant_quota_update',),
                        api.cinder: ('tenant_quota_update',),
                        quotas: ('get_tenant_quota_data',)})
    def test_update_project_save(self):
        project = self.tenants.first()
        quota = self.quotas.first()
        default_role = self.roles.first()
        users = self.users.list()
        roles = self.roles.list()

        # get/init
        api.keystone.tenant_get(IsA(http.HttpRequest),
                                self.tenant.id, admin=True) \
            .AndReturn(project)
        quotas.get_tenant_quota_data(IsA(http.HttpRequest),
                                     tenant_id=self.tenant.id) \
            .AndReturn(quota)

        api.keystone.get_default_role(IsA(http.HttpRequest)) \
            .AndReturn(default_role)
        api.keystone.user_list(IsA(http.HttpRequest)).AndReturn(users)
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        workflow_data = {}
        for user in users:
            api.keystone.roles_for_user(IsA(http.HttpRequest),
                                        user.id,
                                        self.tenant.id).AndReturn(roles)

        workflow_data["role_1"] = ['3']  # admin role
        workflow_data["role_2"] = ['2']  # member role

        # update some fields
        project._info["name"] = "updated name"
        project._info["description"] = "updated description"
        quota.metadata_items = 444
        quota.volumes = 444

        updated_project = {"name": project._info["name"],
                           "description": project._info["description"],
                           "enabled": project.enabled}
        updated_quota = self._get_quota_info(quota)

        # contribute
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        # handle
        api.keystone.tenant_update(IsA(http.HttpRequest),
                                   project.id,
                                   **updated_project) \
            .AndReturn(project)

        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)
        api.keystone.user_list(IsA(http.HttpRequest),
                               project=self.tenant.id).AndReturn(users)

        # admin user - try to remove all roles on current project, warning
        api.keystone.roles_for_user(IsA(http.HttpRequest), '1',
                                    self.tenant.id) \
                           .AndReturn(roles)

        # member user 1 - has role 1, will remove it
        api.keystone.roles_for_user(IsA(http.HttpRequest), '2',
                                    self.tenant.id) \
                           .AndReturn((roles[0],))
        # remove role 1
        api.keystone.remove_tenant_user_role(IsA(http.HttpRequest),
                                             project=self.tenant.id,
                                             user='2',
                                             role='1')
        # add role 2
        api.keystone.add_tenant_user_role(IsA(http.HttpRequest),
                                          project=self.tenant.id,
                                          user='2',
                                          role='2')

        # member user 3 - has role 2
        api.keystone.roles_for_user(IsA(http.HttpRequest), '3',
                                    self.tenant.id) \
                           .AndReturn((roles[1],))
        # remove role 2
        api.keystone.remove_tenant_user_role(IsA(http.HttpRequest),
                                             project=self.tenant.id,
                                             user='3',
                                             role='2')
        # add role 1
        api.keystone.add_tenant_user_role(IsA(http.HttpRequest),
                                          project=self.tenant.id,
                                          user='3',
                                          role='1')

        nova_updated_quota = dict([(key, updated_quota[key]) for key in
                                   quotas.NOVA_QUOTA_FIELDS])
        api.nova.tenant_quota_update(IsA(http.HttpRequest),
                                     project.id,
                                     **nova_updated_quota)

        cinder_updated_quota = dict([(key, updated_quota[key]) for key in
                                   quotas.CINDER_QUOTA_FIELDS])
        api.cinder.tenant_quota_update(IsA(http.HttpRequest),
                                       project.id,
                                       **cinder_updated_quota)
        self.mox.ReplayAll()

        # submit form data
        project_data = {"name": project._info["name"],
                         "id": project.id,
                         "description": project._info["description"],
                         "enabled": project.enabled}
        workflow_data.update(project_data)
        workflow_data.update(updated_quota)
        url = reverse('horizon:admin:projects:update',
                      args=[self.tenant.id])
        res = self.client.post(url, workflow_data)

        self.assertNoFormErrors(res)
        self.assertMessageCount(error=0, warning=1)
        self.assertRedirectsNoFollow(res, INDEX_URL)

    @test.create_stubs({api.keystone: ('tenant_get',)})
    def test_update_project_get_error(self):

        api.keystone.tenant_get(IsA(http.HttpRequest), self.tenant.id,
                                admin=True) \
            .AndRaise(self.exceptions.nova)

        self.mox.ReplayAll()

        url = reverse('horizon:admin:projects:update',
                      args=[self.tenant.id])
        res = self.client.get(url)

        self.assertRedirectsNoFollow(res, INDEX_URL)

    @test.create_stubs({api.keystone: ('tenant_get',
                                       'tenant_update',
                                       'get_default_role',
                                       'roles_for_user',
                                       'remove_tenant_user',
                                       'add_tenant_user_role',
                                       'user_list',
                                       'role_list'),
                        quotas: ('get_tenant_quota_data',),
                        api.nova: ('tenant_quota_update',)})
    def test_update_project_tenant_update_error(self):
        project = self.tenants.first()
        quota = self.quotas.first()
        default_role = self.roles.first()
        users = self.users.list()
        roles = self.roles.list()

        # get/init
        api.keystone.tenant_get(IsA(http.HttpRequest), self.tenant.id,
                                admin=True) \
            .AndReturn(project)
        quotas.get_tenant_quota_data(IsA(http.HttpRequest),
                                     tenant_id=self.tenant.id) \
            .AndReturn(quota)

        api.keystone.get_default_role(IsA(http.HttpRequest)) \
            .AndReturn(default_role)
        api.keystone.user_list(IsA(http.HttpRequest)).AndReturn(users)
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        workflow_data = {}
        for user in users:
            api.keystone.roles_for_user(IsA(http.HttpRequest),
                                        user.id,
                                        self.tenant.id).AndReturn(roles)
            role_ids = [role.id for role in roles]
            if role_ids:
                workflow_data.setdefault("role_" + role_ids[0], []) \
                             .append(user.id)

        # update some fields
        project._info["name"] = "updated name"
        project._info["description"] = "updated description"
        quota.metadata_items = 444
        quota.volumes = 444

        updated_project = {"name": project._info["name"],
                           "description": project._info["description"],
                           "enabled": project.enabled}
        updated_quota = self._get_quota_info(quota)

        # contribute
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        # handle
        api.keystone.tenant_update(IsA(http.HttpRequest),
                                   project.id,
                                   **updated_project) \
            .AndRaise(self.exceptions.keystone)

        self.mox.ReplayAll()

        # submit form data
        project_data = {"name": project._info["name"],
                         "id": project.id,
                         "description": project._info["description"],
                         "enabled": project.enabled}
        workflow_data.update(project_data)
        workflow_data.update(updated_quota)
        url = reverse('horizon:admin:projects:update',
                      args=[self.tenant.id])
        res = self.client.post(url, workflow_data)

        self.assertNoFormErrors(res)
        self.assertRedirectsNoFollow(res, INDEX_URL)

    @test.create_stubs({api.keystone: ('tenant_get',
                                       'tenant_update',
                                       'get_default_role',
                                       'roles_for_user',
                                       'remove_tenant_user_role',
                                       'add_tenant_user_role',
                                       'user_list',
                                       'role_list'),
                        quotas: ('get_tenant_quota_data',),
                        api.nova: ('tenant_quota_update',)})
    def test_update_project_quota_update_error(self):
        project = self.tenants.first()
        quota = self.quotas.first()
        default_role = self.roles.first()
        users = self.users.list()
        roles = self.roles.list()

        # get/init
        api.keystone.tenant_get(IsA(http.HttpRequest), self.tenant.id,
                                admin=True) \
            .AndReturn(project)
        quotas.get_tenant_quota_data(IsA(http.HttpRequest),
                                     tenant_id=self.tenant.id) \
            .AndReturn(quota)

        api.keystone.get_default_role(IsA(http.HttpRequest)) \
            .AndReturn(default_role)
        api.keystone.user_list(IsA(http.HttpRequest)).AndReturn(users)
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        workflow_data = {}

        for user in users:
            api.keystone.roles_for_user(IsA(http.HttpRequest),
                                        user.id,
                                        self.tenant.id).AndReturn(roles)

        workflow_data["role_1"] = ['1', '3']  # admin role
        workflow_data["role_2"] = ['1', '2', '3']  # member role

        # update some fields
        project._info["name"] = "updated name"
        project._info["description"] = "updated description"
        quota[0].limit = 444
        quota[1].limit = -1

        updated_project = {"name": project._info["name"],
                           "description": project._info["description"],
                           "enabled": project.enabled}
        updated_quota = self._get_quota_info(quota)

        # contribute
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        # handle
        # handle
        api.keystone.tenant_update(IsA(http.HttpRequest),
                                   project.id,
                                   **updated_project) \
            .AndReturn(project)

        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)
        api.keystone.user_list(IsA(http.HttpRequest),
                               project=self.tenant.id).AndReturn(users)

        # admin user - try to remove all roles on current project, warning
        api.keystone.roles_for_user(IsA(http.HttpRequest), '1',
                                    self.tenant.id) \
                           .AndReturn(roles)

        # member user 1 - has role 1, will remove it
        api.keystone.roles_for_user(IsA(http.HttpRequest), '2',
                                    self.tenant.id) \
                           .AndReturn((roles[1],))

        # member user 3 - has role 2
        api.keystone.roles_for_user(IsA(http.HttpRequest), '3',
                                    self.tenant.id) \
                           .AndReturn((roles[0],))
        # add role 2
        api.keystone.add_tenant_user_role(IsA(http.HttpRequest),
                                          project=self.tenant.id,
                                          user='3',
                                          role='2')

        nova_updated_quota = dict([(key, updated_quota[key]) for key in
                                   quotas.NOVA_QUOTA_FIELDS])
        api.nova.tenant_quota_update(IsA(http.HttpRequest),
                                     project.id,
                                     **nova_updated_quota) \
                            .AndRaise(self.exceptions.nova)

        self.mox.ReplayAll()

        # submit form data
        project_data = {"name": project._info["name"],
                         "id": project.id,
                         "description": project._info["description"],
                         "enabled": project.enabled}
        workflow_data.update(project_data)
        workflow_data.update(updated_quota)
        url = reverse('horizon:admin:projects:update',
                      args=[self.tenant.id])
        res = self.client.post(url, workflow_data)

        self.assertNoFormErrors(res)
        self.assertMessageCount(error=1, warning=0)
        self.assertRedirectsNoFollow(res, INDEX_URL)

    @test.create_stubs({api.keystone: ('tenant_get',
                                       'tenant_update',
                                       'get_default_role',
                                       'roles_for_user',
                                       'remove_tenant_user_role',
                                       'add_tenant_user_role',
                                       'user_list',
                                       'role_list'),
                        quotas: ('get_tenant_quota_data',)})
    def test_update_project_member_update_error(self):
        project = self.tenants.first()
        quota = self.quotas.first()
        default_role = self.roles.first()
        users = self.users.list()
        roles = self.roles.list()

        # get/init
        api.keystone.tenant_get(IsA(http.HttpRequest), self.tenant.id,
                                admin=True) \
            .AndReturn(project)
        quotas.get_tenant_quota_data(IsA(http.HttpRequest),
                                     tenant_id=self.tenant.id) \
            .AndReturn(quota)

        api.keystone.get_default_role(IsA(http.HttpRequest)) \
            .AndReturn(default_role)
        api.keystone.user_list(IsA(http.HttpRequest)).AndReturn(users)
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        workflow_data = {}
        for user in users:
            api.keystone.roles_for_user(IsA(http.HttpRequest),
                                        user.id,
                                        self.tenant.id).AndReturn(roles)
        workflow_data["role_1"] = ['1', '3']  # admin role
        workflow_data["role_2"] = ['1', '2', '3']  # member role

        # update some fields
        project._info["name"] = "updated name"
        project._info["description"] = "updated description"
        quota.metadata_items = 444
        quota.volumes = 444

        updated_project = {"name": project._info["name"],
                           "description": project._info["description"],
                           "enabled": project.enabled}
        updated_quota = self._get_quota_info(quota)

        # contribute
        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)

        # handle
        api.keystone.tenant_update(IsA(http.HttpRequest),
                                   project.id,
                                   **updated_project) \
            .AndReturn(project)

        api.keystone.role_list(IsA(http.HttpRequest)).AndReturn(roles)
        api.keystone.user_list(IsA(http.HttpRequest),
                               project=self.tenant.id).AndReturn(users)

        # admin user - try to remove all roles on current project, warning
        api.keystone.roles_for_user(IsA(http.HttpRequest), '1',
                                    self.tenant.id).AndReturn(roles)

        # member user 1 - has role 1, will remove it
        api.keystone.roles_for_user(IsA(http.HttpRequest), '2',
                                    self.tenant.id).AndReturn((roles[1],))

        # member user 3 - has role 2
        api.keystone.roles_for_user(IsA(http.HttpRequest), '3',
                                    self.tenant.id).AndReturn((roles[0],))
        # add role 2
        api.keystone.add_tenant_user_role(IsA(http.HttpRequest),
                                          project=self.tenant.id,
                                          user='3',
                                          role='2')\
            .AndRaise(self.exceptions.keystone)

        self.mox.ReplayAll()

        # submit form data
        project_data = {"name": project._info["name"],
                        "id": project.id,
                        "description": project._info["description"],
                        "enabled": project.enabled}
        workflow_data.update(project_data)
        workflow_data.update(updated_quota)
        url = reverse('horizon:admin:projects:update',
                      args=[self.tenant.id])
        res = self.client.post(url, workflow_data)

        self.assertNoFormErrors(res)
        self.assertMessageCount(error=1, warning=0)
        self.assertRedirectsNoFollow(res, INDEX_URL)

    @test.create_stubs({api.keystone: ('get_default_role', 'tenant_get'),
                        quotas: ('get_tenant_quota_data',)})
    def test_update_project_when_default_role_does_not_exist(self):
        project = self.tenants.first()
        quota = self.quotas.first()

        api.keystone.get_default_role(IsA(http.HttpRequest)) \
            .AndReturn(None)  # Default role doesn't exist
        api.keystone.tenant_get(IsA(http.HttpRequest), self.tenant.id,
                                admin=True) \
            .AndReturn(project)
        quotas.get_tenant_quota_data(IsA(http.HttpRequest),
                                     tenant_id=self.tenant.id) \
            .AndReturn(quota)
        self.mox.ReplayAll()

        url = reverse('horizon:admin:projects:update',
                      args=[self.tenant.id])

        try:
            # Avoid the log message in the test output when the workflow's
            # step action cannot be instantiated
            logging.disable(logging.ERROR)
            with self.assertRaises(exceptions.NotFound):
                res = self.client.get(url)
        finally:
            logging.disable(logging.NOTSET)


The search for a true periodontal cure is ongoing, but in the meantime, here are some things you need to watch out for, in order to keep your teeth for life.
Periodontal disease is the leading cause of tooth loss all over the world. Find out what you can do to stop this menacing threat to your teeth.


Here is a continuation of my last post, Part 1, on the incredible skills kids and parents learn while traveling.
This is a biggie! Effective communication skills are essential for success in all areas of life. While traveling, kids meet new people everyday, hear new languages, dialects, and accents, and learn ways to communicate using only gestures and smiles. Kids and adults in other countries love to practice their English and teach words in their language. Acquiring foreign language skills is a huge confidence builder for kids!
Kids and teens love to talk, but often struggle with listening well. This skill is so important for life-long success and traveling is a great way to practice it! Hearing new accents and having to decipher and process what they hear on a regular basis, kids learn how to listen carefully to what others are saying – no "tuning out" allowed! Locals in other countries LOVE to chat and ask all sorts of questions, often with heavy accents, and kids learn how to listen and pick up enough bits and pieces to understand the gist of the question and answer back. Last but not least, kids learn how important eye contact, nods of understanding, and smiles are to listening well in any conversation – especially ones with language barriers.
Kids can learn all types of negotiation skills while traveling – as long as their parents know how to do it effectively! Discussing taxi fares with crafty taxi drivers, haggling at outdoor markets where prices can be inflated dramatically, working out details with tour guides who change the itinerary without notice, and even figuring out who gets the window seat on the airplane are all ways kids can learn how to negotiate well. The key is to have them do some of the negotiating themselves, like buying souvenirs at the local market where haggling is essential, and have them feel the satisfaction of getting what they want for a fair price.
Leaving their comfort zones behind, kids are thrown into new, uncharted territory where they must find the courage to explore new places, talk to locals, speak in foreign languages, try new foods, take all types of transportation, and experience new and often shockingly different ways of living. By traveling and exploring like locals, kids will have so many new adventures that will give them courage to continue trying new things and will boost their confidence when they return home. They will remember all the new experiences they had and how they overcame their fears and hesitations and these memories will encourage them in the future.
Remember, parents, these skills will only be learned while traveling if kids are encouraged to do these things ON THEIR OWN. Although we often feel like they need our help, have them do things all by themselves. The confidence and happiness in their faces after they have overcome their fears and accomplished it by themselves is priceless!
What life skills have your kids learned while traveling? Please share with us!


text:
Q: Replacing more than n consecutive values in Pandas DataFrame column Supposing I have the following DataFrame df
df = pd.DataFrame({"a" : [1,2,2,2,2,2,2,2,2,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5], "b" : [3,3,3,3,3,3,3,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,7,7], "c" : [4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,1,2,2,2,2,2,2,2,2,3,3]})

And I wish to replace number 4's which repeat more than 10 times in a row, in any column (there could be hundreds of columns), with 10 4's and the remainder 5's.
So for example, 12 consecutive 4's would be replaced with ten 4's and two 5's.
How would I achieve this with Pandas?
I'd like to apply a lambda, but I don't know how to look back enough rows, and it would have to start from the end and move through forward, or it would break the sequence of values. Each lookup would have to look at the preceding 10 rows to see if they are all equal to 4, and if so, set the current value to 5.
No idea how to go about it though!

A: You can use:
#column a is changed for 2 groups of 4
df = pd.DataFrame({
"a" : [4,4,4,4,4,4,4,4,4,4,4,4,4,4,7,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5],
"b" : [3,3,3,3,3,3,3,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,7,7],
"c" : [4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,1,2,2,2,2,2,2,2,2,3,3]})

Solution counts consecutives 4 with reset if NaN created by where and then apply boolean mask to original df for replace 4 to 5 by mask:
a = df == 4
mask = a.cumsum()-a.cumsum().where(~a).ffill().fillna(0) > 10
df1 = df.mask(mask, 5)

print (df1)
    a  b  c
0   4  3  4
1   4  3  4
2   4  3  4
3   4  3  4
4   4  3  4
5   4  3  4
6   4  3  4
7   4  4  4
8   4  4  4
9   4  4  4
10  5  4  5
11  5  5  5
12  5  5  5
13  5  5  5
14  7  5  5
15  4  5  5
16  4  5  5
17  4  5  5
18  4  5  5
19  4  5  5
20  4  5  5
21  4  5  1
22  4  5  2
23  4  5  2
24  4  5  2
25  5  5  2
26  5  5  2
27  5  5  2
28  5  6  2
29  5  6  2
30  5  7  3
31  5  7  3

For better checking values is possible use concat:
print (pd.concat([df, df1], axis=1, keys=['orig','new']))
   orig       new
      a  b  c   a  b  c
0     4  3  4   4  3  4
1     4  3  4   4  3  4
2     4  3  4   4  3  4
3     4  3  4   4  3  4
4     4  3  4   4  3  4
5     4  3  4   4  3  4
6     4  3  4   4  3  4
7     4  4  4   4  4  4
8     4  4  4   4  4  4
9     4  4  4   4  4  4
10    4  4  4   5  4  5
11    4  5  4   5  5  5
12    4  5  4   5  5  5
13    4  5  4   5  5  5
14    7  5  4   7  5  5
15    4  5  4   4  5  5
16    4  5  4   4  5  5
17    4  5  4   4  5  5
18    4  5  5   4  5  5
19    4  5  5   4  5  5
20    4  5  5   4  5  5
21    4  5  1   4  5  1
22    4  5  2   4  5  2
23    4  5  2   4  5  2
24    4  5  2   4  5  2
25    4  5  2   5  5  2
26    4  5  2   5  5  2
27    4  5  2   5  5  2
28    4  6  2   5  6  2
29    5  6  2   5  6  2
30    5  7  3   5  7  3
31    5  7  3   5  7  3

A: Remove all the 4s, fillna back with 4s using limit=10 as argument, and remove the remaining NA with 5s. I find this method more explicit and reflecting more your intention:
df[df!=4].fillna(4, limit=10).fillna(5)

If needed cast the df back to integers with astype(int) at the end, as the intrusion of NAs will cast the dataframe into floats.

A: This should do the trick:
import pandas as pd

df = pd.DataFrame({"a" : [1,2,2,2,2,2,2,2,2,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5], "b" : [3,3,3,3,3,3,3,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,7,7], "c" : [4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,1,2,2,2,2,2,2,2,2,3,3]})

def replacer(l,target_val=4,replace_val=5,repeat_max=10):
    counter = 0
    new_l = []
    for e in l:
        if e == target_val: counter += 1
        else:
            counter = 0

        if counter > repeat_max:
            new_l.append(replace_val)
        else:
            new_l.append(e)

    return new_l

df1 = df.apply(replacer)

Output:
    a  b  c
0   1  3  4
1   2  3  4
2   2  3  4
3   2  3  4
4   2  3  4
5   2  3  4
6   2  3  4
7   2  4  4
8   2  4  4
9   3  4  4
10  3  4  5
11  4  5  5
12  4  5  5
13  4  5  5
14  4  5  5
15  4  5  5
16  4  5  5
17  4  5  5
18  4  5  5
19  4  5  5
20  4  5  5
21  5  5  1
22  5  5  2
23  5  5  2
24  5  5  2
25  5  5  2
26  5  5  2
27  5  5  2
28  5  6  2
29  5  6  2
30  5  7  3
31  5  7  3

redpajama_set_name: RedPajamaStackExchange


Are you looking for something fun and creative to do with your friends? How about one of our Girls Day Out Classes?
Come create an accessory for your home with members of our design staff! You choose what you'd like to do, even the materials! We'll teach you how to put it all together to create a decorative piece you'll love!
Classes are free, you just pay for the materials you use! Classes are available Tuesday – Friday, morning and afternoon.
We've created three different succulent designs for you to enjoy and brighten a spot in your home or office. Baseline material fees begin at $20, but can increase depending on your design and material choice!
Give us a call at 1-630-232-7885 to schedule a fun day out with your friends!
Bring your own basket, or purchase one of ours to create this succulent piece.
Previous ArticleHoliday Decorating Reservations Taken Now!
Next ArticleHoliday Decorating Reservations Now Being Taken!!
Save 25% on All Christmas!


text:
Marriage equality in the US and lessons for India
by Robert Barker
in Opinions, Random, TFIUvaach
Probably the biggest news to come out of the US the past few days, has been the landmark judgement by the US Superme Court which effectively legalises homosexual marriages throughout the country. The reaction on social media was overwhelmingly positive, though the naysayers also had a sizable representation. The protracted process of achieving marriage equality in the US is rather insightful for other countries, especially India, which quite honestly has for far too long not addressed the concerns of the LGBT community in any realistic and tangible way. That being said, the reaction by Indians on social media has been mixed at best. While the usual bigotry is once again quite visible (which is absolutely unacceptable and is not worthy of further discussion), there has also been an overwhelming trend to change ones display picture to rainbow colors and show ones solidarity towards the LGBT community. It is the latter scenario which is somewhat perplexing to this author. Whilst a lot of these people are indeed well-meaning, the pervasiveness of arm-chair Facebook activists, America idolaters, and wannabe 'cool' people among this 'rainbow' crowd is making it rather hard to separate the grain from the chaff, and is quite honestly not leading to any meaningful discussion on this important issue. If one seriously wants to achieve the same level of inclusion for LGBT people in India, one needs to first improve the quality of public debate and not just degenerate into mere token online activism. This article is an attempt to understand what Indians, particularly the vocal ones can learn from the US judgement, and how they can make India a more inclusive place.
The US is most certainly not the first to achieve marriage equality (a few weeks earlier, Ireland legalised gay marriage in a much-praised referendum where over 60% of the people throughout the country voted Yes, and only one constituency voted No), but the economic, cultural, and political importance of the US makes it by far the biggest country to do so, and has undeniably placed LGBT issues on a unified global platform for the first time. Additionally, for this particular discussion, the similarities between the US and India (large population, multiculturalism, importance of religion in polity, relatively high levels of income equality) makes it a better base of comparison than say countries in Nordic Europe. It might come as a surprise to many of the online activist crowd that the decision to legalise gay marriage in the US has not happened overnight. Indeed, the shrillness that is permeating Indian social media with respect to this issue completely fails to take into account the long-winding, transformative process that the US underwent to achieve this landmark judgment. Marriage at the end of the day, religion aside, is a societal construct, and fundamental alterations to such a construct requires, like it or not, large-scale support. According to Gallup polls, it wasn't until 2011 that most Americans even supported gay marriage, a clean 8 years after homosexuality was decriminalised in all states, and it was only in 2009 that the first state allowed gay marriage. Since then though, until the Obergefell judgement, roughly 70% of the population of the US already lived in states which legally recognized same-sex marriages, and thus it was only a matter of time that a federal ruling would pass a law that would be binding in all 50 states. If one wishes to achieve the same goal of same-sex marriage in India, one has to first create a culture and society that is accepting of gays and lesbians and accords them the same respect and dignity that heterosexual people are entitled to. Legal considerations aside, truthfully speaking, Indian society as a whole is no where close to such levels of tolerance. Societal reformation requires a continuous process with incremental change. There are three steps that India has to go through (none of which it has yet) to ensure that this issue reaches a logical conclusion:
Remove section 377, effectively decriminalising homosexuality.
Create a society that is accepting of openly gay people. Keep a check on the view of the nation with regards to marriage equality via polls which use unbiased, and statistically significant samples that factor in socioeconomic realities of India.
Legalise gay marriage with multi-partisan support via a constitutional amendment.
Point 1 is an absolute no-brainer. By its definition, section 377 is fundamentally discriminatory towards people participating in a consensual act behind closed doors, and is against any personal liberties and privacy rights that citizens are entitled to. The fact that such a draconian law is still around is the first clear indication that the ostensibly overwhelming Indian support seen for LGBT issues in the last few days does not seem to rally when it comes to actual reformation of the laws in India.
Point 2 is the difficult one, and is unfortunately a decadal process, probably even a generational one. Trolling Karan Johar unnecessarily, and making a stereotypical comedy like Dostana a box office success is the second indication that Indian society is quite a long way away from accepting homosexuals. On a related note, it is high time India gets its own version of Gallup which can measure the pulse of the nation in a sensible way with regards to social issues, that would enable lawmakers to make relatively informed decisions than now. If the first two points are fulfilled, point 3 will be a natural consequence and not just a daunting goal as it seems now.
This particular issue has also raised another aspect of the nature of online discourse among Indians. Bigots, and the fad bandwagon aside, there have also been a considerable amount of over-zealous online activists who see any development in any part of the world as an indication of the ineptness of the Indian Government (irrespective of the governing party). Cartoons such as these, for example, while definitely well-intentioned, end up mixing legal precedence and societal acceptance, and only adds to the cacophony without contributing to the discussion in any meaningful way. With respect to this particular cartoon, it is worth pointing out that there is absolutely no Indian law that prevents two heterosexual adults of different castes and religions from marrying. Whether that marriage sees societal acceptance is a completely different matter, and is a subject of another debate (this author for one believes that no marriage between two consenting adults is wrong). Looking at it from another angle, legalisation of gay marriage in the US does not imply that there will be 100% societal acceptance, particularly in the more conservative states, and it will take much more efforts to change mindsets than change laws. This is easier said than done, and one must maintain a constant pace as we (India/US/any other country) work towards creating a more accepting society for all peoples, irrespective of their sexual orientation, and/or any other arbitrary classification.
Tags: equalitygaylesbianLGBTmarriagesocial media
Nanak, the whole world is in distress. He, who believes in the Name, becomes victorious
Rajiv Gandhi - The man who started everything in India
Robert Barker
Liberal-conservative, Indian, Anglophile, movie buff, beer afficionado. Not one for grandiose ideas, I believe the biggest change is that which happens within.

redpajama_set_name: RedPajamaCommonCrawl


On the Buzz tonight, we talk with several of our regular correspondents about their expectations for new trends and technology in production and post at the 2019 NAB Show.
Join host Larry Jordan as he talks with Michael Horton, Ned Soltz, Philip Hodgetts, Michael Kammes and James DeRuvo.
Mike Horton returns with news of his newest event at NAB: "Faster Together." Co-produced with LumaForge, Mike explains what happened to the SuperMeet, why he created "Faster Together" and who will be appearing at it.
Ned Soltz, contributing editor for Red Shark News, shares his thoughts on new trends and technology for production that he expects to hear more about next week at the 2019 NAB Show.
Philip Hodgetts, CEO of Lumberjack System, shares his thoughts on new trends and technology that he expects to hear more about next week at the 2019 NAB Show.


"Jesus answered and said unto him, Verily, verily, I say unto you, Except one be born anew, he cannot see the kingdom of God... Marvel not that I said unto you, You must be born anew" (John 3:3,7).
"For God so loved the world, that He gave His only begotten Son, that whosoever believes on Him should not perish, but have eternal life... He that believes on Him is not judged; he that believes not has been judged already, because he has not believed on the name of the only begotten Son of God" (John 3:16,18).
"You must be born again" (or anew).
There are three reasons for speaking on that word to you. One, for the sake of anyone who needs to know what it is to be born anew or again; two, for the sake of those who do know what it is but who need continually to be reminded and to keep before them what the difference is between those who are born anew and those who are not; and three, because you are constantly moving amongst those who know nothing about it and are from time to time called upon to state or explain or testify to the difference that being born anew makes.
We are very often in the position which might, if we allowed it, bring us into some weakness on this matter. For instance, we meet many very nice and outwardly good people who are certainly not born again people and they compare very favourably outwardly with many whom we know who claim to be born again people. Sometimes the born again people do not compare very favourably with many who are not born again and such a fact may weaken our position and raise questions in our minds and destroy the definiteness of our testimony, our confession.
Then sometimes, especially for younger people, the challenge as to what difference it really does make to be a Christian finds them unable to give a very direct and concrete answer. We find that we are led all round the globe in an attempt to explain things. It is not very often that you find a person, especially a young Christian, able to state precisely and concisely what it means to be a Christian or what it means to be born again. Now these are reasons for speaking to you on this matter -- "You must be born again." I am going to be just as simple and as plain as I can and approach the subject along the line of three questions.
Firstly, what is it to be born again? While that is a very big wide question which can be answered with a very great deal of material, we will confine it to one simple answer, for being born is, after all, a matter of blood, and you can gather a very great deal of the mystery which seems to surround the Bible teaching about blood into this one fact, that you cannot interchange blood with any vivifying, life-giving, health-giving value or prospect. You cannot change the blood of different species, that is, transfer the blood of one species to another. If you do, you not only reach deadlock, you do damage. You cannot pass animal blood into the human system with any real value -- there is no such thing as a transfusion from a beast to a man. You never get anywhere by that means; it is to no purpose at all but rather does damage. Every species has its own blood and that blood is locked up to that species and must not be transferred to any other species. The blood in the Bible, as we know, is representative of the life and when it is said that in Jesus Christ, or through faith in Him, we will receive eternal life, that is only the effect of the symbolic language and sacrament of drinking His Blood. "Whoso drinks My blood has eternal life" (John 6:54), and that means that we are receiving the life of -- may I use the word about the Lord Jesus? -- a particular species. There is no species in existence in this universe like the Lord Jesus; He is a unique order of creation, an exclusive order of creation. He represents something which is not to be found anywhere else and being born anew is receiving the life of another order of creation of which He is the first and representative.
What is it then, to be born anew or again? It is to receive another and altogether other life, and the deep fact, truth, reality about a true born again child of God and about all such, is not in what they are naturally, outwardly. It is that, right deep down at the centre of their being there has been imparted something which is altogether different from what they are in themselves and altogether different from what all other people are. However good they may be naturally, the difference is there. You and I know quite well that in ourselves the difference is not complete and manifest, but we know that there is a fundamental difference, that there is that which makes the difference and it is a difference which is not in any way forced or strained but it is as natural as anything can be to this new creation. We know that something has happened in us that has made the difference between us and others and that basic fact is constantly making itself known in us. It is like a new kind of intelligence, a new kind of consciousness and conscience which is all the time discriminating, pointing out the differences, constraining or restraining something there that has happened. There is the difference and it is this other life of another order which is the order of God's Son which has made the difference, and to be born anew is that.
The difficulty with many Christians, not only with young Christians, but many others is that, under severe strain, pressure and trial and when this natural life is being provoked or strained for some reason or other; perhaps by physical disorders and infirmities and weaknesses, perhaps by pressure from without. Under given conditions the natural life seems to be so strong still on the wrong side, on the evil side, and the old things of that natural life make themselves felt and assert themselves. Then we are tempted by the enemy to ask the question, Well, after all, what difference does it make to be a child of God? Is there anything really in this matter of being a new creation, of being born again? What is the difference?
The answer is deeper down, much deeper down, than our own natures. What we are naturally in ourselves remains, but there is a new creation. It is very important to get your emphasis upon the right word. When the apostle writes, "If any man be in Christ" (and our Authorized Version has failed us here when it says, "he is a new creature" or "a new creation"). The Revised helps us, but even then it does not underline the important word. It says, "If any man is in Christ, there is a new creation" (2 Cor. 5:17). You want to put under the word 'there' a thick black line. Where? There, in Christ; there is a new creation in Christ; and it is just there in Christ, where we are in Christ, what we are in Christ, when we are in Christ, not when we are in ourselves, but when we are in Christ. It is there that there is a new creation. It is what is in Christ that is the new creation.
We will not stay with that further, but I want you to realize that there is a difference and that difference we know. It is that difference which has become evermore real to us as the mark of our spiritual growth, the difference between what Christ is and what we are and what man is as a whole by nature, the difference, because we have received (to use the symbolic word) a new blood, a different blood, or, to use the proper word, the actual word: another life, a different life. What is it to be born again? It is that.
Why must we be born again? Why was the Lord Jesus so emphatic? Note this double imperative -- Verily, verily; truly, truly, I say unto you... Why? Well, the answer, I think, is found in the complete statement. "Except a man be born anew, he cannot see the kingdom of God." Now, there is no reference to the Kingdom of God in the context, therefore one of two things must be taken account of. One, that Nicodemus and the people whom he represented needed no explanation as to the fact of the Kingdom of God. That is, it was no mystery, it could be taken for granted that they knew about the Kingdom of God. Nicodemus knew something about the Kingdom of God. It was not introducing a strange subject so far as he was concerned. But, whether the Kingdom of God is a new idea or not, the point is this -- the Lord Jesus assumes without any explanations at all, without stopping and saying, Now look here, there is such a thing as the Kingdom of God and the Kingdom of God is so-and-so -- giving a long explanation of the Kingdom of God. No, He assumes that the Kingdom of God is the thing which matters, is the thing which counts, is the ultimate and the supreme thing, and His attitude is simply this -- Look here, Nicodemus, ultimately, eventually, pre-eminently, the Kingdom of God is the thing in view; the time is coming when there will be no other kingdom but the Kingdom of God. All other kingdoms will have been met, judged, destroyed, blotted out, and this universe will be the Kingdom of God! So the thing that matters is whether we are going to be in or out. There will not be an alternative to the Kingdom of God. We will either be in the Kingdom of God or we will be out: "...should not perish, but have eternal life". Perish means to go out of what God is going to bring about, to be outside of what God is going to institute, to miss it, to be out of it, to have lost it, to be judged unworthy of it.
The thing which matters, then, is the Kingdom of God, for it will be that which will be all pervading and all-inclusive at last. That is why we must be born anew, because to get into that Kingdom is no mechanical matter. It is a matter of birth, it is a matter of nature. That Kingdom will be constituted by a God-nature, the nature of God imparted to all His subjects and all the citizens of that Kingdom. It will be a matter of constitution. The difference is to perish being outside, and to have eternal life being inside, and you only get this life through birth.
So then, if the Kingdom is the thing which eventually and ultimately matters, then that is why we must be born anew, and there is no getting into the thing which matters other than by new birth, that is all. So you simply say, when you are challenged -- What does it mean to be born anew, to be a Christian? It means to have received another life more inward and deeper down than the life of nature and which is gaining ground, steadily gaining ground and making differences, and that is why I do not do certain things that you do. It is not that I have decided that I shall not do these things, that I have drawn up a list of things which I should do and should not do, can do or cannot do, ought to do and ought not to do. It is simply that there has taken place in me something which has made these differences and I am following the law of another life which is at work within, and it is no merely legalistic thing at all. That is the difference, that is what it means to be born again and why we must be born again. In the end there is only going to be one Kingdom, the Kingdom of God, and you get into that Kingdom by being born anew. You are either going to be out or in and if you are going to be in, you must be born anew.
Then how are we born again? What do we have to do to be born again? Well, in the first place, it is by acknowledging the fact of our sinful nature. No, it is not an acknowledging that we have done some wrong things, that we have committed sins -- that is not good enough. A lot of people think that if you are going to become a Christian, it is a matter of confessing that you have done this, or that, or the other which is not right, and asking God to forgive and saying you will not do it again. That is not it. It is not sins but sin, it is not what we do or do not do, it is what we are. And no one ever gets through with God by acknowledging a certain number of sins even though they might make a mountain of them that is a countless number that they would confess. That is not the way through with God, because God knows a great deal more than we can count about ourselves. What He calls for is acknowledgment of the fact of a sinful nature, what we are in ourselves, and then, in the light of that, the acknowledgment of Christ as God's Son.
There is a very important matter bound up with that. You expected me to say, the acknowledgment of Christ as Saviour, and I did not say it; the acknowledgment of Christ as God's Son. You look at the New Testament; that is what men have to acknowledge from Pentecost onward, that Jesus is the Son of God. Why? Son implies something, it implies a father and it implies a begotten one, and that brings you immediately into touch with this very fact of the begetting of a family relationship, of getting into a family. The door into that family is the Lord Jesus, the Firstborn. He is the way in and so you have got to acknowledge Him, not as a great prophet, a great teacher, a good man, the best that ever lived, but you have got to acknowledge that unique relationship, that we are not all the children of God in that same way by nature. There is no such thing, in the essential sense, as the universal Fatherhood of God and brotherhood of man. That is all nonsense and rubbish, it does not get you anywhere. This Fatherhood is a peculiar Fatherhood, this sonship of Jesus Christ is unique sonship, and this is an inclusive family relationship and there is only one way and that is through Him in that position as Son.
Oh, Satan knows quite well all about that. Probably there is nothing through history that Satan has laid himself out to do more thoroughly than to deny that essential sonship of Jesus Christ. The one thing at which he has aimed his blows and all his cunning, skillful attention through the ages has been at the sonship of Jesus Christ in its utterness, in its exclusiveness, in its uniqueness. All the false doctrines of history have had that somewhere lurking in them. So the acknowledgment of Jesus as God's Son for our salvation is the way of new birth.
And then a definite act of committal and acceptance by faith. I am not one who commits so many sins or sins of this kind or that, but I am a sinner by nature. Jesus Christ is God's Son of another order. I, by a definite act of committal and acceptance, take a faith relationship with Christ to bring me into that family which is another, altogether other kind of family!
Now, can you grasp that? What is it to be born again? Will you answer that simply? Why must we be born again? How are we born again? Well, if anyone here does not know what it means to be born again, that is it very briefly. You know the way now. If any of you have had difficulties over this matter of the difference between very nice, good people who make no profession at all of Christianity and Christians whom you feel let down the whole thing, or because of what you still find in yourself. You wonder, 'Does it make so much difference after all, what really is the difference; it does not seem to me that those who are Christians even come up to the level of many who are not! What is the difference, what does it mean?' There is an answer and a very real answer. I have not given all the facts, but there is a real answer. And why? Well, there is no reason for anything more imperative than that we should be born again because the Kingdom of God is the thing that is going to govern everything. Whether we are in the Kingdom of God or not is the most important matter that ever anybody could have to face.
Well then, if it is true, and if I am persuaded or anyone is persuaded that it is something to consider seriously, what about it, how is it done, what is the way? Can you give that answer? Have you all come that way? May the Lord just use this very simple word for our confirmation, clarifying and new joy.


Winners will be judjed and voted. There are different prizes for the expert and the crowd vote winner. And, both winning images will be printed in Digital Camera magazine, one of the leadings photography publication. You can read more details for the contest and prizes here.
I participate in this contest with two photos. The first one is a macro shot of yellow moss on a fence that I captured in a cloudy winter day.
And, the second photo is a close-up of a meadow brown butterfly on a beautiful giant daisy that I photographed in a blooming garden during summer.
Hope you find this contest interesting and -why not?- you participate and vote, too!
and an easy-going week ☼ !!!


Google Yesterday i.e 10-june-2010 started rolling out its new GOOGLE Search home page interface options to its users. Users can change the background image of the google home page to any custom image similar to Bing search which provides a transitional images . To change the background of the Google home page user had to be logged in to his/her google account. Then at the bottom right of the screen there will be a link "Change background image" which enables user to choose the background image.


Discussion in 'Questions (Windows Mobile)' started by Ianmac, Feb 6, 2008.
I have a series of programs running via a selection program. Everything works fine on the device when not optimised but when optimised they all experience the same problem, the layout behaves as if the screen dimension is twice the size in both directions and squashes everything up into the top left hand corner.
I am using V6.05 and have the full Net Framework update & service pack as linked via the web site as of 4th Feb 08. and it has been uploaded and installed on the device.
I have the original version of BinaryFile.dll in the same folder.
Optimized applications are .Net CF 2.0 applications while nonoptimized applications are .Net CF 1.0 applications.
.Net CF 1.0 treats VGA screens (hi-res) like QVGA screens (low-res).
.Net CF 2.0 doesn't "reduce" the resolution of VGA screens.
You can change the desktop screen size in the designer to 640 * 480 to match a VGA screen.
This thread and that tutorial solve completely what I was just about to ask about.


Late evening transfer to rail-station for Jaisalmer night train. Night on board.
Afternoon we visit the City Palace, a perfect blend of Rajasthani & Mughal architecture. The center of the palace is a seven-storied building called Chandra Palace, with fine views over the gardens & the city. Further we visit Jantar Mantar, the Solar Observatory, an astronomical treasurehouse, with solar devices that give accurate predictions till date. We now visit Hawa Mahal (Palace of Winds), a five-storied structure of pink sandstone. It was built in the year 1799 so that veiled royal women could peer down the busy street market unseen by the world through its 593 stone Jharokas (mini windows).
Today in the morning we visit Agra Fort, taken over from the Lodhis by the Mughal Emperor Akbar in the late 16th century. The Fort can be more accurately described as a walled palatial city. It was built from red sandstone, often inlaid with white marble & intricate decorations. We will alsovisit Sikandara, Akbar's tomb. His son Jahangir completed the construction of the tomb in the year 1613.
A/C chair car train fare for the sector Jaipur - Agra - Delhi.
2 A/C train ticket for the sector Delhi - Jodhpur - Jaisalmer - Jodhpur.
2 A/C train ticket for the sector Udaipur - Jaipur.


text:
CBRE Announces the $11 Million REO Sale of 535 Connecticut Avenue
Betsy Kraat | Jan 16, 2012
NORWALK, CT—Jeffrey Dunne, Steven Bardsley and David Gavin of CBRE's New York Institutional Group represented LBUBS 2002-C4 Connecticut Avenue LLC in the sale of 535 Connecticut Avenue, Norwalk, Conn., for $11 million. The team was also responsible for procuring the buyer, 535 Connecticut Avenue, LLC, an entity controlled by a joint venture between KABR Real Estate and Blackpoint Partners. The transaction marks the first acquisition by KABR/Blackpoint in Fairfield County.
35 Connecticut Avenue is a 43 percent leased 174,581-sq.-ft. office building located directly on Route 1 (Connecticut Avenue) between Exits 13 and 14 of Interstate 95. The property has water views of Long Island Sound from the upper floors, which comprise a significant portion of the vacancy in the building.
The property was extensively renovated in 2007 through 2009, including a new lobby, cafeteria and state-of-the-art fitness center.


text:
Q: JavaScript access class variable in class function class BlogPost extends Component{
static useStyles = makeStyles({
    grid_container: {
      marginTop:'10px',
      flex:1,
      justifyContent:'center',
      alignItems:'center'
    },
  });

render() {
    return(
      <Card elevation={5} >
      <Grid container spacing={0} className={useStyles.grid_container}> /* MY QUESTION IS HERE */

      </Grid>
      </Card>
    );
   }

}

Maybe someone knows how to access 'useStyles' in function 'render()'? Maybe static variable isn't good choice.

A: makeStyles, returns a hook, that is intended to be used with functional component and not class components. So either you can convert your BlogPost to a functional component like
const useStyles = makeStyles({
    grid_container: {
      marginTop:'10px',
      flex:1,
      justifyContent:'center',
      alignItems:'center'
    },
  });
const BlogPost = () =>{
    const styles = useStyles():
    return(
      <Card elevation={5} >
      <Grid container spacing={0} className={styles.grid_container}>

      </Grid>
      </Card>
    );

}

or make use of withStyles HOC
const styles = {
    grid_container: {
      marginTop:'10px',
      flex:1,
      justifyContent:'center',
      alignItems:'center'
    },
  };

class BlogPost extends Component{

    render() {
        const { classes } = this.props;
        return(
          <Card elevation={5} >
          <Grid container spacing={0} className={classes.grid_container}>

          </Grid>
          </Card>
        );
       }

}

export default withStyles(styles)(BlogPost);

Please visit the Material-UI docs for more details

A: Answered
const useStyles = makeStyles({
    grid_container: {
      marginTop:'10px',
      flex:1,
      justifyContent:'center',
      alignItems:'center'
    },
  });
const BlogPost = () =>{
    const styles = useStyles():
    return(
      <Card elevation={5} >
      <Grid container spacing={0} className={styles.grid_container}>

      </Grid>
      </Card>
    );

}