"Different" uses of PHP ... - Page 2
Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21

Thread: "Different" uses of PHP ...

  1. #16
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,697
    Quote Originally Posted by laserlight
    I happen to have the script readily available from years ago, and it works!
    Some things just feel like home, right?

    For me that'd usually be something like "echo foo | caesar 13" in the shell.

    However, several of my servers these days don't have the FreeBSD games installed ... so I guess I need to learn PHP or Python's syntax.
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  2. #17
    Senior Member
    Join Date
    Apr 2003
    Location
    Silver Lake
    Posts
    4,845
    Quote Originally Posted by NogDog View Post
    Ooh...I almost forgot: several years ago I found a PHP module that allowed communication with the serial port (Windows only, I think). I put together a localhost page on my laptop that allowed me to control my A/V receiver through it's serial port. It was a geeky kludge that got me by for awhile after the receiver's remote control died, until I found a compatible replacement.
    OK in a fit of insomnia last night I thought of this and couldn't help thinking how nuts it is. Do you have a link to the module? Does it use a socket or something? Hardware interface is something I'm really curious about.
    IMPORTANT: STOP using the mysql extension. Use mysqli or pdo instead.
    World War One happened 100 years ago. Visit Old Grey Horror for the agony and irony.

  3. #18
    High Energy Magic Dept. NogDog's Avatar
    Join Date
    Aug 2006
    Location
    Ankh-Morpork
    Posts
    13,902
    Nope, no idea which one I used. First couple things I see on the web now that look like possibilities: http://www.easyvitools.com/phpserial/index.html and http://www.phpclasses.org/package/36...rial-port.html
    Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." ~ from Nation, by Terry Pratchett

    "But the main reason that any programmer learning any new language thinks the new language is SO much better than the old one is because he’s a better programmer now!" ~ http://www.oreillynet.com/ruby/blog/...ck_to_p_1.html


    eBookworm.us

  4. #19
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,853
    One of my ongoing projects involves automated theorem proving. I wrote a utility to convert to and from file formats common in the field, and over time it's picked up some basic handling of boolean algebra in its own right (unit resolution, conversion to 3CNF, etc.) as part of its transformational repertoire.

    I don't think I'd stoop to writing a line like this in any professional capacity:
    PHP Code:
        $file array_values(
            
    array_filter(
                
    array_map(
                    
    'trim',
                    
    preg_split(
                        
    '/\b0\b/',
                        
    join(
                            
    ' ',
                            
    array_map(
                                
    'collapse_spaces',
                                
    array_map(
                                    
    'trim',
                                    
    preg_grep(
                                        
    '/^\s*-?\d+(\s+-?\d+)*\s*$/',
                                        
    preg_grep(
                                            
    '/^[cp]/',
                                            
    file($filename),
                                            
    PREG_GREP_INVERT))))),
                        -
    1PREG_SPLIT_NO_EMPTY)),
                
    'strlen')); 
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  5. #20
    Senior Member
    Join Date
    Apr 2003
    Location
    Silver Lake
    Posts
    4,845
    Weedpacket, I would not be surprised if you proved Gödel wrong somehow.
    IMPORTANT: STOP using the mysql extension. Use mysqli or pdo instead.
    World War One happened 100 years ago. Visit Old Grey Horror for the agony and irony.

  6. #21
    Senior Member
    Join Date
    Mar 2009
    Posts
    802
    I have used it to clean up text files/logs, sort things, etc. I find it very useful to manipulate string data and arrays.

    I am also considering using it to control my media server where I can search for movies or TV shows and launch via VLC (my media server is also my web server), but I am currently way too busy to even attempt this and currently will just continue with the .NET application I wrote ages ago.
    Declare variables, not war.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •