Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
PHP

Journal Journal: Regex gurus, please read 2

I am in need of some help. I'm trying to make a regular expression to parse a chunk of text but I am not having much luck. Mainly because a lot of the text may be optional.

The text may look like this:

Message . . . . : Object Q000006003 in COLOSYS02 type *USRQ deleted.

It could look like this:

From user . . . . . . . . . : QSYS
  Message . . . . : Subsystem is ending controlled.

It could even look like this:

Message . . . . : Job ended abnormally.
  Cause . . . . . : A SIGTERM signal was received for the job. The action for the signal was to terminate the job.

Or like this:

Message . . . . : Job 818753/ONEWORLD/JDENET_K ended on 06/22/05 at 15:53:39; 18 seconds used; end code 30 .
  Cause . . . . . : Job 818753/ONEWORLD/JDENET_K completed on 06/22/05 at 15:53:39 after it used 18 seconds processing unit time. The job had ending code 30. The job ended after 1 routing steps with a secondary ending code of 0. The job ending codes and their meanings are as follows: 0 - The job completed normally. 10 - The job completed normally during controlled ending or controlled subsystem ending. 20 - The job exceeded end severity (ENDSEV job attribute). 30 - The job ended abnormally. 40 - The job ended before becoming active. 50 - The job ended while the job was active. 60 - The subsystem ended abnormally while the job was active. 70 - The system ended abnormally while the job was active. 80 - The job ended (ENDJOBABN command). 90 - The job was forced to end after the time limit ended (ENDJOBABN command). Recovery . . . : For more information, see the Work Management topic in the Information Center, http://www.ibm.com/eserver/iseries/infocenter.

The formatting is not exactly as shown, but slashdot is !helpfully reformating some parts of the ecode tag. The main issue is I need to parse out each of the fields (From User, Message, Cause, Recovery, etc.). These fields may or may not show up in a particular message. This particular message type seems to have the fewest of these types of things to parse. Others that I need to do will have many more with all sorts of gotchas to look out for.

I'd really like to use regex for this since it seems to make things a lot simpler. The other option which seems to involve lots of strpos and substr calls is much uglier (uglier than regex's HA).

I've been trying to play with optional groups, non-greedy matching, etc. but not having a lot of luck. Any help would be much appreciated.

Oh yeah, this is PHP, so I don't have sed or other perl stuff available.

Thank you.

User Journal

Journal Journal: Cryptonomicon fans read this... 4

Today I was looking through my Amazon gold box offers and got this: Crytonomicon 2. After not much digging I also found a link to Cryptonomicon 3. Has anyone heard anything about these? The descriptions seem to be the same for all 3 books, and it doesn't appear to have anything to do with The Baroque Cycle books. If anyone knows anything about this, I'd appreciate it. Mr. Stephenson's site is pretty useless as far as finding out this sort of information and I wasn't able to find anything referring to the two new books (not yet released) on google.

Thanks.

Businesses

Journal Journal: I've started my own ad campaign 10

Since I'm not getting hired to do photoshop work by just sitting on my butt and doing nothing I've decided to start my own series of cross-over ad campaigns. My first is for the Gilette Venus product. You can see it here. As always, clicking the small version goes to a full-size version. Please let me know what you think.

Venus isn't just for women now. Or at least that is the idea.

Programming

Journal Journal: Python Help Requested 2

Thank you to all of you who replied in the last journal and said that you still read this stuff I write. That was nice.

I'm not expecting many or any replies to this one, but if there is someone out there who is reading this and has been playing with PythonChallenge and has reached past level 18, I would appreciate some help. I have been stumped for about 5 or 6 weeks (not really trying all that hard, but not having any new ideas to try out).

So anyway, if anyone's gotten past this particular level, help would be much appreciated.

Enlightenment

Journal Journal: Ask a subset of /. 23

Since I am not sure anyone actually reads this journal any more, I'll try once again to get someone to comment on something.

I recently ran across (recently as in less than 10 minutes ago) this movie site while looking through del.icio.us at work because there's nothing to do.

Anyway, there's one video I found of one of the players in the game saying that there's a misconception that quadriplegics can't move their arms. My understanding was that it was paraplegics who can move their arms and quadriplegics are paralyzed from the neck down. I took at the google dictionary link for both paraplegic and quadriplegic and it seems to agree with what I thought.

My question is, is there some case or circumstance where the guy in the video (who is seen cruising in the Murderball chair, palming and throwing a volleyball) would be considered a quadriplegic? Has the designation of level of paralysis changed?

Spam

Journal Journal: The Gmail spam filter

Over the last 13 months since I got gmail, I've found that the spam filter has been adequate. It started off in the not-so-great category, then improved to the almost-never-misses group, and stays there with an occasianal week of screwing up and letting obvious spam through. The good thing is that very very few emails that weren't spam have ever been trapped as spam.

Fairly recently (last few weeks I think), gmail started putting little blurbs at the top of the email instead of the ads down the side. A lot of times these were blog type article links if I was just looking at a mail index, or perhaps a sponsored link if I were in an email.

Normally if I am in the spam folder, it showed some kind of a recipe involving the SPAM meat-like product. Today the only remaining spam marked as unread was something offering a visa credit card. (I should note that my normal procedure is to go into the spam folder, scan the unread emails for non-spams, have it select all unread emails and mark them as read. When there's only one spam, it's fast to click the spam to set it to unread than to select the unread, and mark unread.)

So anyway, it was the only spam, so I click it to open it and mark it read (image loading is blocked so they have no idea I opened it), and I happened to see what google had placed along the top. It wasn't a SPAM recipe, it was an offer for an unsecured Visa card, so in essence, google spammed me in my own spam folder.

Mars

Journal Journal: Just Desserts Cafe

Recently, SCOTUS judge Souter (and others) approved a bill that would allow businesses to take over land owned by private individuals if the business would provide more tax revenue than the homeowner did.

A commercial developer is trying to get approval to build a hotel at the present location of Justice David Souter's house. HA!

Link is here

Too funny.

User Journal

Journal Journal: Uneven?!?!? 8

What.... the.... ?!?!

I look in the mirror today at work while washing me hands. My right side... like .5 inches lower sideburns than the left side. I, literally, did not catch myself from saying "WTF!" in the middle of work (I said nothing because talking in the men's room is just strange).

That's right, talking. The men's room is the place to go in, do your business and leave*. Don't have a conversation in there. Especially don't have a cell phone conversation. Don't make a call, don't receive a call, and don't continue talking on the phone while you're heading in there.

First off, your aim isn't that great, and with one less hand and less than half the attention given, it's no wonder the floor is wet all day long.

Secondly, if you are in the restroom, let's say sitting, obviously aim is not an issue, so there's got to be another reason.

I'd like to be that reason. I don't want people to talk to me on the phone whilst they are pooping, and I'm sure most people don't either. If you come into the restroom and plop yourself down and start using the phone (either because you called someone or someone called you), if I am sitting in there too, I am going to do my best to embarrass you by making all sorts of sounds in the next stall. I will try to be as flatulent as possible, even resorting to making fart sounds if I have to. I will force things out causing all manner of splashing and gurling sounds. The restroom echos. If they didn't already realize you were talking to them in the restroom by now, they may suggest you go to the doctor and get something checked out.

If I don't know you, I may** even say things like "Water sure is cold today, huh?" to which you should reply "And deep too."

I swear... I'm gonna shave my sideburns evenly one of these days... (Thanks for FK for the topic and some of these words).

* If you happen to bring in reading material, please don't leave it in the restroom and if you're going to do that sort of thing anyway, please don't share the reading material with your coworkers afterwards or put it on your desk, or worse, theirs, etc. That's just nasty.
** I will not say these things because that would fall under talking in the men's room.

HP

Journal Journal: Anyone have experience with HP notebooks? 4

So yesterday I decided to get a notebook computer and long story short ended up choosing the HP zv6015us from CompUSA. They were low on some advertised model so they were taking $250 off and then still offering the rebates, so it would be $949. It's supposed to be and Athlon 64 - 3500+ with 1GB RAM, 100GB HD, dual layer DVD+/-RW and an ATI x200m I think. Anyway, I am noticing that everywhere I look on this computer it says zv6000, not zv6015us. The BIOS says zv6000, the badge on the notebook (top right of keyboard), etc. I want to know if I got the right machine or if they gave me the wrong one?

Does anyone know if it should say 6015 on the notebook, or will the 6xxx all say zv6000?

Thank you guys very much.

XBox (Games)

Journal Journal: TheCodeMonkey is no more 4

I have called and cancelled my xbox live subscription as of about 3 minutes ago. It was due for renewal tomorrow and I don't have enough time to spend with it right now to justify the small amount of time I do play with it. I believe the yearly subscription works out to about 17 cents / day, but with how little I used it I think it was more like $3-5 / hour.

I'll be back on in a few months, I'm sure, but for now I am taking a break from it. From what the CSR said, I can not get my gamertag back as they hold them forever. Silly policy I think, but whatever. It was a lot of fun playing with the people I've met here. A Lunatic View, MC Hampster, neenee3, Kai Technolust, and redhunter. Thank you all. It was much more fun to play with you guys (and girl) than to pay $5/hour to be called a "fag" by a 13-year-old.

Anyway, I'll be sure to let you all know when I get back online there.

Thanks again.

Entertainment

Journal Journal: I took a picture... 6

You can see it here if you'd like to.

The pic there links to a full size (6.3MP, 3MB) version.

Hope you like it.

Television

Journal Journal: Final Free Frosty Count: 0b111 and state of the crap 6

I managed to score two more today, and I was planning on going on one final run to make it to 9 or 11, but the Survivor thing lasted longer than I thought and I just finished watching the end at 12:37, so it is technically not the weekend any more. It was an interesting experiment and I'll probably be cancelling the filming of the documentary "Frosty-Size Me" due to the fact that after only 7 frosties in 3 days, I am now crapping melted ice cream.

I'm not certain, but a Frosty diet may not be the healthiest thing in the world. This is of course all unscientific, seeing as I didn't get myself checked out by a doctor before hand.

I'm not completely unaccustomed to crapping weird colors actually. Those that don't want to read about that should probably stop here. In the last year and on more than one occasion for each, I have crapped bright white crap, bright yellow crap, bright orange crap, grass green crap, purple crap, blue crap, brown with red polka-dotted crap and now frosty crap. This is in addition to the more normal light brown, brown, dark brown and really dark brown. The first three were due to various medical tests that have been run at various times this year, and the last few were due to some different kinds of colored popcorn. I am guessing there's a lot of food coloring in that popcorn.

Let me tell you though, it can be quite disturbing to crap blue for the first time. After that, it's actually quite hilarious. It brings a whole new meaning to the phrase, "Hey, come 'ere and check this out before I flush it."

Anyway, I didn't mean to turn this into a Turd Report, but I guess I did. Sorry about that... Hopefully you found it funny and not disgusting. That is all. Goodnight.

Toys

Journal Journal: Free Frosty Count: 5 8

After one more errand run, on which I managed to score another 4 frosties, I am up to 5. I did feel a little guilty and I grabbed a chicken club on one trip and a Jr. Bacon cheese on the second. They actually tried to give me four frosties on the second pass through the drive through. I turned them down though. Two at a time makes a good snack.

I am thinking of filming a documentary. I'll call it "Frosty-Size Me". Think it will sell?

The Almighty Buck

Journal Journal: Free Frosty Count: 1 16

I managed to score one measly frosty for free today. I am hoping to greatly increase that number over the next two days. I probably could have asked and received more, but I wasn't aware that the free size is appoximately the smallest amount of frosty you could serve that could conceivably be called a "serving", or a "bite" or a "large mouthful". Ok, it's not that tiny, but it was a 3-4-spoonfuls-and-you're-done type of thing. So ordering 5 or 6 at once would be close to getting a real size frosty.

I tried to jump on and play some Crimson Skies with Neenee3 and CurrentShunts, but they didn't take my game invite and shortly after I logged on they both ran away. I think they were afraid of my mad crazy dog-fight skillz. That or I messed something up. Getting people into a game in Crimson Skies is craptacular compared to how easy and smooth it is in Halo 2.

I watched the MTV xbox 360 thing. It was high on flash and really really low on any sort of useful info. Basically the "leaked" shots of the console are correct, it will be silver and can stand vertically, and the controllers are white and wireless. That's about it. They showed more of Wilmer's face than they did of the game they were playing and they made more of a big deal about how you can "skin" the xbox by getting a new faceplate then they did talking about what was inside the xbox. In fact, they didn't mention what type of disc it reads, how much memory, how fast are the processor(s), or anything. I guess the majority of people picking it up don't really care about that though. I am psyched that every (or maybe nearly every) game will support HDTV in some way. I've been hoping the xbox would support HD but just a few games do. The 733 mhz processor isn't beefy enough to push as many pixels as it needs to for HD. The rumored 3 3.2Ghz processors in the 360 should do the trick though.

Slashdot Top Deals

It isn't easy being the parent of a six-year-old. However, it's a pretty small price to pay for having somebody around the house who understands computers.

Working...