Saturday, August 27, 2011

Food for a Hurricane

Hurricane Irene passed yesterday, bringing periodic rain, which was nice. Others will get it worse as it goes north. Cooking was needed and frozen chicken breasts were awaiting their fate, so the base was decided upon. Now, what to do to them? We had a tub of Ricotta Cheese in the fridge that we hadn't opened, and spinach, so I decided to stuff the breasts and serve them on rice.

What
Ingredients
1 lb ricotta cheese1/2 lb spinach leaves, lightly chopped
3 tsp chopped garlic1/2 onion, chopped
4 frozen chicken breasts (thick ones)1 pack of Wasa crispbread
2-4 bell peppers (depending on your taste), chopped1 bottle dryish white wine
1 lb pack of baconcocktail sticks
2 tsp dried thyme1 cup grated Parmesan cheese


How
  1. Start thawing the chicken, but intercept the process before it's completely finished, so that you can hold the breasts on edge without them flopping all over the place. Cut through the breasts parallel to the flat sides in order to "butterfly" them, so they will fold back like the cover of a book.
  2. Put some olive oil in a casserole (mine is from IKEA) large enough to take all four breasts and put on to medium heat. Add the garlic and about 1/4 of the onion and fry gently until the onion is soft.
  3. Raise the heat to medium-high, add the spinach, cover, and start stirring. Keep doing this until the leaves all turn dark green, are liberally covered with the garlic pieces, and are well wilted. Take it all out and let it cool off.
  4. In a bowl, mix the Ricotta, Parmesan, Thyme, and some salt and pepper (use a fork and be rough about it!!!)
  5. Add the cheese mix to the spinach mix and mix the two together well.
  6. One-by-one, lay down the breasts, put as much mix as you think they will hold onto them, fold them gently back together, and wrap them with rashers of bacon (probably 2 or 3 per breast. Secure with cocktail sticks.
  7. Spread the remaining cheese/spinach mix on pieces of crispbread to serve as nibbles.
  8. Put some olive oil into your casserole, bring it back to medium heat, and add the rest of the onion. Put a lid on and cook for a few minutes.
  9. Bring the heat to high and gently add the chicken breasts. It should take about 2 minutes for a side to brown, so brown each side.
  10. Once the chickens are browned, pour in the bottle of wine and add the peppers.
  11. Replace the lid and cook on medium for about 40 mins

I served it over basmati rice.
It has to be good hurricane food, 'cos we've blue skies and puffy white clouds today!
TTFN

Wednesday, August 10, 2011

Making Mistakes - T-SQL Tuesday 021

SQL Tuesday Wednesday
I'm a database developer and sometimes a DBA, as you'll probably have realised, despite the amount of food and yarn that appears on this blog! Like all developers, I've made mistakes. Like all honest developers, I try my best to admit them, learn from them, and move towards being a better developer.

A better consultant than I (or, at least, one better recognised as such!), Adam Machanic, has posted a challenge to those of us in the SQL Server community who claim to be honest. You can see it by clicking on the caption of the logo on the right (I can't make the logo itself a link, as it is really a link to the page itself!).

The challenge is to publish a blog  post today (Aug 10th, 2011) talking about the bad code we've written. The aim is to provide people with examples of what not to do.

null values
One new thing you learn when you start out with databases is the concept of "I don't know". Rather like the famous statement "there are things that we know we don't know, and there are things that we don't know we don't know" implies, these unknowns have to be treated with care. One learns to use tri-valued logic (True, False, null (or "I dunno!"), for example). One also learns that, because of nulls, there are sometimes queries where the sums don't always add up as you might expect. Here's an example.

You have a table to report from. You've made it by pulling data from tables supplied by colleagues from their parts of the system. One of the fields defines the type of an item - let's say possible values are Computer, Printer, Router, and Unknown. As this is just a temporary table you're got in memory to organise the data for reporting from, you've not bothered with any referential integrity ...

Computer        2706
Printer          522
Router            47
Unknown          174
--------        ----
Total           3449


So you create your report and all looks good, until you see that the sum of the items that you've produced doesn't match the total sum - in fact, it's 551 too small. The real error is not in the query here that outputs from a sproc for an SSRS report: it's in the underlying assumptions!

select Type, count(Type) as 'Quantity'
from @taReport
where Type is not null
group by Type
order by Type
The programmer didn't realise that sometimes the Type might be unknown, so added the where Type is not null clause quite reasonably to avoid the report row saying that there were zero entries with type "NULL" (and, anyway, that always showed a zero!).

Adding this line just before the select statement would convert the null values into Unknowns, which is really what they are!

update @taReport set Type = 'Unknown' where Type is null

The Unknowns number goes to 725 and the total to 4000, which is the correct total number of objects!

Moral of the Story: A database contains a representation of the real world. It isn't a complete representation, to be sure, but so far as it goes, it must be accurate and complete. In this case the programmer made an assumption about the data quality that wasn't warranted.

Obsolete Code
When one works with a database with some history, such as when one is hired into a company with an already-functioning system, it behooves one to enquire into the history of the system. In one project I was investigating the reasons behind the terrible performance of some queries. One reason that I found was the use of functions in the where clauses of these queries - a well-known bad practice. Investigating further, I found that the functions (there were two or three only, used in a number of places) were very simple, and easily replaced with an existing native function in SQL Server 2000.

It was only after I had tracked down and fixed these function calls that I had a chance to learn more about the system history. It had originally been written in Access only, and these functions didn't exist so had to be written by hand! When the database part of the system was moved to SQL Server the code was re-written, apparently without any concern for whether any pieces were actually necessary!

Moral: Think about what you're doing! you may be creating something totally unnecessarily!

TTFN

Saturday, August 06, 2011

A Colour Nook!!

The wonderful AG, the Keeper of the Books, allowed me to get a new eReader a couple of weeks ago to replace the Pocket PC (picture, right, from Wikipedia) I've had since about 2001. Don't get me wrong, now: the HP Jornada 568 has lasted a very long time for any piece of electronics, was relatively easy to program, has a nice clear screen for reading (a little small, I'll admit), and, recently, has been frequently the object of great curiosity from many people, asking if that was a prototype for a new Apple machine. To be honest, a piece of electronics that lasts 10 years of fairly continuous use definitely gets my respect.

Anyhow, it's coming to the end of its life, with the batteries starting to lose their ability to hold a decent charge and the beast as a whole becoming prone to testy reboots, so I finally decided that a new reader was needed. The problem was, as many have found, one of choice. Many people never moved to an eReader until Amazon introduced the Kindle, so their choice was easy, as they had no history of books to bring forward. I, on the other hand, have around 200 books in a variety of formats - .LIT, .EPB, .PDF, .CHM, .ePub, etc. - that I would really rather not buy all over again.

So, I looked around and found that the Nook Color is really a kind of mini-tablet, running Android 2.2. You could get an emulation on a PC in 2010, so I started playing with it there back then. I also started looking for ways of converting my eBooks (very few of which are Secure, or locked, luckily). I found a program called calibre, billing itself as an eBook manager program, that runs on Linux and Windows, and which will convert a number of formats into ePub, which is the Nook's "native" or preferred format.


Anyhow, I got my new toy a couple of weeks ago, and a few extras that I, for one, really consider necessary. These include a cover, of course, but one that can, as you can see, be used as a stand to hold the Nook at a convenient reading angle.

The next extra, equally important in the short term, but essential for the long term, is a supply of film screen covers to protect the capacitative screen from damage.

Finally, as I have used the small HP for some ten years and am totally accustomed to using a stylus to work the on-screen keyboard, a stylus. The one you see to the left is a rooCase, and comes in the form of a foam tip to an otherwise rather attractive ball-point.

So, it was a few days of play to explore the Nook, get used to expanding and shrinking the screen (annoying, that - web sites used to be written to self-adjust in the days of the old HP!). Anyway, it's certainly got some nice features. One thing I could do with is a set of smaller keys (as I'm not using my fat fingertips) with some extras, rather than having to continually hit an alt key to switch to another keyboard full of numbers and symbols. The text presentation is, on the whole, very good and at least the equal of that in the Microsoft Reader software on the Jornada, and the idea of swiping ones fingers on the screen to turn pages very quickly becomes natural. Then, after getting well stuck in to The Art of SQL, it was time to convert books from other formats. I can only say that calibre worked without any fuss or problems. It uses all the cpu power it can get its fingers on, and definitely isn't the fastest program on the planet, but the output (ePub in my case) is just as good as the originals that I fed it.  

Do I have any grouses about the Nook Color? Well, one or two. I'd like to be able to see the list of books that I have to select from in the equivalent of Windows Explorer's Detail view, instead of icons with only a quarter of the title in view. Of course, that may be possible - just a feature that I haven't found yet.
The other thing that surprised me to start with was the sheer weight of the thing! 654 grammes (with the cover that I bought), 1.44 pounds. Compared to the HP, which only weighed a few ounces, the Nook is a huge monster, and definitely takes getting used to - when reading in bed, for example.

Overall opinion: very favourable. I'd definitely recommend it to people with existing eBooks: ePub and PDF are readable immediately. I'm very happy, and can see the end of paper book purchases in this house looming closer.
TTFN

Saturday, July 16, 2011

New Foods ..... New Technologies

We went off to the H&L Food Store on Rivers Avenue in Charleston today. Very much the usual Asian food supermarket, except rather larger than most on the east coast. We cruised up and down the aisles, wondering what we could send to the far-flung DD ... some sweet things here, maybe some dried squid there ... (well, maybe not!). Certainly not the whole dried Croaker, neatly packaged, very flat, and staring beadily back at the prospective customer with a fixed and glazed stare.That would certainly freak granny out! Then there were lots of green teas in different packages for great-gran, Thai curry paste and ginger sweets for me, and some nice tea for the AG. Peas for the Offspring. Looks like there'll be a box heading out west very soon!

The AG rather liked that grooving on this little 85-cent can of peas, so we got it .... but it says "Dry Peas" on the outside, and, when I shake it, it definitely has water inside. Should they be "Self-Dry Peas"?

Food
So, it'll be stir-fry tonight, methinks. We have rice in the fridge from a few days ago, which is good, as it'll be dried out and not too wet to be fried. Chopped Kielbasa (thin medallions quartered) and maybe some other meats. Celery, mushrooms, some cooked carrots, and red bell peppers, all chopped and cooked a bit. I'll beat some eggs and then cook them in the wok to get a kind of scrambled egg, and then add the rice. After that the warmed meat and veggies go in to get properly hot before serving.

Tech
Finishing a revision go-through of LearnDevNow's SSRS 2008 course, before working therough The Art Of SQL Report Writing on Aranya's site (see Tech List on sidebar). I'm looking towards taking PragmaticWork's SSAS course as soon as I can, as I can see a need for it coming soon.

Home
It's been rather nice, living down here in Charleston for a while, so it's a shame that it may be ending soon. We've really been enjoying late-night swims together, without all the kids and without the glaring sunshine. We'll see what the future brings. Fun, hopefully, and enjoyment.
TTFN

Tuesday, July 12, 2011

An Example of Computer Evolution

I'm writing this on a laptop with a 17" screen, an attached 19" monitor, 4 GB of RAM, about 300 GB of disk space (mostly used, unfortunately), a couple of terabyte drives attached, and a 2 GHz AMD processor. Fairly normal, you might think, except that this PC was bought in 2006, making it five year old! Not surprisingly, it runs Windows XP.

The other day I downloaded a small piece of software in order to do some work, and was cautioned that the software required that my PC should have the following minimum assets:

The following minimum computer hardware and software requirements must be
met in order to access or retrieve the materials herein: IBM
compatible or Macintosh personal computer system with internet connectivity;
available hard disk drive space of at least 50 kb; a computer pointing device,
such as a mouse; 128-bit SSL (Secure Socket Layer) compatible browser, such as
Netscape 4.0 or Internet Explorer 4.0, or higher; Adobe Acrobat® Reader ® 5.0,
computer monitor capable of displaying internet web pages and graphics;
graphical user interface operating system, such as Windows 95, OS8 or later.


Seeing as I was actually viewing the requirements on an internet site, the requirements for internet connectivity and monitor capabilities seemed a little redundant. However, I find that I have forgotten how long ago it is that a PC would function with less free disk space than 50 kilobytes! Certainly well before 1996 and the advent of the Web for most people!

Still, it all worked flawlessly, which just goes to show you how well Sir Tim and his colleagues at CERN designed the Web in the first place.

TTFN

Sunday, July 10, 2011

Oops

I generally a clumsy oaf in many things - like steaming three fingers while cooking this evening!
Oops.

sometimes you just can't believe
how well you can be treated
we're told "forgive others" but that's
been difficult since we were created

I forget the timezone and ring too soon
I'm a klutz and drop the china on the floor
I misspell your town's name
and spill chocolate down your pure white blouse !

somehow you know that it isn't intended
that forgetting anniversaries is just how I am
your speciality seems to be forgiving me
which just helps me love you more
TTFN

Wednesday, July 06, 2011

From BJs to Costco

For the last few years we've been BJ's customers and very happy ones too. However, our nearest BJ's is now a couple of hundred miles away, so the question was: who now? Here's a few things we've found at Costco here in Charleston that are nice:
  • A cool room where all the berries and pre-packed fruit and veggies are kept.
  • A huge pile of Canon EOS Rebel T2i cameras (18 MPxl) at $800.
  • Single-unit Magic Bullets at $45 (with at least six mugs). Ours is still in NJ, but all the mugs will interchange.
  • Interesting and nice specialty breads - like cheese bread and various herb breads.
  • A good selection of frozen foods (I didn't find the 3-packs of peas and corn that BJ's has, but I haven't explored everywhere yet!).
  • A good variety of fresh food - fruit, veggies and meat - all well-kept (except for one occasion where the bottom layer of boxes of bananas pretty much dissolved and when someone got to them ... well, they still smelled nice, but were just about liquid!
There's a Sams Club that's nearer, but not nearly as good for fresh food. It has a lot of pre-packaged things - far more as a percentage than Costco.

The local Walmart (almost a mile away) has good fresh food too. On the other hand, I've been to a couple of the local store chain, Piggly Wiggly, and will definitely leave it!

TTFN

Found Food

I have published quite a few recipes here on my blog over the last few years, and I hope that all my readers have tried at least some of the...