Showing posts with label Haddonfield Stitch 'n' Bitch. Show all posts
Showing posts with label Haddonfield Stitch 'n' Bitch. Show all posts

Tuesday, June 09, 2009

SQL & Socks

Firstly, the techie stuff (as I'm also watching Star Trek) and woolly stuff later on down.

Geek Stuff

I've been troubled with heat, slow speed, program lockups, and general vanishing hard-disk space on my laptop. I run MS SQL Server 2005 and VS 2005 on this machine for development, and, more and more often, running both intrfaces has locked them, with one or the other usurping the processor, taking 97%+ of cpu time.

This evening I was checking disk ocupancy to try to discover why I was running out of space. I was using a copy of FolderSizes, and found that at some time in the past I had been experimenting with scheduling backups for a database, and obviously never turned it off. Now turned off, I've removed several GB of backup files and life is better.

Something else I saw was that the log file from one database, itself 2 GB in size, had increased to about 25 GB, causing my system to run short. Truncating the log file got it back down to 2 MB! Here's the code:

use DataBaseName

backup log
DataBaseName with truncate_only

dbcc shrinkfile (
DataBaseName_log, 1)

This is definitely a wake-up call for all of you small-system DBAs: SQL Server documentation is quite clear that the database retains the log data until you clear it out. What the docs cannot tell you is how big it will get nor how quickly it will grow - that is totally up to your application. I managed to use up 25GB because I started with 2 GB of data and spent about a month doing analyses on it. Pretty soon I'll be able to get rid of the original database itself - phew!

Food

Here's something nice to eat. It should take you about 30 - 45 minutes from the time you enter the kitchen to the time you're mobbed as you sit to eat. It's called Mike's Bacon-wrapped Chicken, and I serve it with corn and couscous. I'm not going to be absolute with quantities - obviously you'll need more for more people.

Firstly, get all your ducks (chickens ?) in a row - this'll make everything go lots quicker, and get you to the table sooner. You'll need a sharp paring knife, tongs (like you might use barbecuing), but not huge, a cooking spatula and spoon. To cook in, a frying pan and two cooking pots. You'll also want 2 or, maybe, 3 bowls to put cut veggies into. Determine what people will want to drink before-hand and arrange someone to handle that for you.

Ingredients

Start with a smallish onion. Peel it and chop it in to pieces about two tenths of an inch in size. Put them into a bowl and reserve. Add about three or four crushed and chopped cloves of garlic to the onion. Chop up one or two peppers (any colour, but one of each is best). Make sure you dump the central area around the stalk, and all the seeds. Reserve them into a bowl (or two, if needed). Get out Rosemary, Thyme, Salt, Pepper, and (optionally) Nutmeg.

Put water into one pot and frozen corn too: put the heat under that to medium. Put some butter into the other pot - again dependent on how many people / how much couscous. You'll need almost a cup of couscous per person, together with chicken broth for the couscous and either white wine or more chick broth for the main dish

Take a chicken breast per person, wash, and dry them (just in case there's bone fragments from butchery). Trim the extra fat off each and cut each breast into roughly 3 or 4 equal-sized pieces. More important than being perfectly equal is that you cut the really thick parts of the breast parallel to the table to try to even up the cooking times for all the pieces. Finally, you'll need some wooden cocktail sticks - about 3 or 4 per chicken breast.

Take out one strip of bacon per piece of chicken but keep it aside with the cocktail sticks.

Cooking

Start medium-high heat under the frying pan and put some cooking oil in to warm. Personally, I use Safflower as it has a high smoke-point, so things get brown nicely, and it also doesn't taste the food much at all. Get the oil reasonably hot and put in the onion and garlic mix in to start cooking.

Once the onion is beginning to look cooked - about a minute or two - add in some salt and pepper, stir up to mix, and then start adding in the chicken. Don't worry if it doesn't all fit in - two stages will be fine. Raise the heat at this point and fry off the chicken for about two - three minutes a side. We want the chicken to be browning now, but not cooking in the middle.

Once the pieces of chicken are browned, take them out (tongs!) and put them on a plate to cool. Put in any that are still waiting and cook them. As soon as the chicken is all done, replace it with the peppers, some Rosemary, Thyme, and Nutmeg, and lower the heat to let them fry gently in the onion and chicken juice.

Meanwhile, take each piece of chicken, wrap a rasher of bacon around it, and pin the bacon on with a cocktail stick. Store in one of the bowls used for the veggies now in the pan.

As soon as the chicken is wrapped, return it all to the pan or, of it won't all fit, get another pot and transfer some of the veggies there, follow with the chicken, and add the rest of the veggies. Not add wine or broth. If in the pan, then about half-way up the pieces of chicken; if in a pot then until you just begin to see the liquid level. Either way, as soon as the liquid is in you should raise the heat to bring it just to the boil before lowering it again to a simmer. We can best keep this simmering for about five minutes or more.

Next, raise the heat on the corn to bring that to the boil before letting it just keep warm.

Now the couscous. This is a starch that cooks incredily quickly, so we can afford to keep it until the very last few minutes. You'll find the butter in the pot: it should be melted by now. Raise the heat to about medium-hot and add the couscous grain. Use a spoon to keep stirring the grain as it gets coated with the butter and starts gaining temperature. If you listen (yes, listen!) to the pot closely you'll be able to hear it start to hiss as it starts to fry. This is fine for a while, but eventually the couscous will start to brown (from a golden-yellow to a brick-red) and tat that stage it gets bitter, so you don't want to go too far!

Once the couscous is hot you can pour in the chicken broth. Start with a cup for two of couscous - as it hits the bottom of the pot there should be a kind of a "whoomph" sound as the broth turns to steam. This is good, as it pushes liquid all through the grain, cooling it quickly. Put enough broth in that all the couscous is in a very slightly soggy mass. Don't be scared to put in too much broth - too little leave "raw" grains with will seem like grit. Take the couscous pot off the heat and continue to stir quite quickly. It will absorb the liquid: if it looks to be too dry then add some more!

Now you are happy, leave it off-heat for a few minutes and turn off the corn, pour it through a sieve, and put into a bowl to serve.

Next, use your tongs to take out the bacon-wrapped chicken from the pot or pan into a serving bowl and raise the temperature under the rest to max. Add more wine or broth if needed: we want a kind of gravy here with lots of bits, so it needs to reduce for a minute or so: to do that it also needs something to reduce from !

While the veggies / broth mix is boiling, take a fork and stir up and finally fluff up the couscous. Pour it into a bowl to serve too: and fluff it up again now. Aerating the grain will let steam percolate better and make sure that grains still in need of moisture can get it.

Now everything else is ready for the table, kill the heat under the veggie-liquid and pour that into a bowl. Bring everything to the dining table to serve.

That may seem like a lot to do, but in all honesty it takes me about 30 minutes to make enough to feed four and have enough for four more little lunches to take to work. Don't expect to do it that fast to begin with - in fact, get someone to read out the instructions to you as you go, to save stopping and finding your place every few seconds.

Yarn

It was the spawn's birthday last week, so among other things, he got a pair of wool short-socks. Well, he will do, when the AG finishes the second one!

We went to Woolbearers last week, so there are three balls of black yarn waiting to go into the AG's Witches Hat for Hallow'een. Tomorrow it's the Grindhouse Café in Haddonfield for Stitch 'n' Bitch. If you're there, come and meet us all.

TTFN

Tuesday, April 07, 2009

Honey! I Shrank The Kids (' PC) !

Before everything else: greetings to all at the Haddonfield Stitch 'n' Bitch, and thanks to them all for their concern for my wife. They're totally wicked good!

Once upon a time there was a student of Electronics and Electrical Engineering. He worked hard and diligently on his simulation and, when the specification was ready and his supervisor had approved it, he sent it off to be processed by the University SuperComputer.
Next day he received a communication in his computer mail-box (email as we know it now hadn't been invented then) inviting him to come and visit the head of his department. With some trepidation he went, to find his professor, his department head, and also the head of his school awaiting him. Obviously this wasn't to be a good day !
He was told of the bad news ... his simulation, which was supposed to have lasted about 10 cpu-seconds, had taken up the entire college's allocation of time for the rest of the year! [oops]! Oh well: it actually wasn't his fault, they agreed - he's exposed a flaw in the simulation program he was told to use. However, he wasn't to use that system again. Excretia, as they say, happens.
A little later in life this same student was working at a famous and prestigious institute when the decision was taken to change computer systems. The old one occupied a room and had two operators always on-call. It was removed one day and in its place a man arrived with a panel truck. He brought a desk and two crates out of that truck. He opened the crates and pushed the two white boxes (on wheels) inside out into the room. After the crates were removed, a terminal was put on the desk, the two boxes connected to each other and the terminal, and the whole lot plugged in and switched on. That was it! 250 square feet of computer gone in a morning !
The first of these three computers had about a tenth of the power of the second, and was kept in a dust-free room. The last, ten or more times more powerful again, came in a couple of boxes. I'm sure you can see where this is going.
The next project saw our intrepid engineer working with mini-computers to process CAT scans into 3-D images for doctors to do diagnoses and radio-therapy simulations with - something that the SuperComputer couldn't have done ten years before. At about this time he was given his first PC ("Personal Computer"). It was a surplus PDP-11 in 3 19" racks, each about 80" tall. Very cool, and he didn't need any heating in his apartment that winter!
The project after that saw him replacing a small mini-computers with first-generation PCs (because they were faster, more robust, and more easily re-programmable).
Since then, PCs have become more and more capable. IBM's original architecture has been expanded but shows remarkable longevity. Right now I develop on a 17" Acer that's about 2 years old and suddenly in dire need of a re-install of Windows. My Christmas present to myself last December was an Asus 1000ha in what was called "red" by the advertisers. Of course, it is more "pink", as you can see in the pics, so The Better Half appropriated it on the spot!

I got this just as it hit the market, in December 2008. There were lots of glowing reviews at the time, all of pre-release versions, so how has it stood up to three months of use? Has it actually been useful for three months??

The Review
First off, lets look at it in a purely (sort of) quasi-scienific way. Here are the good bits:
  • The price - $350 plus another $30 for a memory expansion
  • The size - 10.5 x 7.5.
  • The weight 3 lbs. The battery is denser than the rest of the machine, is rounded, and is at the back, so it's a nice place hild it when it's being carried
  • The hard drive - 160 GB is a good hefty size, especially for a machine this size.
  • The pouch that comes with it - and the micro-fibre cleaning cloth !
  • The resilience. I wouldn't suggest playing basketball with it, but it fell off my wife's hospital bed a few days ago and hit the iron table feet on the way down. Ouch! I feared the worst, of course. It looked like screen was trashed to begin with, but, believe it or not, it seems to be recovering ! There's just a small pair of lines there now (4 days later) and even they seem to be fading. Will I get a replacement screen? yes. Do I really need it ? Not really, but when I do they won't be available, so ...
  • The resilience again ! The case wasn't even scratched, and the hard drive is fine.
  • The long battery life. It isn't the boasted 7 hours, but 4 hours is fine by me.
  • The camera.
  • The software - MS Works kinda sucks but is good for compatibility. Star Office is great and should be bundled with more PCs. It does pretty much everything you want for an office suite. All the other software works perfectly. That's a novelty in this world!
  • The SD card slot! I was wondering how to get some pix off my camera without paying a fortune ... and then I came across this little slot ! I promise you - I didn't realise it was there for 3 months !
  • The screen resolution. It's good, but if you tell it you have a huge screen it'll believe you and then let you use the screen you can see as a sort of a porthole into what is suddenly a huge screen. A little weird to begin with but really useful for having lots of things up at the same time and not getting in each others' way.
  • I'm recording all my old LPs and cassettes onto it and then burning them onto CDs. Totally easy and lots of cpu speed for that. Tip: Use Blaze RipEditBurn Plus. Right now it's $40 and worth at least $80.
  • It picks up Wi-Fi (802.11b/g) more easily than any other PC I've seen.
And here are some bad bits:
  • It doesn't come with a mouse. There are virtually-flat mice these days, and it wouldn't be too hard to create a mouse-hole !
  • The keyboard isn't quite big enough for me. Mind you, neither is a full-sized one, so maybe I'm just clumsy ! Maybe they could revive the old IBM ThinkPad expanding keyboard ?
  • The hard drive. They split it into two partitions!!!! Mind you, they're equal, so C: is bigger than most Dell servers have !
  • The fact that the wife / girlfriend will appropriate it almost as soon as they see it - yes, it really is that cute!
  • It's slow. But that was mainly when I'd installed MS SQL Server on it. AfterI took that monster off it ran great again. Let's face it, it's not server material but, then again, would you lock 25 things as cute as this up in a rack ?!
  • I want another one but have to wait. This is definitely the biggest beef!
The Verdict
I like it. I like the general ease of everything about it. I got the Windows version because I needed to use certain specific programs with it, and I've found it totally adequate for everything I've asked it to do.
I have to admit that I like the attention it gets ! Pretty much everywhere either I or my wife have used it we've been accosted by people asking about it. Not just young people or geeks, either. Little kids looking for info so they could harass their parents for one - grannies with white hair interested in it and whether they can push their children into buying it for them !
All in all, this is a hit machine. Somewhat of a chick-magnet, like a chocolate lab, but with a serious inside, like a chocolate lab who's also a guide dog. Eminently desirable; if you're looking for a new PC, look hard at this. Also, don't forget that if you don't want the laptop format, that it also comes as a desktop - equally neatly packaged! These guys must have Jonathan Ive moonlighting for their design department.

The bottom line? Buy it.

The Great Escape !

Now Monday is over I've actually got time to sit down and tell the end of the story.

So, on Saturday night The Better Half woke at 7.45 with very little pain, and all of that seemingly a result of having four holes more than she had entered the hospital with! What a wonderful thing being pain-free is. Those of you who haven't experienced real pain (and that probably includes most of us who've never given birth) probably won't know the relief when pain that absolutely makes you want to die gives up and goes away. I can't say that I do. However, I saw the difference in The Better Half, and that's enough for me. I can believe that Gall Stones are one of the most painful things just by seeing - I can definitely pass the experience by! Our surgeon, Dr. K., stopped by and said that The Better Half could go home after a couple of meals. Sounded good to us. So good, in fact, that he was promised a pair of hand-knit socks there-and-then, on the spot. He seemed pleased!

Sunday dawned bright and (as it usually does) early. Breakfast didn't happen for The Better Half, so that meal didn't get to be one of the two. It didn't look like she was getting lunch either, but her name was placed on the list literally at the last moment, and there it was: a slice of turkey and a fair imitation of an MRE version of a Thanksgiving Meal! It kind-of tasted ok, especially the pieces of fruit on the side.

So, we waited for dinner. I told you that hospital life was like the military life - short periods of adrenaline use interspersed with long periods of intense boredom. A peckish 4 pm became a hungry 5 pm, and the nurse arrived to ask how dinner had been. She was greeted with blank looks: "Dinner? what dinner? Isn't my wife on the starvation diet?". She wasn't amused, I think - judging by the words uttered as she sped off to arrange food as fast as possible - maybe she actually wanted to get rid of us!

Food arrived, was satisfactorily consumed, and The Better Half was approved for departure. We grabbed all belongings, signed papers, and were en route to the ground floor. We saw why we were rushed out. The ward was suddenly half-empty and the ER wasn't sending up more occupants. In times like that some nurses are let off early for the day. The ones that remain tend to get a slightly heavier workload, so getting rid of another patient made life easier for them.

Today (Monday) The Better Half spent resting and contemplating the use of a brand-new Cuisinart toaster - this evening she built a bear to celebrate not being in hospital any more.

The Thanks

Thanks go out to Brian and Ryan for being there when asked for, Mitzi and Apollo for visiting at a great time, April for the Tulips (they really do close at night and open in the light !), The Better Half's Mum, Dad, and Gram (the flowers really were good, and I hope I kept you up to date), and likewise Cindi, Flora, Jessica, Jane, Debra, Alison, Sheryl, Ali and Jenna and everyone else in Haddonfield, Woolbearers and everyone else who said "Hi and Get Well Soon" !

For those of you here from FaeryKnits,
Normal Service Will Soon Be Resumed

Normal service will also resume here ... a mixture of code and yarn and some comment on the insanities of the world.

One last wish to you all: be far from having gall stones!

We can be found on exhibition at the Haddonfield Stitch 'n' Bitch on Tuesday evenings, in Woolbearers on the first Friday of the month (oops ! sorry - missed April's - drat!) and most Sunday afternoons. Also, we anticipate, at the MD Sheep & Wool this year.

Wednesday, March 25, 2009

Lots Later

Well, at the end of the last posting I said "a little programming". Well, that turned into rather a lot of programming indeed! In T-SQL and VB.NET, mainly, along with a load of debugging other people's misconceptions about what they should be expecting.

Along the way of programming I discovered a number of useful things, like how to get a list of all the fields names in a database, how to search for code containing a string or strings inside SQL Server, and all sorts of other tid-bits!

Anyway, today I needed to take a table and set a field to a number all through the field. Easy enough, if it's just one number, but what if it's two or more numbers, and you have to distribute them so that record 1 gets number a, record 2 number b, etc. until you run out of numbers and then repeat the sequence over, until the end of the table? Oh yes, and you don't know in advance how many numbers there'll be to distribute!

declare @taPeople Table ( RowID int Primary Key Identity(1, 1),
PersonID int)
-- ----------------------------------------------------
-- Find out how many are needed
-- ----------------------------------------------------
select @intNrIDs = count(*)
from tblIDList
where CompanyID = @intCompany and
-- ----------------------------------------------------
-- Fill the table var. with the IDs we want to use,
-- and the Identity fied will number them for me
-- ----------------------------------------------------
insert into @taPeople
select PersonID
from tblPeople
where CompanyID = @intCompany
-- ----------------------------------------------------
-- Arrange for tblData also to have a contiguous
-- monotonic-increasing key (i.e. identity (1, 1))
-- ----------------------------------------------------
update dbo.tblData
set PersonID = (select PersonID
from @taPeople
where RowID = (DataRowID % @intNrIDs ) + 1) where CompanyID = @intCompany
-- ----------------------------------------------------

Well, I thought it kinda neat, 'cos it lets me do non-random distribution of data across all the records of a table - not a thing usually easily done without a cursor.


Yarn Stuff
Back to the subject that's been consuming this blog for the last few episodes - wool !

As always, we wnt to The GrindHouse Cafe in Haddonfield today (Tuesday) and I programmed and Tola and the other 25 or so ladies all knitted and chatted. One young lady in particular is Jessie, and she's just starting out knitting. So, here's a picture of Jessie and her very first piece of knitting ( a geek would call it a small enthalpy-enhanced area of the Universe, with great future prospects. I call it rather cool to watch someone fighting over what she terms "the first thing she's ever made". ). Anyhow, Jessie, Jenna, and Ali are great company and seriously intelligent (being med students!). The other two can knit well and are dragging Jessie into it too, which is a nice thing to do.

Next, we visited Loop and Nangelini on Philly's South Street last Friday. Loop because there was a book signing there, and Nangelini's because we were there and we like Nancy. In fact, the Loop visit turned into a double-header, because there was another book-signing next door, at Spool.

At Loop, The Better Half wanted a signed book. I might have lost her then, but the signature duly materialised. As you can imagine, the signature of a cartoon artist is seriously attractive.

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...