Wednesday, October 28, 2020

Powering My Own Home

Have you ever looked at the electricity bill every month and wished that it would just disappear? Oh! How much easier the monthly budget would be to balance without that great big financial lump around your neck!

Well, last February I was chatting with a salesman from a local solar power company, mainly because a friend is literally building his own system, and I realised that with a little extra outlay I could have my own installed for me. So we did it!

So we arranged a deal with one of the local credit unions to loan me the money to buy the hardware and get it all installed, and the installers negotiated with Tacoma Power (the electricity provider) so that they would install a "net" meter (instead of a "one-way" meter that just measures what you're consuming), so that they could treat me as a supplier or a consumer. The installers arrived one rainy March day (poor guys !) and did the whole thing in about 5 hours - installed a framework onto the roof, installed the wiring for the panels down to the metering, and installed the panels themselves - all 32 of them (14 here and 18 on the other side - 32 in all)



So, the roof is producing (during the summer months) far more than I consume, so during the day I produce power and that's accepted by the Tacoma Power system and used to help supply other people on the electricity grid. During the night the roof is producing nothing, so I consume directly off the grid, just like everyone else. I could, I suppose, install a set of batteries to charge during the day and supply me during the night, but, aside from being costly, there's already no room in the basement !!
Today (2020.10.11) is a very rainy day, and my roof isn't seeing enough photons to be worth waking up for! So we're consuming as before, directly off the grid. Overall we were consuming between 600 kWhr and 800 kWhr ("kiloWatt-hours") every two-month billing period. That's dropped considerable over the last few months, but will go back up over the winter. However, Here in Tacoma the one major utility company supplies drinking water and electricity and also handles sewerage and run-off water, so from now on whatever I produce is set againat the aggregation of all these bills, so it isn't all that easy to see just what the benefit is without comparing things back to last year, but I have to say that things definitely are less expensive !

TTFN

Friday, May 15, 2020

Chicken and Apples

Although you do get Chicken and Apple sausages in CostCo, among other places, it's a fairly unusual combination in America. There is a variety of ways of making it - this is just one that I tried this evening. It came out very well.
Here, for this recipe, I chopped three chicken breasts into medium sized pieces - I admit that it might have been better to have made the pieces smaller. Next time I'll try that and update things here.

Ingredients
Hasselblad Potatoes Two per person
Apples One medium per person
Chicken Breasts One per person
Rosemary Quite a bit!

Method
Preparation
Potatoes Before
  1. Cut the chicken into squares of a bit less than two inches.
  2. Put into a bowl with some olive oil and a good amount of Rosemary.
  3. Leave standing for at least 15 minutes while other things are prepared.
  4. Cut the apple into eighths and then half these width-wise. 
  5. If you're going to use celery too then chop this up and rince it well.



Potatoes
  1. Turn your oven on to 425F.
  2. Peel the potatoes and make sure that one side is good and flat so that the potato will not roll.
  3. Cut each potato with a series of vertical slices about 4 mm apart. The slices should go about 80% through the potato from top to almost the bottom.
  4. Place the potatoes onto a baking tray, brush them with olive oil, and douse when with some Rosemary.
  5. Cook at 425F for 30 minutes. Take out, spread gently with some butter, and replace back into the oven for another 30 minutes
Chicken
  1. About 10 minutes in to the potatoes second spell in the oven, heat some olive oil in a large pan and set some chopped onions to cook until translucent. 
  2. Peel the apples, section and core, and then chop up - probably eighths of an apple are a good size, unless you're dealing with very large or small ones.
  3. With Added Celery
  4. Add the apples to the oil and onions and, after a minute or two, add  the chicken pieces. 
  5. Chicken and Apple Cooking
    Chicken almost done

  6. Cook this mixture until the chicken pieces are well cooked through.
  7. I felt that some extra vegetables would be good, so chopped up 5 stalks of celery fairly finely and added them at the last moment. They got warm but not soft, which is unusual for celery.
  8. Take the potatoes out of the oven and brush them with some more butter.
  9. Plate the meal and present. You should get some satisfying ooohs and aaaahs !!


Bon Appetit ! 
TTFN

Monday, May 11, 2020

Shrimp and Rice

This is a pretty easy thing to make and fills you up well. On top of the basic Shrimp and Rice (and herbs and spices) I like to add some veggies. You can choose the vegetables you add to it from a wide selection. My personal choice is frozen sweet corn.
Cooking Shrimp

Ingredients:


1 cupRice
6 tbspButter
4 clovesMinced Garlic
1 lbShrimp, shelled and deveined 
1/4 cupParmesan Cheese
3 tbspMilk
2 tbspChopped Parsley
To TasteSalt and Pepper
GarnishParmesan Cheese
1/2 lbFrozen Corn Kernels

Method

Cooking Shrimp
  1. Prepare the rice. In my little rice cooker it will usually take about half an hour, so start it about 20 minutes before the rest.
  2. In a large skillet, melt butter over medium-heat.
  3. Add garlic and cook for 3 minutes, or until lightly browned, stirring very frequently. Do not let the garlic burn !
  4. Stir in the shrimp and cook for 2 minutes, or until they turn pink, stirring frequently.
  5. Add cooked rice to the skillet and mix until well combined.
  6. Add cheese, milk, parsley, corn, salt and pepper; mix and stir for 1 to 2 minutes, or until creamy and heated through.
  7. Remove from heat.
  8. Garnish with parmesan cheese.
  9. Serve.
    Ready to serve

Wednesday, March 18, 2020

A CDC Example


The idea of CDC is to capture the changes undergone by the data in a table in order to make use of those changes elsewhere. Very often this is to update a data warehouse with just the changes rather than completely refreshing it. This post is designed to lead you through a simple example so that you get a good feel of how to create and use CDC.
A word of warning before we start off - this is going to be a long one!

Create Your Environment


For this example we start by creating a new database and a new table.

1.     Create the database

create database NWM

2.     Make sure that the SQL Server Agent is running for the database instance

3.     Enable CDC for that new database

exec sys.sp_cdc_enable_db

4.     Check results

select name, is_cdc_enabled from sys.databases

5.     You will get a list of databases and an is_cdc_enabled

      flag. In the example shown the NWM database is enabled.


6.     Next, create a table to set up for CDC. The table must have a primary key. For convenience here we make it an identity field.
    create table nwm_cdc
( id int identity(1,1),
  field_1 varchar(32),
  field_2 varchar(32),
constraint [PK_nwm_cdc] primary key clustered ([id] asc) on [PRIMARY]
 )

7.     Add some data to the table:
    insert into nwm_cdc
    select 'one', 'ein'

8.     Check the list of CDC-enabled tables in the database. You will find that you are returned an empty dataset.
    select * from cdc.change_tables



Set up CDC for your table

In this section you prepare the data table where changes will cause CDC activity.

1.     Set up CDC for the table by running this system procedure:

exec sys.sp_cdc_enable_table  
      @source_schema = N'dbo',             --schema of table with data
      @source_name = N'nwm_cdc',           --name of table with data
      @role_name = null,                   --role of table owner (optional)
      @captured_column_list = N'id, Field_2',--Fields to capture when changed
      @capture_instance = null,            --Name of the CDC “capture instance”
      @filegroup_name = N'PRIMARY',         --filegroup to keep output in
      @supports_net_changes = 1            --1 = merge changes on the same field

2.     Re-run step 8 above. You will now get what you see below. Notice that many of the values are taken from the command in step 1 just above. 
           a.     source_object_id is the id of the table we referenced in step 8, as found in
the sys.databases view.
                                b.     object_id is the id of the capture_instance that we have just created
                                c.     schema_id is the id of the schema of the table we referenced in step 8, as found in
                                                                             the sys.schemas view.
                                d.     capture_instance is the name of the CDC setup that we have just created.
                                                                              There can be two per data table, and each must have a unique
                                                                               name – the default is the table’s own name with _cdc added.

       3.     Now look at the System Tables branch under your database
               in the SSMS Object Explorer: 
               You will see that there are a number of tables with a schema
               cdc. The one that you have just made by performing step 1
               just above is cdc.dbo_nwm_cdc_CT, and this will collect the
               data generated by the CDC system whenever the table is 
               changed.


       4.     Now go further down in the Object Explorer and open up the SQL Server Agent tree.
              It should look like this (right). Two new jobs have been created in order to hold the code necessary
             
for processing the CDC operations.


Note     If you wish to disable CDC on a table then you use  sys.sp_cdc_disable_table, providing it the @source_schema, @source_name, and @capture_instance values to identify the Capture Instance.























Some Rules to Live By ?

Once upon a time I worked for this really cool company in Norway.

We had a company handbook, like everywhere, but this one started a little differently.

Work:You spend at least half of your waking time at work – get the most out of it!
Solutions:Do not choose the easiest solution; choose the one you think is right!
Work pressure:The reward is usually proportional to the difficulties.
Things you dislike:Do something about them; improve them if they are important enough.
Work instructions:Until you are certain someone else has taken over the responsibility, it is your own.
Colleagues:Find out which ones are important to you (organizational chart disregarded) and treat them accordingly.
Instincts:Be skeptical of some instincts, do some of the things you dislike the most, talk to some of the persons you dislike the most.
Performance:If you are honest with yourself, you are the best judge.
Improvements:You are allowed to propose improvements, even if you are not perfect yourself.
Obedience:If you are convinced that you are right, stick to it.
Personality:Be yourself. Like yourself. Improve yourself.
Mistakes:Admit them.
Chances:Take them