Morsel Cake Recipe

Preheat oven to 350 degrees

1 cup sugar
1/2 cup butter
2 cups sifted flour

2 teaspoons brown sugar
1 teaspoon cinnamon

1 1/2 teaspoons baking powder
1/2 teaspoon baking soda
1/2 teaspoon salt

2 eggs
1 small carton sour cream (1 cup/8 oz?)
6 ounces semi-sweet chocolate chips (1/2 package)

bunt cake pan – greased

  1. preheat oven to 350 degrees
  2. cream together sugar, butter and flour.
  3. Take out 2 tablespoons of mixture for the top of the cake. Add cinnamon and brown sugar and set aside.
  4. mix all dry ingredients (except cake toppings above)
  5. add and mix wet ingredients
  6. pour in to a greased bunt cake pan
  7. sprinkle topping on top
  8. bake at 350 degrees for 45-60 minutes

Fade-Container – Text Truncation in Tables, Multiple Lines, and no Calculation

See the test page.

The CSS ellipsis is great and now pretty well supported; however, there are times one can’t use it. It doesn’t work in table cells of variable width, and won’t work if you want your text to wrap to a second or third line and then truncate. I came up with a technique which will work in those situations. I call it the “fade-container”. It works especially well when you want the table rows to be a uniform height and you want to truncate text that is too long to fit without calculating anything. This technique also works with IE6.

First, a quick explanation of the challenges-
The CSS ellipsis can only be one line (not wrapped to multiple lines) because it needs “white-space: nowrap;”.
The CSS ellipsis is measured by the browser as the width of the available space. You can do this test, create a fixed width container. Inside put 2 spans with text in them. The first give a short bit of text that fits easily inside the container. The second span give a long rambling novel that will need truncation. Style both of them with the ellipsis rules.

span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

If you test the width of these with JavaScript you will see that the browser considers them both the width of their container, even the one that’s shorter.

A table calculates the width of columns by calculating the the contents first, and then calculating the columns second. Putting long non-breaking content into a table, which is what happens when one sets the content to nowrap, usually looks bad and often breaks the table.

There are good reasons why you wouldn’t want to use JavaScript to calculate the contents of each cell. The fade-container method means you don’t have to calculate anything. The markup is

div class="fade-container" title="content goes here"
     content goes here
     div class="fade"

but see the test page for the whole thing.

The way this works is that the text goes inside a div which hides the overflowed text. An image is positioned in the div. The image goes from transparent to opaque, matching the background color of the table cell. If text is long it will flow under the image looking like it’s faded out. If the text is short it will end before the image, which will be invisible, since the colored part matches the background under it.

This can be adjusted to wrap to one or more lines with the CSS. The fade-container has a title with the full content in it in case the user wants to see it by hovering.

The fade div has a gradient which goes from transparent to the container’s background color. This can be done with CSS gradients or with a png for older browsers. If your table row has a different background for hover or selected or has zebra stripes, you will need additional fade styles to match.

The hyphens, word-wrap and word break is to reduce the amount of white-space at the end of the line before the text wraps. If the wrapping word is long, it looks better to hyphenate it instead of showing a gap, which won’t give a visual indicator that there is a fade. For one line I use “word-break: break-all;” because it will show that there’s more text to come, but for multiple lines I won’t use that because it chops a word indiscriminately and that will show on the top lines.

You will need new images and different positioning for non left-to-right languages. You will also need additional colored fades if you have zebra striped tables or the table row backgrounds change color on hover.

Dogs and Ibuprofen, Pills in Pockets

There was a woman who walked her dog each day at a dog park.  She kept a pocket full of dog treats and handed them out to each dog that came to greet her.  One day she gave a dog a treat and then realized that it was not a dog biscuit but a super ibuprofen pill she had in the same coat pocket.  The dog had eaten it and although she told the dog’s owner what had happened, neither owner realized the gravity of the situation.

Later, the dog threw up but the owner figured the dog was getting the pill out of her system.  The next day, the owner took the listless dog to the vet who had to keep the dog there for several days on an IV.  Ibuprofen can cause kidney failure and permanent damage in dogs (and people as well).  The dog is doing well now, but might have some permanent damage and will have to have her kidney function tested every year for the rest of her life.

Apparently lots of people carry ibuprofen around in their pockets, and apparently lots of people also carry dog treats in their pockets too.  Even though putting pills and dog treats in the same pocket might sound kind of gross, it seems to be a very common practice.

Hopefully reading this can help prevent accidents for others.

Please Vote!

Adult US Citizens, if you don’t vote you are partially responsible for whatever happens and have no right to complain about anything government does.

There are a variety of issues to vote on, not just the presidential election. Where I live there are proposition measures about union busting, school funding, the death penalty, human trafficking, and genetically engineered foods. You’ve got to care about one of those issues, right? There are government positions to vote on from the president down to the city council.

Employers are legally obliged to give employees time to vote. If you are a parent, take your children to the polls with you. You can model being a good citizen and explain how it works, and they might get a sticker or lolly pop. My ballot this year has two initiatives directly concerning educational funding as well as a school bond measure. It’s part of my responsibility as a parent to vote.

Don’t assume you don’t need to vote because all the like-minded people around you will. That’s like not getting a vaccine because you expect others around you to get theirs. When enough people think like that, it won’t work and we’ve seen whooping cough come back as a result.

My Warped Sense of Humor

Image

I get bored of right angles and since this is my blog, and I can do what I want with it, I’ve made some changes to the mobile design.  The base theme is Carrington-mobile-1.2. I added some of my own CSS to it to change the colors and to make it  more, well, me.  I used CSS3 to rotate some stuff.  Perhaps it’s a bit subtle.  I think someone is going to be holding his or her phone and twisting it around trying to make the lines straighten out, then wondering what’s wrong.  That might be really bad design, but it’s also funny.  I hadn’t intended to annoy anyone, just to do something a bit different and have some fun.