Categories
RDF

Creating a PHP Extension out of Redland and Raptor

Recovered from the Wayback Machine.

Since I’ve worked with compiles of Redland before (though long ago), and have Visual Studio 6.0 and am experienced with its use, I’m going to take a shot at creating the PHP extension of Raptor and possibly Redland for Windows. These won’t be a general purpose binary of the libraries. They will be built specifically as extensions for PHP. If anyone has done this before, with VS 6.0, warnings of any odd quirks would be welcome.

C is a powerful language, and I have a lot of respect for it. But I like cross-platform solutions. I like not having to deal with binaries from OS to OS. That’s why I bought into Java long ago, and Perl, PHP, and environments like Mono/C#. However, with each of these languages, you hear folks talk about how they’re ‘too slow’. You ask for specifics, and you’re told they’re ‘too slow’. You ask for requirements, and all you get is ‘too slow’.

Well, sometimes all it takes is a little extra effort, or a fresh perspective, and you might be able to get a cross-platform solution that could work. But you’ll never know because all you get when you ask for details is, “it’s too slow”. Well, chances are the native libraries will also be ‘too slow’, too. How will we know? Without a formal requirement of what’s needed, and specific performance test cases, there’s no way to judge if the native library will even make a difference.

However, I haven’t previously tried creating a PHP extension; this will be a chance to learn something new. These will be external extensions, though, hopefully dropped into PECL, which should be good enough. I wouldn’t try to get PHP to bundle these with the PHP distribution. Too much weight for too little return.

Update:

Unfortunately, I haven’t had success with this porting effort. I’ve put the call out to others to see if I can get some help, but at this time, looks like Redland is staying a Unix-based solution.

And I’ve also been reminded how much I really dislike working with C; about as much I like working with PHP, Perl, Python, and Java. Oh, and now C#.

Sorry to disappoint.

Categories
RDF

A RDF extension in PHP

Danny Ayers points to an RDFWeb discussion entry about providing help with porting the Raptor RDF engine to Windows. Or with getting RDF support built into PHP.

Guys, PHP is open source. You don’t have to get the PHP folks to buy into including it as part of the distribution. What you need to do is provide the stripped down PHP code to handle the RDF parsing, and get this included in something such as PEAR or PECL.

Think “open source” rather than “who knows the insiders”.

Categories
Just Shelley

From eyes, the deleted

Originally deleted from an earlier post: If only we could see each other’s eyes

A couple of days ago while traveling to my favorite walking path, I came to an intersection full of cops and firetrucks. I knew there was an accident, but didn’t know how bad until I moved around the police car blocking my lane and ended up facing on to the actual accident scene. A few yards in front of me was a small car, not unlike my own, somehow flipped on to its roof. Several rescue people surrounded it, helping whoever was inside. The firemen blocked my view of the interior of the car and the accident victims–all except for an arm, lying limp on the road.

I slowed down, at first because I was startled, but then I continued driving slowly past the spot, eyes fixated on the rescurers and that arm. From the periphery of my vision, I noticed a group of people gathered to the side, all as fixated as I was. Luckily the cop directing traffic yelled at me to “Go! Go!”, snapping me out of my revery.

Why we’re fascinated by accident scenes, or photos of hostages being decapitated, or the more gruesome reality TV, is a complex phenomena that is sometimes dismissed too lightly as ghoulish behavior. Staring at a accident or other scene of violence is actually a fairly typical behavior that crosses all cultural boundaries; in fact, not staring usually requires some strength of will. Many times people aren’t even aware that they’re staring, fascinated, at a bloody scene until they’re abruptly reminded, like I was by the cop.

On September 11th, 2001, we were subjected to one of the most significant graphic scenes of all time, and the world sat fixated for hours–days– staring at every available bit of footage available. That is until in an oddly collective moment we rejected even one more moment of looking at smashing planes and collapsing towers.

I see the same sort of fascination in play whenever there’s a violent altercation between people. Groups form around a fight in a bar, and audiences tune in to watch two people scream at each other in a talk show. Two candidates being civil to each other at a debate won’t rate a line in the newspapers; but have those same two candidates spend the entire timing yelling at each other, and it’s frontpage news.

Are political weblogs popular because they bring new perspective? Or are they popular because the topics covered can generate heated discussions in the comments, which the readership laps up like dogs drinking water on a hot day. Billmon from Whiskey Bar recently shut down comments because he couldn’t afford the time to police them–a commendable act. I am curious, though, if his readership will decrease because of it. Will he lose the readers who need the fights?

It is understandable, though not necessarily noble, to stare at accident scenes or read avidly through comments at people swinging verbally at each other. It’s true that if we were all above that sort of thing, we would reach a higher plane of existence. But I like this plane. It has lightning bugs and fat robins, and every once in a while angry writing, edged like a knife and as beautiful as a stormy sky.

However, there’s a world of difference between being a passive viewer to a violent event–or even a participant– and being one who actively encourages such events because they need the excitement or the anger.

I remember when I was in my early 20’s and living in Seattle, an event that took place one night when I and my roommate were waiting at a bus stop in the University District. The stop was in the business section and the time was fairly late, so there weren’t a lot of people about. We had been shopping and both of us had bags of stuff.

Two people were walking toward us and I glanced casually at them, looked away, and then snapped my head back to look again. The young woman was perfectly ordinary, but the man would startle a second look from a marble statue.

He was older, I would say in his 40’s. He had short hair, somewhat thin on top – blond or gray, I couldn’t tell in the streetlight. He was about 5′ 8″, and stocky, very strong looking. He wore khaki pants rolled up to under his knees, shitty tennis shoes with dark dress socks. He also wore a white T-Shirt with a khaki vest, and a white sweatband around his head. So far, nothing too out of the ordinary.

Except that he had hundreds of safety pins stuck everywhere on him. In his clothes, in the band tied around his head, through his lip, ears, eyebrows , in multiple chains around his neck– the man was a walking tailor’s assistant.

You don’t want to stare in the U District – it’s considered rude. But I was taken by surprise and I did stare for several seconds before I looked away. When the couple reached us, the young lady yelled at me, “Who the fuck are you staring at!”

I looked back at them. The woman seemed edgy, almost like she was on drugs. She was thin and jumpy, and moved about with abrupt, jerky movements. She was a pretty thing, elfin, with chin length curly auburn hair, and large dark eyes. Her tone was angry, but her eyes looked sad, hurt. Lonely.

That man, though. Well he was scary. He was looking at me, staring at me, with a half smile on his face and what seemed like lust in his eyes, but it wasn’t a healthy lust based on sex – it was lust for blood. He wanted a fight. He wanted that young woman and me to fight.

I told her that I wasn’t staring at them. I said I was just waiting for the bus, looking in their direction because that was the way the bus was coming. I used the same tone of voice I now use when I talk to the deer in the enchanted forest – low, calm, soothing. Non-threatening. And it seemed to work, she started to calm down.

That is, until the guy said something to her, something I couldn’t quite hear about how I was looking at the young woman because I thought she was funny looking or something to that effect, all the while never once taking his eyes off of me.

Whatever he said set triggered the young woman’s anger and she clenched her fists in front of her and moved closer to me, and then rocked back, and the moved forward again. I was much taller than her and she seemed afraid of me; but at the same time, in a contradiction in movement, she was also being very aggressive.

I continued to talk with her in the same soothing voice, trying to calm her down. My roommate also said something in her quiet, gentle way, and between the both of us, we seemed to calm her down, again.Her hands started to relax, to unclench. She seemed uncertain and started to move back.

Just as we thought we were in the clear, the man said something to her, again, quietly into her ear, never once taking his eyes off my face. This time when she reacted, she moved in, swiftly, and threw a roundhouse kick into my chest area.

The young woman seemed to have had some training because her kick was good form, but there was no strength behind it. All she did was ruffle the tops of the packages I was carrying, and the impact wasn’t much more than someone patting you hard on the chest.

But she did piss me off. It wasn’t so much that I have a temper, which I admit I do; it was more that after previous experience with abusive men, I had promised myself that if anyone ever touched me again in an aggressive or unwelcome manner, I was going to hurt them.

I threw my bags down on the ground and I stepped towards her, looming over her really, on the balls of my feet ready to move in, pick that girl up, and choke the fight out of her. Policemen’s hold and not letting go until she squeaked ‘uncle’. She pulled back, obviously scared, as the guy moved away from her to provide room for the fight.

I don’t know what stopped me. Several things, probably. It was the scared look in the girl’s face, and those damn sad eyes. My roommate also called my name, telling me to just walk away; that it wasn’t worth it. But I think it was that guy, and his blood lust–that look in his face. I just wasn’t going to fight that young woman for a sick fuck like him.

I grabbed my bags, and seeing a car coming down the street, I stepped off the curb and flagged the car to stop. When the driver pulled over, I asked the three guys inside if they would give us a lift. They said sure and I am my roommate got into the car and we took off. I didn’t once look back. I didn’t once look again at the girl, or the man.

But I remember those eyes. I’ll never forget that guy’s eyes and his lust for a fight. I feel them, from time to time, in the back of my mind, looking out at me when I’m reading other weblogs. If only I could see them more clearly, before I react rather than after.

Categories
Books Writing

If it’s so bad why do we love it

Michael Blowhard at 2Blowhards provides a detailed discussion about why you wouldn’t want to write a book. Among the reasons given, such as only a few hundred people make a living at it, he says that writing a book just isn’t fun:

Many people imagine that they’d “fullfill themselves” (whatever that means) if they wrote a book; or that they’d get a deep pleasure out of the craft elements of the job. In fact, writing a book is a lot of work, and often work of a very tedious kind. It’s heavy labor, more akin to building a house than puttering in your basement. (And no one builds a house purely for the pleasure of it.)

But writing a book isn’t something that can be done in a week or a month. It weighs on you; it’s a bear to wrestle into submission, and it’s followed by the (generally) no-fun publishing process. And then you’ve got to endure the almost inevitable commercial disappointment. Imagine going to all the trouble of building your dream house (by hand, naturally) – and then people ignore it.

I do agree with Michael – book writing isn’t done in a week or a month. And during a deadline, or if you’re having trouble with your subject, it can weigh on you. But he’s focusing exclusively on the darker moments of writing.

Sure there are times when the words feel as if they have to be dragged out of your very soul; but then there are other times when your fingers can’t move fast enough in order to keep up with your thoughts. Sometimes you get a good editor, sometimes you don’t, but when you have a good one, the editing process can be enormously satisfying.

And when you get your first copy of the book, what a feeling of accomplishment. The same feeling you get when someone is kind enough to write you and let you know how much they enjoyed the book, or how much the book helped them.

According to Michael, the only reasons why people would consider writing books are:

  • Some hope to hit the jackpot despite the odds
  • Some have a dream about being an author, or taking part in “literature”
  • Some are obsessed lunatics – ie., they feel they just gotta
  • Some don’t know better (these usually never write a second book)
  • Some have other ambitions, and writing a book is a step along the way
  • A handful are determined to be trade-book authors as a career, and know what the game consists of, and have (or think they have) the tenacity, toughness, talent, luck and energy to succeed

I am guilty. I am an obsessed lunatic.

Seriously, Michael Blowhard has good points: writing books is not an easy thing to do; it takes time, discipline, a certain kind of writing ability, and most people who write don’t make a living at it. As for being part of the literary world, well, for most of us, writing a book might get us a cup of coffee at Starbuck’s, but only at one located in a Barnes & Noble. But still, there are some of us tenacious, tough, determined, hopefully talented people who keep at it. Because in the end, the writing’s the thing. That’s one Michael forgot to include in his list.

Categories
Healthcare

Medication for all and for all a good-night

In my writing about parents being real, I made mention of the fact that medication for depression isn’t the solution for all people. I thought afterwards that some might think I’m critical of those who take antidepressants.

I do think that ours is a society that overmedicates, and that too often doctors prescribe antidepressants with a belief that if they help, great; if they don’t, just stop taking the pills and no harm done. These are not aspirin and starting and stopping these medications should only be done under carefully controlled circumstances, and full understanding of the impact.

I also believe that not everyone who is depressed or down needs medication. I chatted with a person on the phone a couple of weeks ago and started to say I was feeling a bit low, and the first thing they asked is whether I had gone to the doctor and been prescribed an antidepressant. It’s becoming a standard practice that rather than listen to another talk things through, suggest they get medicated and come back when they’re more cheerful.

Sometimes when a series of not good things happen, people become depressed as a result. This isn’t a permanent condition. This isn’t an event calling for medication. Sometimes all that’s needed is a nice chat with a good friend, a long hike, or just time to work things through.

But for other people, depression is a very deep and dark place that they can’t pull out of on their own. The roots of the many such depressions are often found in the chemical and it needs the chemical to find a balance. Or sometimes the depression has been around so long, the person needs something to break the cycle of despair they find themselves in. For these people, thankfully there are antidepressants, and good doctors who know when, and when not, to prescribe them.

I didn’t want to give the impression in my earlier writings that I disapprove of antidepression medication; a good friend or loving mate is not a substitute for badly needed medication. At the same time, though, medication isn’t always a substitute for a good friend, a talk, and a walk.