CSS, max-height

I wish I had something of substance to add today, but I’ve been overwhelmed by personal stuff.  My oldest daughter has been sick with strep for the last week, so I’ve been having to rearrange a lot of my schedule so I can hang out with her when needed.  Consequently, I’m just wiped in the evenings. 

Anyway, you may have noticed that I’ve been playing around with my website, especially with my new blogroll page.  I”ve been adding some blogs to it using RSS feeds, and one thing has become clear: different RSS feeds behave differently when asked to return an item.  For example, some blog postings auto truncate themselves after a few phrases; for example, Brent Ozar:

Brent Ozar

Why NUMA matters to admins - Wed, 17 Mar 2010
Here’s how to tell when you should learn NUMA. Say you’ve got an IBM 3950, a high-end rack-mount server with 4 sockets, 4 cores each (16 cores total) and 64 gigs of memory.  If you’ve got several of these servers, you can connect them together via a daisy chain.  IBM makes a special interconnect cable that [...]

Why NUMA matters to admins is a post from: Brent Ozar - Too Much Information.
If you'd like to quote this content on other sites, please read how to use my blog's content.

Contrast this with Andy Warren’s feed:

It Depends (Andy Warren)

Automating Imports from Access - Wed, 17 Mar 2010

Access is actually pretty good at importing files, and doesn’t on the surface work much different that import/export from Management Studio. I wrote this up after a friend had asked for assistance, I remembered the import specification part but couldn’t find at the time how to drive it from code. Finally dug through (it’s been a long time since I did this stuff) and got it to work.

For this short example I’ve created a two line comma delimited file, and then started the import:

image

You can see in the back window that it’s parsed the file and found the comma delimiter. The interesting part is what happens if you click Advanced (in green). That brings up the Import Specification dialog, which I think goes back to at least Access 97. You can tweak the import settings and then save them, maybe something like this:

image

Then you can save it with a name:

image

So now if you want to import the same type of file later, you can just select the import specification and you’re set. Very useful, not hard to learn. You get a prompt at the end (after clicking Finish), that lets you save the steps:

image

After clicking “Save Import”, you get the following task, with the “Run Import” on the ribbon:

image

image

Clicking the button doesn’t seem to generate any results for me. CSV is there, database is there, no changes, no error message. Ran the import again from within Access, got a prompt that the table already existed. Dropped the table, back to Outlook, this time worked fine. Not unexpected, just not entirely helpful.

You can re-run the import from within Access, clicking Save Imports bring up the list to pick from:

image

To automate further, you can create a module, create a function within the module, and then drop in code like this (it has to be a function if you want to call it from a macro):

Function ImportFile() As Boolean

DoCmd.RunSavedImportExport “import-test”

End Function

And you can tie it to a macro – even an autoexec macro – by just plugging in the function name:

image

In terms of complexity it’s not obvious how to do it all. I wish the import spec dialog had more options besides the Outlook Task – create code and/or create macro options would be nice.  Compared to Integration Services? Of course SSIS is far more robust, but at this level it seems like slightly different approaches with SSIS arguably more intuitive if you use the import/export wizard, probably not so if you build the package manually.

So there you have it, maybe you’ll find it useful one day!

Now, while I like reading Andy’s stuff, I don’t necessarily want a bunch of lengthy articles on my blogroll page; I tried to figure out a way to limit the amount of text returned, when I tripped across this nifty CSS property: max-height. From DevGuru: The max-height property is used to set the maximum height of an element. Other properties can be used to set the height, width, maximum width, minimum height and the minimum width. This property is not inherited. (note that Devguru also specifies that this property is not currently supported by any browser; it works in IE7. Go figure).

Anyway, I simply add the max-height to my div container wrapped around the feedsnap plugin, and suddenly the RSS feed truncates after a certain pixel height.

<div style=”overflow:hidden;max-height:100px”></div>

It Depends (Andy Warren)

Automating Imports from Access - Wed, 17 Mar 2010

Access is actually pretty good at importing files, and doesn’t on the surface work much different that import/export from Management Studio. I wrote this up after a friend had asked for assistance, I remembered the import specification part but couldn’t find at the time how to drive it from code. Finally dug through (it’s been a long time since I did this stuff) and got it to work.

For this short example I’ve created a two line comma delimited file, and then started the import:

image

You can see in the back window that it’s parsed the file and found the comma delimiter. The interesting part is what happens if you click Advanced (in green). That brings up the Import Specification dialog, which I think goes back to at least Access 97. You can tweak the import settings and then save them, maybe something like this:

image

Then you can save it with a name:

image

So now if you want to import the same type of file later, you can just select the import specification and you’re set. Very useful, not hard to learn. You get a prompt at the end (after clicking Finish), that lets you save the steps:

image

After clicking “Save Import”, you get the following task, with the “Run Import” on the ribbon:

image

image

Clicking the button doesn’t seem to generate any results for me. CSV is there, database is there, no changes, no error message. Ran the import again from within Access, got a prompt that the table already existed. Dropped the table, back to Outlook, this time worked fine. Not unexpected, just not entirely helpful.

You can re-run the import from within Access, clicking Save Imports bring up the list to pick from:

image

To automate further, you can create a module, create a function within the module, and then drop in code like this (it has to be a function if you want to call it from a macro):

Function ImportFile() As Boolean

DoCmd.RunSavedImportExport “import-test”

End Function

And you can tie it to a macro – even an autoexec macro – by just plugging in the function name:

image

In terms of complexity it’s not obvious how to do it all. I wish the import spec dialog had more options besides the Outlook Task – create code and/or create macro options would be nice.  Compared to Integration Services? Of course SSIS is far more robust, but at this level it seems like slightly different approaches with SSIS arguably more intuitive if you use the import/export wizard, probably not so if you build the package manually.

So there you have it, maybe you’ll find it useful one day!

 

Anyway, I hope this puts some ideas in your head.

December 16, 2008   Posted in: CSS

3 Responses

  1. Margaret - December 30, 2008

    I think your solution is elegant and useful — as for the different feeds, it’s simply that the one person has his set to “full feeds” and the other has it set to “excerpt”.

    Lot’s of back-and-forth on the value of each setting and it ultimately ends up being a personal choice. Supposedly for SEO, you want full feeds.

    ê¿ê

  2. stuart - December 30, 2008

    Well, that’s useful information to stockpile somewhere ; do you have any idea of where to set that in feedburner, for example?

  3. Margaret - December 30, 2008

    Go to your wordpress dashboard, settings, reading and you’ll see “for each article in a feed show” and radio buttons next to “full” and “summary” — there’s also a setting for how many of the most recent posts to show in the feed.

    ê¿ê

Leave a Reply