Pandhandle visit part 2

August 2nd, 2012

Mom and Tara and I went to see Moonrise Kingdom, which none of us really liked, then went to dinner at Sluggo’s, which wasn’t very close or particularly easy for us to find but which we all liked a lot (though I felt bad we’d made such an effort to find the place and then there wasn’t much for Mom to choose from, unless she asked for substitutions).

Amy went out to see a friend, so I worked on my uberdork infographic of Breaking Bad characters and then wanted to make the pumpkin/chocolate chip cupcakes but didn’t have the recipe. I couldn’t look it up online, either, since Amy doesn’t have internet, but I wanted to do something productive so I settled for oiling the locks on her doors. Both locks on the side door have been really cranky about working, though the two on the front door were slightly more cooperative.

So far at Amy’s I’ve made the potato/dill salad, which we both liked, and a veggie pot pie which she likes a lot more than I do. I’m at the library again to look up the cupcake recipe, then I’ll go on to see Mam-ma, Uncle Andy, Mrs. Nichols, and Meagan, then come back to Amy’s and probably bake them this evening before or after Drew comes over.

Panhandle visit

July 31st, 2012

Driving to the panhandle:

I shot the sheriff (in a tepid cover version); I wandered down this lonely street on my own because, like a drifter, I was born to walk alone; I went nowhere and exhorted somebody to help me, to cherish his or her love, and to hit me with his or her best shot; and most of all, I wished I’d brought some music with me.

I was five hours into the drive–about 20 minutes from Milton–before I used the f-word in muttering about traffic. Not bad at all, for me. The drive was mostly intensely boring, which I decided was better than if it had been intensely interesting.

Visiting family and friends:
Mom and Amy and I went to see Brave, which we all enjoyed, then went to Taste of India, which we would have enjoyed a bit more if the waitress hadn’t been giggling and gossping about us and if we’d ordered the dishes milder. The food was good, though, and the owner? cook? was very nice.

Mam-ma recognized me and we had a lucid conversation for awhile, then she invited me to visit her at her home for dinner some day. She told me she’d sold her house, then moved into somewhere that was too small for her, across the street from Leah, and kept moving until she’d found a good place. She thought she was visiting the nursing home, and said that she’d seen the man across the hall a few times and he was nice. She wanted me to come visit her again soon.

Mrs. Nichols wasn’t in either time we stopped by. I’ll try again today.

Uncle Andy was mildly antagonistic, trolling for an argument. I didn’t take the bait. Mom tired of it quickly and we left.

I haven’t seen Tara or Meagan yet, though I want to before I leave.

Random notes about the area:
This is the buckle of the Bible Belt. Part of the directions to Amy’s place from Highway 90: Turn right just after the First Baptist Church of Milton, go down about a mile (left at the fork, over the train tracks, over the bridge), take a right just before the First Baptist Church of Bagdad.

It’s raining today so I haven’t gotten the pictures I’ve wanted. I’m stopped in at hte library to use the wifi. It was sprinkling when I arrived and is pouring down buckets now.

They’ve changed the library a lot since I was a kid: an entire row of shelves has been removed, there’s a designated teen area, and they’ve added a lot of genealogy material. They don’t limit it to the Southeast, though, as ACLD does, but they do have some very interesting stuff like microfilms of correspondence with the Bureau of Indian Affairs.

They also have a folding table with a checkerboard designed into the top: kind of a minor detail inviting gamers. I would have expected a table like that in the teen area, but it’s in the genealogy section–which probably doesn’t mean anything except that I don’t understand the groups of patrons and their interests.

At the pharmacy

March 31st, 2011

“I left my doctor suddenly, so sorry if this is a stupid question, but is it legal to try to fill a prescription from a doctor you’re no longer seeing?”
“Yeah.”
“Okay, could you fill this? I won’t need it for about a week though.”
“Sure, we’ll put it on file.” [goes to the computer, starts typing] “They don’t make it as a 450 mg, so we’d have to give you 3 150s.”

I looked it up, and 450 mg is apparently the maximum dosage for adults. I’m tempted just to bump it back down to 300 mg and see if that knocks out the nausea, but I’d really much rather have a specialized doctor tell me what to do. I hope Shands contacts me soon.

this is the worst I have felt in four years

March 28th, 2011

Last week: doctor says he’s taking me off Effexor and increasing dosage on Wellbutrin, and it’ll be fine because they’re both SSRIs. I’m skeptical but decide it’ll be okay because he’s the doctor and I’m not, so he should know.

Yesterday: I start the switch and, about six hours later, I have a headache and feel oddly emotional–both cranky and weepy–but for the most part I’m okay.

Today: the headache is much worse, more a migraine really, and it’s hard to think and my throat feels tight and the emotions are worse, and as the day continues the symptoms start stacking up: I can feel my pulse in my forehead and I feel kind of nauseated, then I feel like I’m about to throw up or start crying, or both, and I feel really short of breath and my face is burning and then my co-worker tells me to go home and she’ll stay late for me and she’s really kind of pushy about it so I leave work and start crying on the way home and I can’t stop even though people are staring at me and I look up the meds and they’re not the same, though they’re almost the same–Wellbutrin is an SSRI and Effexor is an SNRI and Effexor is the one I quit taking.. And Effexor studies show a 78% chance of withdrawal symptoms with a long list of them, with the FDA listing about half a dozen as “severe.”

I called the doctor’s on-call number and left a long rambling number explainting that I can’t stop crying and I’m shaking and short of breath I’m dizzy and I feel like I’m going to puke. And I keep telling myself it’s all in my head and the answer comes back “OF COURSE IT’S ALL IN MY FUCKING HEAD. THAT’S WHAT A NEUROTRANSMITTER IS. IT TRANSMITS. BETWEEN NEURONS. IN THE HEAD.” And oh God I need an answer quick I am never taking Effexor again in my life I want to go on the other SNRI I read about that you can go on that you can be on awhile and go off that instead and it’s not nearly as bad.

update: It got worse. After all that there was the uncontrollable trembling, the sweating, the panic attack, the dizziness so intense that the EMTs had to help me down the stairs and outside, one in front holding on to me and one in back propping me up, and then at the hospital I vomited four times in a row, still trembling and sweating and crying, my hands tingling and my legs numb. One of the worst experiences of my life.

The doctor never called me back, which he explained the next day by saying that the previous day had been his birthday. He wanted to put me back on Effexor. I refused outright, telling him I’d never take it again. He wanted to know if it was “just because of the headache,” “just because of the nausea.”

Nothing about being completely incapacitated and put in the hospital suggests to me that “just” is a good way to describe what I was feeling.

I’m trying to arrange for a new doctor.

Hearty vegetable soup

December 11th, 2010

Hearty vegetable soup

1 large onion, chopped
1 potato, chopped
3 carrots, peeled and chopped
3 stalks of celery, sliced
1 32 oz. can crushed tomatoes
1 C. frozen English peas
1 C. frozen green beans
1 C. frozen corn
enough vegetable bouillon cubes to make 8 C.–but use only 6 C. water with it
1/2 tsp. oregano
1/2 tsp. basil
1/8 tsp. cayenne
1 bay leaf
1 tsp. salt
ground pepper to taste

Combine all ingredients in a large pot. Bring to a boil, then lower to a simmer. Simmer, stirring occasionally, till the carrot is tender but not mushy (about 45 minutes). Remove bay leaf.

Add additional salt as desired.

Why texting sucks

December 3rd, 2010

It’s highway robbery:

If you’re getting charged 10¢ per text, with a maximum size of 160 characters, the phone company is charging you 10¢ to transfer 140 bytes.

The average Netflix movie download is 700 MB.
700 MB = 734,003,200 bytes
734,003,200 bytes = 5,242,880 text messages.

If Netflix downloads were priced like a text message, it would cost you $524,288 to download a movie.

Of course, a number of plans charge 20¢ per text, which means you’d have to be a millionaire to watch a movie on Netflix.

things unknown

November 4th, 2010

Hours after a chat with Lesly yesterday about how things are done in one office at work, I remembered a story about an actor who was known more for his body than his acting ability (I can’t remember the guy’s name, or even what films he was in) who came up with what he thought was a pretty good prank on set one day: he’d take a gun loaded with blanks and pretend to shoot himself.

I’m sure it’s not the case on the most shoestring-budgeted indie films, but on any Hollywood film involving guns, there’s a gun expert. The gun expert is there to advise the crew on how guns are used (“don’t yank the trigger; squeeze it”) and, more importantly, how they should never be used. He sees the actor pick up the gun and put it against his head, and he starts shouting “no no no!” and the actor, apparently thinking what a great prank it’ll be, pulls the trigger. Bang, slump, thump: dead.

What he didn’t know was that even a gun loaded with blanks, going off against the side of someone’s head, has enough concussive force to kill the person instantly.

All of which is to say that as a librarian, I should know better than to make assumptions, especially about fields in which I’ve never worked.

Thanks, Lesly.

minor observations on Dr. Who

October 13th, 2010

I started watching Dr. Who with the 9th Doctor, Christopher Eccleston, and have really come to like it. I’d seen parts of episodes before, years prior, while sitting down to dinner, and even the odd full episode, but with no frame of reference they didn’t impress me much (and, even with a frame of reference, I still can’t believe the TARDIS “falling through a crack in time” in that one Cybermen two-parter–utter baloney, that).

Some time towards the end of David Tennant’s tenure (near the end of Season 3, I think) I started watching the William Hartnell years, though slightly out of order. Netflix has the discs out of order, and the page I looked up which supposedly sorts it all out still has some of the discs out of order. So far I’ve seen the intro arc, the cavemen arc, the first Dalek story (when the Daleks and the Doctor first meet each other, and the Daleks aren’t constantly seething with rage), the one where they’re trapped on the TARDIS, the Keys of Marinus, and the Aztec arc. The Marco Polo arc should have been in there but wasn’t yet, leaving me a bit puzzled when Ian showed up at the start of the Keys of Marinus in an Asian outfit.

William Hartnell’s Doctor is, at first at least, apparently not very smart. The first person he outsmarts is a caveman, and (unless there’s a mystery in the Marco Polo stories) it’s not until The Keys of Marinus that he solves a proper mystery.

The Dalek arc shows The 1st Doctor susceptible to radiation poisoning though the 10th Doctor, in the episode where Martha and the hospital are taken to the moon, can absorb and discharge low level radiation at will.

The sonic screwdriver hasn’t yet made an appearance, unless it was the small pen flashlight that the Doctor gave Ian to use in the Aztec tunnel (Ian only used it as a flashlight; the Doctor didn’t mention any other capabilities, and only referred to it as “this”).

There has been no use of psychic paper yet. I suspect that’s something created for the 9th Doctor (and its use is inconsistent in the new series–the 10th Doctor used the paper, rather than the sonic screwdriver, to convince the double decker that he’d paid bus fare).

The studio sets are painfully obvious; people frequently are meant to be out of earshot of each other but plainly are not. Many of the backgrounds are obviously paintings, sometimes even with folds and drapes visible. Scenes of the TARDIS disappearing are plainly shot with models (and the Dalek city was obvious a model as well).

The pacing on these earliest episodes is abysmal–incredibly uneven, with a tendency towards the very slow.

Actors fumble their lines a lot, especially William Hartnell. I wonder if the BBC were so pressed for time and/or money that they couldn’t do takes until people got it right.

In the Aztec arc, some of the people pronounce Tlotoxl “tl-TOX-l” and others “l-TOX-l.”

The TARDIS has several rooms, not just the one.

The Doctor has, in just these few episodes, been puzzled over why the TARDIS does some of the things it does, and doesn’t seem to know how to work it very well. Yet, although he’s the only one working it, the ride is much smoother than it was (will be) with the 9th and 10th Doctors. (And the 11th Doctor indicates that rides in the TARDIS are always bumpy because it’s meant to be operated by an entire team of people.)

The Doctor has a last name, and a granddaughter!

The Doctor has, quite possibly, changed the course of history in the cavemen arc by showing someone how to make fire. Later in the Aztec arc he tells Barbara she can not stop the Aztecs from making human sacrifices, since nothing at all must be changed about history. Then later he makes a pulley to help open the tomb door, and he lets Cameca see him making the pulley although he knows the Aztecs didn’t have them and she recognizes it as something new and interesting.

So far in the early episodes there has been little in the way of ethical quandaries, though the writers came close with Autloc asking “Yetaxa” (Barbara) if she would save her friend and destroy the Aztecs. That’s only close to an ethical quandary because saving Ian wouldn’t actually destroy the Aztecs, since the series has given no indication that the Aztec gods actually exist and that they care what the Aztecs do. The ethical quandaries that the Doctor and his companions face are one of my favorite things about the latest episodes.

The Doctor starts off as really kind of a jerk, though he’s warmed up a bit by the Aztec arc (and does, at least a little, seem to regret leaving Cameca).

The Doctor doesn’t know his history and culture nearly as well as he does later–he does not, for instance, know that making cocoa and sharing it with Cameca is the same as proposing to her.

The Doctor and his companions know how to speak the Dalek language although the TARDIS has never encountered them before. The 9th Doctor tells rose that the TARDIS gets into the companions’ heads and that’s why they can speak languages they’ve never encountered–because the TARDIS has.

on seeing half a movie

April 25th, 2010

For years–before I had Netflix, before Netflix even existed–I looked all over town for a film that came highly recommended called The Gospel According to Matthew. I finally found it one day at Video Rodeo and checked it out. It was amazing–I was enthralled with this film like I’d been with few others. About halfway through, Jesus came walking over the water onto land, opened his mouth to say something to Matthew, and the DVD froze.

I tried cleaning the disk, tried fast forwarding past the scratched part, tried to jump past it with chapter selection, tried to watch it on a different DVD player. Nothing would make the DVD play past the halfway point.

Back at the store they said they’d probably never get a replacement for it–the film was available only as part of a very expensive Pasolini boxed set. They offered me a free rental but that wasn’t what I wanted–I wanted to see the rest of the film.

Years later, the film has been released on its own and the library has a copy. I checked it out some time back, brought it home, and left it on the desk, unwatched, until I had to return it. The film was fixed in my mind as perfect film, and I was worried I’d revisit it and find that it wasn’t.

Today I was watching Slumdog Millionaire, mostly because it’s one of the very few films on the IMDb top 250 that I haven’t yet seen. Early on I decided it was kind of predictable how all of Jamal’s trivia knowledge stemmed from various unpleasant situations in his past, and my mind began to drift off–thinking of Danny Boyle’s films, thinking of British colonialism and liberal guilt, thinking of how the film was described as a crowd pleaser but I thought it was kind of shallow. Thinking, actually, that Jamal wouldn’t have escaped his childhood without carrying some serious baggage, and that his character would most likely be inclined towards detached hookups or clingy abusive relationships.

About halfway through the film, Jamal was hanging out with Latika, Salim had just left, and the DVD froze. When the DVD unfroze, Salim was holding a group of men at gunpoint. The DVD played another three minutes or so and froze again.

Nothing I try will make this DVD play all the way through.

I’m not sure if I’ll watch the rest of it, but in this case it’s not because I think it’s a perfect film. Rather, it’s hitting me as a moderately entertaining watch which isn’t offering me anything new. I feel certain that Jamal will prove himself innocent to the policeman’s satisfaction, that he will walk away with his millions, that he will find Latika, and that they will be reunited happily ever after. I feel certain, too, that Jamal and Latika won’t be immediately robbed–by Salim or anyone else–and won’t have to deal with mountains of taxes, or mountains of bribes to various corrupt officials, that they’ll never be implicated in Amman’s death though Salim probably will, and will suffer it silently, and that the film’s ending will be superficially satisfying.

And I feel certain, finally, that millions of rupees are a poor compensation for a childhood of being raised in the slums, having witnessed a parent’s murder, having been tricked into childhood serfdom and barely escaping being deliberately blinded, having witnessed a second murder (even if it was of a reprehensible character), and having been tortured during questioning for having done nothing wrong.

I wonder if a better film might have been made with that same character, with that same background, with a resolution of not becoming rich but instead of coming to peace with the past and laying it to rest.

PSA: automatic formatting of holds lists

April 2nd, 2010

Some time back I read an article talking about how libraries all over the country were individually recreating the wheel, duplicating effort instead of building on someone else’s. There were various reasons for this mentioned: that some librarians didn’t want to feel obligated to maintain code put out in the public, that some were embarrassed about code they considered subpar, that some workplaces didn’t allow for that sort of sharing, etc.

In Florida, the work done by state and county employees, as well as municipalities, is all considered in the public domain. So in a spirit of sharing, in the hopes it will help someone outside our district, here’s this code I wrote in PHP to format holds lists generated by Sirsi-Dynix (a good system not to have, IMO).

The code is far from perfect, but on my laptop–with my laptop doing the processing, not sending the list out and waiting for a response–a 100-page report gets accepted, processed, and returned streamline in literally just a few seconds. So I’m considering it good enough to call “done” and move on.

The script can of course be modified or extended to fit your own needs, according to your own departmental breakdown and/or stack arrangement. The important thing is that I think it can give a starting point on how to approach the problem of overly verbose lists (it turns a 102-page report into a 66-page one).

With those caveats:


<?php
// check whether the form's been filled out
$list = ($_POST['list']);
$dept = ($_POST['dept']);

// removing extra line breaks at beginning and end
$list = trim($list);

// checking to see if there's actually a list
if (empty($list))
	{
	header("Location: workflows.php?status=notext");
	}

else {
	print "<html>\n<head>\n";
	print "<style type=\"text/css\">";
	print "body {\n    font-family:'Arial', 'Helvetica', sans-serif }";
	print "</style>";
	if ( (empty($_POST['dept'])) || (!isset($_POST['dept'])) )
		{print "<title>Holds list: All</title>";}
	elseif ($dept == 'youthserv')
		{print "<title>Holds list: Youth Services</title>";}
	else // Adult Services
		{print "<title>Holds list: Adult Services</title>";}
	print "</head>\n<body>\n";
	}

$jmedia = array();
$easies = array();
$jnonfic = array();
$jfic = array();
$ya = array();

$anonfic = array();
$av = array();
$afic = array();
$avhs = array();

$detritus = array();

// removing extra spaces throughout
$list = preg_replace('/( ){2,}/', ' ', $list);

// remove repeating header
// remove HOLD PICKUP LIST
$orig = "/HOLD PICKUP LIST/";
$list = preg_replace($orig, "", $list);

// remove Production date
$orig = "/Produced ([A-Za-z]{3}) ([A-Za-z]{3}) ([0-9]{1,2}) [0-9]{2}:[0-9]{2}:[0-9]{2} ([0-9]{4})/";
// first try to store this as a variable for later output
preg_match($orig, $list, $matches);
unset ($matches[0]);
$produced = implode(" ", $matches);

// now remove Production date from header
$list = preg_replace($orig, "", $list);

// remove Production library
$orig = "/Library\:[ ]+[A-Za-z]+(\-[A-Za-z]+)?/";
$list = preg_replace($orig, "", $list);

// Converting line breaks
$list = preg_replace("/( )*\n+/", "<br />", $list);

// Removing extra line breaks
$list = preg_replace("/((<br \/>)+\s+(<br \/>)+\s*)+/", "<br /><br />", $list);
$list = preg_replace("/<br \/><br \/><br \/>/", "<br /><br />", $list);

// to get those stray extra line breaks (tried this other ways. no go.)
$list = preg_replace("/<br \/><br \/>[ ]+/", "<br />", $list);

// Removing copy number
$list = preg_replace("/copy\:[0-9]{0,4}/", "", $list);

// Removing type
$list = preg_replace("/type\:[A-Z]{3,}(\-[A-Z]{2,})?/", "", $list);

// Removing location
$list = preg_replace("/location\:[A-Z]{4,}\s{0,}<br \/>\s{0,}/", "", $list);

// Removing pickup library
$list = preg_replace("/Pickup library\:[A-Z]{3,}(\-[A-Z]{2,})?/", "", $list);

// removing line break between callno. and author
$callno = '/(<br \/><br \/>)([A-Z0-9\.\*\,#&-]+)([ ][A-Z0-9\.\*\,#&-]+)([ ][A-Z0-9\.\*\,#&-]+)?([ ][A-Z0-9\.\*\,#&-]+)?([ ][A-Z0-9\.\*\,#&-]+)?([ ][A-Z0-9\.\*\,#&-]+)?([ ][A-Z0-9\.\*\,#&-]+)?\s?<br \/>/';
$replacement = '$1$2$3$4$5$6$7$8 / ';
$list = preg_replace($callno, $replacement, $list);

$listarr = explode("<br /><br />", $list);

// first 'if' here does branch holds
if ( (empty($_POST['dept'])) || (!isset($_POST['dept'])) ) // branch
	{
		foreach ($listarr as $key => $value)
		{
			// group jmedia
			// send off CD JAZZ so all later CD J[A-Z] are in JFic
			if (preg_match('/^CD JAZZ/', $listarr[$key]))
			{array_push($av, $listarr[$key]);}
			elseif (preg_match('/(SOFTWARE|DVD|VIDEO|CD) J[0-9]+/', $listarr[$key]))
			{array_push($jmedia, $listarr[$key]);}
			elseif (preg_match('/^(SOFTWARE|DVD|VIDEO) (E|J)/', $listarr[$key]))
			{array_push($jmedia, $listarr[$key]);}

			// group easies
			elseif (preg_match('/^E /', $listarr[$key]))
			{array_push($easies, $listarr[$key]);}
			// grabs CDs and Cassettes in area
			// must have grabbed E DVD and VHS first
			elseif (preg_match('/^([A-Z]+[ ])?E [A-Z]+/', $listarr[$key]))
			{array_push($easies, $listarr[$key]);}
			elseif (preg_match('/SNUGGLE/', $listarr[$key]))
			{array_push($easies, $listarr[$key]);}

			// group JNonfic
			elseif (preg_match('/^J[0-9]+/', $listarr[$key]))
			{array_push($jnonfic, $listarr[$key]);}
			// for the rare Jnonfic cassette.
			// CDs will be assumed in media section.
			// must have grabbed DVD and VHS nonfic first
			elseif (preg_match('/ J[0-9]+/', $listarr[$key]))
			{array_push($jnonfic, $listarr[$key]);}
			elseif (preg_match('/JBIO/', $listarr[$key]))
			{array_push($jnonfic, $listarr[$key]);}
			elseif (preg_match('/^BRAILLE J/', $listarr[$key]))
			{array_push($jnonfic, $listarr[$key]);}

			// group Jfic
			elseif (preg_match('/^J[A-Z]+/', $listarr[$key]))
			{array_push($jfic, $listarr[$key]);}
			// grab CDs and Cassettes
			// can't use just '/ J[A-Z]+'/ because
			// it grabs from all genres and callnos
			elseif (preg_match('/(CD|CASSETTE|DIGITAL|L\.P\.|TALKBOOK) J[A-Z]+/', $listarr[$key]))
			{array_push($jfic, $listarr[$key]);}

			// group YA
			elseif (preg_match('/^YA /', $listarr[$key]))
			{array_push($ya, $listarr[$key]);}
			elseif (preg_match('/ YA /', $listarr[$key]))
			{array_push($ya, $listarr[$key]);}

			// grab adult nonfic and bio
			// assumes no adult genres begin with E, J, OR Y
			elseif (preg_match('/^(\*)?BIO/', $listarr[$key]))
			{array_push($anonfic, $listarr[$key]);}
			elseif (preg_match('/^(\*)?[0-9]/', $listarr[$key]))
			{array_push($anonfic, $listarr[$key]);}

			// group adult CDs, CASSETTES, DVDs
			// grabbed CD JAZZ first
			// E, J, YA grabbed already and exited if/then
			// so it should be no problem
			elseif (preg_match('/^(CD|CASSETTE|DIGITAL|DVD|VIDEO|SOFTWARE|TALKBOOK) [A-Z]/', $listarr[$key]))
			{array_push($av, $listarr[$key]);}
			elseif (preg_match('/^(CD|CASSETTE|DIGITAL|DVD|VIDEO|SOFTWARE|TALKBOOK) (\*)?[0-9]/', $listarr[$key]))
			{array_push($av, $listarr[$key]);}

			// group adult fiction, genre, L.P., N.R., VF
			// assumes no adult genres begin with E, J, OR Y
			// BUT: E, J, YA grabbed already and exited if/then
			// so it should be no problem
			elseif (preg_match('/^((L\.P\.|N\.R\.|VF) )?[A-Z]/', $listarr[$key]))
			{array_push($afic, $listarr[$key]);}
			elseif (preg_match('/^(VF) (\*)?[0-9]/', $listarr[$key]))
			{array_push($afic, $listarr[$key]);}

			// things not grouped elsewhere
			else
			{array_push($detritus, $listarr[$key]);}
		}
	}

// this below to give E/J/YA items only.
elseif ($dept == 'youthserv')
	{
		foreach ($listarr as $key => $value)
		{
			// group E/Jmedia
			// do nothing for CD JAZZ so all later CD J[A-Z] are in JFic
			if (preg_match('/^CD JAZZ/', $listarr[$key]))
			{}
			elseif (preg_match('/(SOFTWARE|DVD|VIDEO|CD) J[0-9]+/', $listarr[$key]))
			{array_push($jmedia, $listarr[$key]);}
			elseif (preg_match('/^(SOFTWARE|DVD|VIDEO) (E|J)/', $listarr[$key]))
			{array_push($jmedia, $listarr[$key]);}

			// group easies
			elseif (preg_match('/^E /', $listarr[$key]))
			{array_push($easies, $listarr[$key]);}
			// grabs CDs and Cassettes in area
			// must have grabbed E DVD and VHS first
			elseif (preg_match('/^([A-Z]+[ ])?E [A-Z]+/', $listarr[$key]))
			{array_push($easies, $listarr[$key]);}
			elseif (preg_match('/SNUGGLE/', $listarr[$key]))
			{array_push($easies, $listarr[$key]);}

			// group JNonfic
			elseif (preg_match('/^J[0-9]+/', $listarr[$key]))
			{array_push($jnonfic, $listarr[$key]);}
			// for the rare Jnonfic cassette.
			// CDs will be assumed in media section.
			// must have grabbed DVD and VHS nonfic first
			elseif (preg_match('/ J[0-9]+/', $listarr[$key]))
			{array_push($jnonfic, $listarr[$key]);}
			elseif (preg_match('/JBIO/', $listarr[$key]))
			{array_push($jnonfic, $listarr[$key]);}
			elseif (preg_match('/^BRAILLE J/', $listarr[$key]))
			{array_push($jnonfic, $listarr[$key]);}

			// group Jfic
			elseif (preg_match('/^J[A-Z]+/', $listarr[$key]))
			{array_push($jfic, $listarr[$key]);}
			// grab CDs and Cassettes
			// can't use just '/ J[A-Z]+'/ because
			// it grabs from all genres and callnos
			elseif (preg_match('/(CD|CASSETTE|DIGITAL|L\.P\.|TALKBOOK) J[A-Z]+/', $listarr[$key]))
			{array_push($jfic, $listarr[$key]);}

			// group YA
			elseif (preg_match('/^YA /', $listarr[$key]))
			{array_push($ya, $listarr[$key]);}
			elseif (preg_match('/ YA /', $listarr[$key]))
			{array_push($ya, $listarr[$key]);}

			// officially do nothing for these, so $detritus will work
			elseif (preg_match('/^(\*)?BIO/', $listarr[$key]))
			{}
			elseif (preg_match('/^(\*)?[0-9]/', $listarr[$key]))
			{}

			// officially do nothing for these, so $detritus will work
			elseif (preg_match('/^(CD|CASSETTE|DIGITAL|DVD|VIDEO|SOFTWARE|TALKBOOK) [A-Z]/', $listarr[$key]))
			{}
			elseif (preg_match('/^(CD|CASSETTE|DIGITAL|DVD|VIDEO|SOFTWARE|TALKBOOK) (\*)?[0-9]/', $listarr[$key]))
			{}

			// officially do nothing for these, so $detritus will work
			elseif (preg_match('/^((L\.P\.|N\.R\.|VF) )?[A-Z]/', $listarr[$key]))
			{}
			elseif (preg_match('/^(VF) (\*)?[0-9]/', $listarr[$key]))
			{}

			// things not grouped elsewhere
			else
			{array_push($detritus, $listarr[$key]);}
		}
	}
else // ($dept == 'adultserv')
	{
		foreach ($listarr as $key => $value)
		{

			// CD left out:
			// must test for CD JAZZ first
			if (preg_match('/^((CASSETTE|DVD|VIDEO|L\.P\.|SOFTWARE|DIGITAL|BRAILLE) )?(E|J|YA)/', $listarr[$key]))
			{}
			elseif (preg_match('/^SNUGGLE/', $listarr[$key]))
			{}

			// grab adult nonfic and bio
			elseif (preg_match('/^(\*)?BIO/', $listarr[$key]))
			{array_push($anonfic, $listarr[$key]);}
			elseif (preg_match('/^(\*)?[0-9]/', $listarr[$key]))
			{array_push($anonfic, $listarr[$key]);}

			// group adult CDs, CASSETTES, DVDs
			// grab CD JAZZ first b/c later range skips it
			// must have seen E, J, and Y first and exited if/then
			elseif (preg_match('/^CD JAZZ/', $listarr[$key]))
			{array_push($av, $listarr[$key]);}
			elseif (preg_match('/CD (J|YA)/', $listarr[$key]))
			{}
			elseif (preg_match('/^(CD|CASSETTE|DIGITAL|DVD) [A-Z]/', $listarr[$key]))
			{array_push($av, $listarr[$key]);}
			elseif (preg_match('/^(CD|CASSETTE|DIGITAL|DVD) (\*)?[0-9]/', $listarr[$key]))
			{array_push($av, $listarr[$key]);}

			// group adult VHS, SOFTWARE, TALKBOOK, V.F.
			// must have seen E, J, and Y first and exited if/then
			elseif (preg_match('/^(VIDEO|SOFTWARE|TALKBOOK|VF) [A-D]/', $listarr[$key]))
			{array_push($avhs, $listarr[$key]);}
			elseif (preg_match('/^(VIDEO|SOFTWARE|TALKBOOK|VF) [F-I]/', $listarr[$key]))
			{array_push($avhs, $listarr[$key]);}
			elseif (preg_match('/^(VIDEO|SOFTWARE|TALKBOOK|VF) [K-X]/', $listarr[$key]))
			{array_push($avhs, $listarr[$key]);}
			elseif (preg_match('/^(VIDEO|SOFTWARE|TALKBOOK|VF) (\*)?[0-9]/', $listarr[$key]))
			{array_push($avhs, $listarr[$key]);}

			// group adult fiction, genre, L.P., N.R.
			// must have seen E, J, and Y first and exited if/then
			elseif (preg_match('/^((L\.P\.|N\.R\.) )?[A-D]/', $listarr[$key]))
			{array_push($afic, $listarr[$key]);}
			elseif (preg_match('/^((L\.P\.|N\.R\.) )?[F-I]/', $listarr[$key]))
			{array_push($afic, $listarr[$key]);}
			elseif (preg_match('/^((L\.P\.|N\.R\.) )?[K-X]/', $listarr[$key]))
			{array_push($afic, $listarr[$key]);}	

			// things not grouped elsewhere
			else
			{array_push($detritus, $listarr[$key]);}
		}
	}
// end removals

// clean up detritus so later if/then will work
$detritus = implode("<br /><br />", $detritus);
$detritus = trim($detritus);

	if ($dept == 'youthserv')
	{
		print "<p>HOLDS " . $produced . " // <strong>Media</strong><br />\n";
		print implode("<br /><br />", $jmedia);
		print "\n<br /><br />HOLDS " . $produced . " // <strong>Easies</strong>";
		print "<br />" . implode("<br /><br />", $easies);
		print "\n<br /><br />HOLDS " . $produced . " // <strong>JFiction</strong>";
		print "<br />" . implode("<br /><br />", $jfic);
		print "\n<br /><br />HOLDS " . $produced . " // <strong>JNonfiction</strong>";
		print "<br />" . implode("<br /><br />", $jnonfic);
		print "\n<br /><br />HOLDS " . $produced . " // <strong>YA</strong>";
		print "<br />" . implode("<br /><br />", $ya);
		print "</p>";
	}
	elseif ($dept == 'adultserv')
	{
		print "<p>HOLDS " . $produced . " // <strong>Nonfiction</strong><br />\n";
		print implode("<br /><br />", $anonfic);
		print "\n<br /><br />HOLDS " . $produced . " // <strong>A/V</strong>";
		print "<br />" . implode("<br /><br />", $av);
		print "\n<br /><br />HOLDS " . $produced . " // <strong>Fiction</strong>";
		print "<br />" . implode("<br /><br />", $afic);
		print "\n<br /><br />HOLDS " . $produced . " // <strong>VHS</strong>";
		print "<br />" . implode("<br /><br />", $avhs);
		print "</p>";
	}
	else // branch
	{
		print "<p>HOLDS " . $produced . " // <strong>E/J Media</strong><br />\n";
		print implode("<br /><br />", $jmedia);
		print "\n<br /><br />HOLDS " . $produced . " // <strong>Easies</strong>";
		print "<br />" . implode("<br /><br />", $easies);
		print "\n<br /><br />HOLDS " . $produced . " // <strong>JFiction</strong>";
		print "<br />" . implode("<br /><br />", $jfic);
		print "\n<br /><br />HOLDS " . $produced . " // <strong>JNonfiction</strong>";
		print "<br />" . implode("<br /><br />", $jnonfic);
		print "\n<br /><br />HOLDS " . $produced . " // <strong>YA</strong>";
		print "<br />" . implode("<br /><br />", $ya);
		print "\n<br /><br />HOLDS " . $produced . " // <strong>Nonfiction</strong>";
		print "<br />" . implode("<br /><br />", $anonfic);
		print "\n<br /><br />HOLDS " . $produced . " // <strong>A/V</strong>";
		print "<br />" . implode("<br /><br />", $av);
		print "\n<br /><br />HOLDS " . $produced . " // <strong>Fiction</strong>";
		print "<br />" . implode("<br /><br />", $afic);
		print "</p>";
	}

if ((!empty($detritus)) && ($detritus != "<br /><br />"))
	{
		print "\n<p><strong>Entries that didn't get grouped:</strong>";
		print "\n<br />The following items were on the holds list but couldn't be placed.";
		print "\n<br />If you're seeing this message it's because there is a bug in the program.";
		print "\n<br /><br />Please copy everything below this line and ";
		print "<a href='mailto:";
print "/* YOUR EMAIL ADDRESS GOES HERE */";
print "?subject=HOLDS " . $produced . " for ";
		if (($dept == 'youthserv') || ($dept == 'adultserv'))
			{print $dept;}
		else {print "branch";}
		print "'>email it to "
print "/* YOUR NAME GOES HERE */"
print "</a>.  Thank you!";
		if (($dept == 'youthserv') || ($dept == 'adultserv'))
			{
			print "<br /><br />\n<em>These items may or may not be part of your list:</em>";
			}
		print "<br />" . $detritus . "</p>";
	}
print "</body>\n</html>";

Big thanks to AskMe for their help in figuring out how to approach this project.

Older posts »