• Nagesh (unregistered)

    FRIST(Y)For some reason this field must not be empty(Y)posted=yes

  • Anon (unregistered)

    split("(.Y.)" "frist?")

  • (cs)

    "Do you like our new website? Please respond with either yes (Y) or no (N)."

    Why is this not working???

  • Justsomedudette (unregistered)

    The real WFT good decision boss? Now that's a frist.

  • DR (unregistered)

    And they implemented WordPress and immediately got hacked.

  • (cs) in reply to Anon

    Obviously, Chad was more of a leg man.

  • (cs) in reply to Anon
    Anon:
    split("(.Y.)" "frist?")
    Why would you ever want to split() on (.Y.) ? Personally, I'd rather join() with them.

    Being a registered user is sad because I don't get any funny captchas on which to comment.

  • letatio (unregistered)

    (Y) giggity

  • Something (unregistered)

    If this had somekind of proper layout, I would not think it would be THAT horrible of a solution to use text files instead of a database. The upside is obviously that you are not likely to get SQL injections, and if advanced querying, performance and safety isn't needed this might be OK.

    Yet I cannot seem to wonder that a harder solution was chosen over an easier solution, where you just make a connection and start querying. Having to parse the files manually seems more like feature creep than anything else.

    CAPTCHA comment: praesent, like a present but with an a

  • Smug Unix User (unregistered)

    He should have split on the RS character. That is what it there for. Text files are perfectly sensible for when this whole database, internet fad goes away.

  • Nagesh (unregistered) in reply to Something
    Something:
    If this had somekind of proper layout, I would not think it would be THAT horrible of a solution to use text files instead of a database.
    The horror was that there was no support at all for updating the database except by manual hacking.
    Yet I cannot seem to wonder that a harder solution was chosen over an easier solution, where you just make a connection and start querying. Having to parse the files manually seems more like feature creep than anything else.
    Opening a database connection is only an easier solution if you already know how to, and know how to set up a database to connect to in the first place. On the other hand, every crappy introduction to any programming language will show you how to do rudimentary text processing, so you don't need to go learn new things in order to do that. Using the tools already in your possession is, if not the easiest path, then certainly the one of least resistance.
  • Nagesh (unregistered) in reply to Smug Unix User
    Smug Unix User:
    He should have split on the RS character. That is what it there for.
    Shouldn't that be something like "Smug TOPS-10 User", then? Unix has always preferred linefeeds and spaces for splitting on.
  • (cs)

    So Kyle sat there like a dummy, not thinking to suggest a new system himself, until his boss pulled him up for being incompetent?

  • (cs) in reply to English Man
    English Man:
    So Kyle sat there like a dummy, not thinking to suggest a new system himself, until his boss pulled him up for being incompetent?

    Maybe he figured the boss was like most clueless IT bosses and held on to that old saw "if it's not broke don't fix it" and that he would have been reprimanded/fired for "wasting time" coming up with a new solution instead of getting his work done?

    We don't know how long he was in the position. Maybe he was the "new guy" and didn't want to stir the pot.

  • AGray (unregistered)

    The real WTF is that we really get a sad ending, because most WTFs are sad endings and we didn't get one, even though upon seeing something like 'phptxtdb', we were all expecting it.

    public bool IsRealWtf(bool expectation = false)
    {
      return expectation == _Ending;
    }
  • (cs)
    Kyle walked Bill through the process. First, he opened i.phptxtdb. This file stored an image name and a base64-encoded representation of the image.

    No wonder it took so long... base64 encoding images by hand is a real pain!

  • (cs) in reply to ObiWayneKenobi

    isn't it a bit unfair to pick on chard when this is clearly an Amateur project? I though this site only highlighted WFT's from professionals.

  • Captcha:nibh (is that one new?) (unregistered)

    The "string split" solution is not actually such a bad method. Sure, you're gonna get a lot of collisions with "(Y)", but how likely do you think that is if you use "(i|=J7}Y&.`Gb)" ?

  • urza9814 (unregistered)

    I did something like this once for a university club, but only because they didn't let us have database access of any kind. Except my solution simply wrote blog entries straight to an RSS file and then read that back to display them. And my solution had an editor page so you never needed to manually enter into the text file. And my solution was (obviously) XML instead of '(Y)' delimited. And I used an existing PHP library to read back the RSS file.

    OK, so I did something not very similar to this once.

  • (cs) in reply to ip-guru

    College radio stations tend to be fairly professional organizations. It's not like it's some club that people do on the side- it's a job which people get paid for.

  • James (unregistered)

    I've done one of those. It started out being database backed, having made the foolish assumption that I might be able to use a database on a server that clearly already had one installed.

    I'm pretty sure the story isn't about mine, though, since it appears to still be running. The last time I had anything to do with it was writing a brief description and apology for the next guy to pick it up. Unless the happy ending was part of the anonymization, of course.

  • (cs) in reply to Smug Unix User
    Smug Unix User:
    Text files are perfectly sensible for when this whole database, internet fad goes away.

    Surely you mean "perfectly cromulent."

  • Pista (unregistered) in reply to ip-guru
    ip-guru:
    isn't it a bit unfair to pick on chard when this is clearly an Amateur project? I though this site only highlighted WFT's from professionals.

    Being done for a business organization (the college radio), it wasn't an amateur project, but a professional one. This is true even if I'd rather cut my tongue instead of calling that guy a "professional"

  • camelotbob (unregistered)

    "College radio stations are small, but highly technical organizations. "

    You smoke what? Seriously, who believes that!??

  • (cs) in reply to Captcha:nibh (is that one new?)
    Captcha:nibh (is that one new?):
    The "string split" solution is not actually such a bad method. Sure, you're gonna get a lot of collisions with "(Y)", but how likely do you think that is if you use "(i|=J7}Y&.`Gb)" ?
    "(i|=J7}Y&.`Gb)"? That's amazing - I've got the same combination on my luggage!
  • (cs)

    I request the radio station to play some Grimbitch, please...

  • (cs)

    How does one even 'overflow the buffer' in PHP? Or is it supposed to mean exhausting the memory?

    EDIT: Actually, that might be fgets... But that one he could've fixed by simply removing the second parameter.

  • JC (unregistered)

    This is all perfectly sensible in a BI enviro.....

    .... oh never mind.

  • xOneca (unregistered) in reply to Captcha:nibh (is that one new?)
    Captcha:nibh (is that one new?):
    The "string split" solution is not actually such a bad method. Sure, you're gonna get a lot of collisions with "(Y)", but how likely do you think that is if you use "(i|=J7}Y&.`Gb)" ?
    You better not to tempt your fate...
  • foo (unregistered) in reply to LoremIpsumDolorSitAmet
    LoremIpsumDolorSitAmet:
    Being a registered user is sad because I don't get any funny captchas on which to comment.
    You do. Just look at other's comments. The few CAPTCHAs in use here have all be commented on, many times.

    So please pick one at random and make your funny comment. But be sure it's the same funny comment made dozens of times before, otherwise some of us might never recover from the shock of the unexpected.

    CAPTCHA: wisi - I wisi had a funny remark on that. LOL! ROFL! How funny!

  • Gazpacho (unregistered)

    (Y)God(Y)

  • foo (unregistered) in reply to @Deprecated
    @Deprecated:
    Kyle walked Bill through the process. First, he opened i.phptxtdb. This file stored an image name and a base64-encoded representation of the image.

    No wonder it took so long... base64 encoding images by hand is a real pain!

    If you can do the JPEG encoding by hand, the additional base64 step is a piece of cake.

  • foo (unregistered) in reply to Captcha:nibh (is that one new?)
    Captcha:nibh (is that one new?):
    The "string split" solution is not actually such a bad method. Sure, you're gonna get a lot of collisions with "(Y)", but how likely do you think that is if you use "(i|=J7}Y&.`Gb)" ?
    If you're the owner of this site, then very likely, since today. :)

    Seriously, random strings (long enough) are fine (see MIME boundaries), unless you need to document them and put the documentation in the "database" itself. Then you have the same escaping problem, whatever you use.

  • Rodnas (unregistered) in reply to ip-guru
    ip-guru:
    isn't it a bit unfair to pick on chard when this is clearly an Amateur project? I though this site only highlighted WFT's from professionals.

    Yes (Y) professionals like Paula Bean.

  • (cs) in reply to Remy Porter
    Remy Porter:
    It's not like it's some club that people do on the side- it's a job which people get paid for.
    Dude... lern 2 em dash. Or at least type two hypens.
  • (cs) in reply to Remy Porter
    Remy Porter:
    College radio stations tend to be fairly professional organizations. It's not like it's some club that people do on the side- it's a job which people get paid for.

    A very clever program would allow a pre-recorded program other than the request slot whereby it can "dynamically" insert based on what the public has requested.

    Of course you would use some kind of online request list.

    However to make it more interesting you can't just play the popular songs or the producer's own choices. The purpose of a request section should be to get some less-usual music played on the show.

  • (cs)

    I wept. Klye, enjoy the programmer's paradise... for all of us!

  • C-Derb (unregistered) in reply to JC
    JC:
    This is all perfectly sensible in a BI enviro.....

    .... oh never mind.

    +1 Best comment of the day so far!

  • Paul Neumann (unregistered) in reply to Zylon
    Zylon:
    Remy Porter:
    It's not like it's some club that people do on the side- it's a job which people get paid for.
    Dude... lern 2 em dash. Or at least type two hypens.
    But side-- is center, isn't it?
  • (cs) in reply to Smug Unix User
    Smug Unix User:
    He should have split on the RS character. That is what it there for. Text files are perfectly sensible for when this whole database, internet fad goes away.

    I think there are a great number of people who have never looked at an ASCII table, so it doesn't occur to them that there are characters outside the range of ones you normally see.

    Of the ones who do realize this I suspect there is an even smaller proportion who know what the likes of FS, GS, RS, and US are for.

    The last thing I worked with that actually used them was ISO/IEC 8211.

  • (cs)
    Kyle cut him off. “I would be happy to. I’ll make the time.”

    Yeah, still in college. By the time Kyle learns how the real world TM operates, he would have said something along the line: "yes, it's possible, you just need to allocate the resources for this".

    I love enterprise environments.

    Oh, and Chad maybe read somewhere that ORM's were evil and some how thought that DB's were evil too... for some reason.

    Finally, TRWTF is using a RDBMS for a CMS.

  • just stop it (unregistered) in reply to Nagesh
    Nagesh:
    Opening a database connection is only an easier solution if you already know how to, and know how to set up a database to connect to in the first place. On the other hand, every crappy introduction to any programming language will show you how to do rudimentary text processing, so you don't need to go learn new things in order to do that. Using the tools already in your possession is, if not the easiest path, then certainly the one of least resistance.

    It's also the path that eventually leads you to believe your hammer is golden.

  • asd (unregistered)

    I've done something similar a long time ago. I was about 14 or 16 back then. Since it was a javascript "app", all the data was initially stored in one big, ugly JS file, like

    stuff[0]["name"] = "foobar"; stuff[0]["type"] = "something"; stuff[0]["price"] = "235";

    stuff[1]["name"] = "moo"; stuff[1]["type"] = "something else"; stuff[1]["price"] = "42";

    so yes, instead of putting it all in a database, or at least in a JSON or XML file, I made the PHP code explode each line at = first, and then at ][ and ], I think. I had no idea about regex either. Also, the JS file was required to have special comments to mark the area to parse.

  • Ralph (unregistered)

    Hey I'd much rather have PHPTXTDB than PHPBINDB because decoding undocumented arbitrarily-formatted binary data structures is even worse! Yes, I'm looking at you, almost-every-proprietary-software-vendor-out-there.

  • (i|=J7}Y&.`Gb) (unregistered) in reply to Captcha:nibh (is that one new?)
    Captcha:nibh (is that one new?):
    The "string split" solution is not actually such a bad method. Sure, you're gonna get a lot of collisions with "(Y)", but how likely do you think that is if you use "(i|=J7}Y&.`Gb)" ?

    (i|=J7}Y&.`Gb) is my name you insensitive clod.

  • Jeff (unregistered) in reply to (i|=J7}Y&.`Gb)
    (i|=J7}Y&.`Gb):
    Captcha:nibh (is that one new?):
    The "string split" solution is not actually such a bad method. Sure, you're gonna get a lot of collisions with "(Y)", but how likely do you think that is if you use "(i|=J7}Y&.`Gb)" ?
    (i|=J7}Y&.`Gb) is my name you insensitive clod.
    Yes but you're just one person; you don't expect the entire world to redesign its software systems just to accommodate you, do you?
  • Oyo (unregistered)

    Chad simply was ahead of his time. Today we call this NoSQL.

  • Some Random Texan (unregistered) in reply to Cbuttius
    Cbuttius:
    Remy Porter:
    College radio stations tend to be fairly professional organizations. It's not like it's some club that people do on the side- it's a job which people get paid for.

    A very clever program would allow a pre-recorded program other than the request slot whereby it can "dynamically" insert based on what the public has requested.

    Of course you would use some kind of online request list.

    However to make it more interesting you can't just play the popular songs or the producer's own choices. The purpose of a request section should be to get some less-usual music played on the show.

    Oh silly me. I thought the request segment was there to let the callers randomize the daily play list, instead of the machine. Expecting people to call in songs that aren't in the top 25 would be madness. After all, people these days think entertainment is supposed to be fed directly to your brain without that harassing superstitious "free will".

    CAPTCHA: ideo - what happens when an idea fades because the thinker can't hold onto original thought for more than a split second.

  • Ryan (unregistered)

    “I would be happy to. I’ll make the time.” Is absolutely the right answer

  • not frist at all (unregistered) in reply to Jeff
    Jeff:
    Yes but you're just one person; you don't expect the entire world to redesign its software systems just to accommodate you, do you?
    I didn't even read the responses to this comment and knew it was some fag linking xkcd. It's not clever. It's not funny. The initial comment was all I needed to know that someone would link the cartoon where the parents iteratively one-up each other on how to screw the school system.

    It was funny to read when it came out. It's even funny when clicking on the Random button on the site and seeing it. It's NOT funny when someone links to it from a one-sentence post and thinks they're so fucking clever to have discovered xkcd.

    You probably still use lmgtfy and think you're so damn clever.

    It means in real life, you're an unoriginal hipster doofus.

    Got anything to do with sanitizing inputs to a SQL database, etc.? Link to Bobby Tables. Got a nerd-project slow-ass turing machine? Like a minecraft logic circuit from redstone? Link to the one where it's some guy alone in the world making a computer out of rocks. Got a story about password security or encryption? Link to the one where they beat the password out of the guy with a wrench.

    Fuck off. You're not clever.

Leave a comment on “PHPTXTDB”

Log In or post as a guest

Replying to comment #:

« Return to Article