Advertise on Bikeforums.net



User Tag List

Results 1 to 22 of 22
  1. #1
    Look! My Spine! RubenX's Avatar
    Join Date
    Apr 2008
    Location
    Winter Springs, FL
    Posts
    539
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    How to take the rust of your PHP programming skills?

    I'll be working on a PHP gig in a couple of weeks and I want to start practicing now as my PHP-fu is very rusty. Last time I had a test server with Linux/Apache/MySql... but now I'm stuck with just a Win7 box.

    How can I convert this Win7 box into a PHP Testing Facility?
    "Hoy es un dia normal, pero yo voy a hacerlo intenso" ~ Juanes

  2. #2
    Chepooka StupidlyBrave's Avatar
    Join Date
    Sep 2006
    Location
    South Central PA
    My Bikes
    1990 Trek 1400 7spd; 2001 Litespeed Arenberg 10 speed
    Posts
    1,155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dual boot centos

  3. #3
    Pedaled too far. Artkansas's Avatar
    Join Date
    Oct 2005
    Location
    La Petite Roche
    Posts
    12,217
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RubenX View Post
    I'll be working on a PHP gig in a couple of weeks and I want to start practicing now as my PHP-fu is very rusty. Last time I had a test server with Linux/Apache/MySql... but now I'm stuck with just a Win7 box.

    How can I convert this Win7 box into a PHP Testing Facility?
    Why not just get a cheap website with php capability.
    "He who serves all, best serves himself" Jack London

    Quote Originally Posted by Bjforrestal View Post
    I don't care if you are on a unicycle, as long as you're not using a motor to get places you get props from me. We're here to support each other. Share ideas, and motivate one another to actually keep doing it.

  4. #4
    rugged individualist wphamilton's Avatar
    Join Date
    Apr 2011
    Location
    Alpharetta, GA
    My Bikes
    Nashbar Road
    Posts
    5,837
    Mentioned
    17 Post(s)
    Tagged
    0 Thread(s)
    wamp is a LAMP stack for windows including apache and mysql.

  5. #5
    Look! My Spine! RubenX's Avatar
    Join Date
    Apr 2008
    Location
    Winter Springs, FL
    Posts
    539
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by wphamilton View Post
    wamp is a LAMP stack for windows including apache and mysql.
    Yes Yes!
    *imagine Rube like the pantene commercial*

    This is it! I got the wamp package for win7 that comes with:

    - WAMPServer 64 bits
    - PHP 5.3.13
    - Apache 2.2.22
    - MySQL 5.5.24
    - XDebug 2.1.2
    - XDC 1.5
    - PhpMyadmin 3.4.10.1
    - SQLBuddy 1.3.3
    - webGrid 1.0

    It installed all the stuff in one click without having to read all the darn HowTOs of every single component. SWEET!

    And to add some more happiness, I also installed Notepad++ and set it to open all the ".php" files. I'm back in business!

    PS: Now if I could just get curl to work on this thing... :\
    Last edited by RubenX; 06-17-12 at 11:24 PM.
    "Hoy es un dia normal, pero yo voy a hacerlo intenso" ~ Juanes

  6. #6
    Senior Member Koobazaur's Avatar
    Join Date
    Jan 2012
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, there's windows versions of apache, php and mysql, I turned my laptop into a web server so I could test code locally.

  7. #7
    Look! My Spine! RubenX's Avatar
    Join Date
    Apr 2008
    Location
    Winter Springs, FL
    Posts
    539
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Well.. it was fun for a while there, trying to figure out why the curl library was not working. Turns out that the 64 version of wamp has the curl broken. Uninstalled 64, installed 32 and is now working.

    now I'm writing an xml parser to properly display my data.
    "Hoy es un dia normal, pero yo voy a hacerlo intenso" ~ Juanes

  8. #8
    Pedaled too far. Artkansas's Avatar
    Join Date
    Oct 2005
    Location
    La Petite Roche
    Posts
    12,217
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RubenX View Post
    now I'm writing an xml parser to properly display my data.
    Watch out, around here you could get in trouble for improper display of data.

    Last edited by Artkansas; 06-18-12 at 12:46 PM.
    "He who serves all, best serves himself" Jack London

    Quote Originally Posted by Bjforrestal View Post
    I don't care if you are on a unicycle, as long as you're not using a motor to get places you get props from me. We're here to support each other. Share ideas, and motivate one another to actually keep doing it.

  9. #9
    derailleurs are overrated bigbenaugust's Avatar
    Join Date
    Feb 2005
    Location
    KIGX
    My Bikes
    2009 Motobecane Fantom CX, 2012 Motobecane Fantom Cross Uno SSCX
    Posts
    1,720
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    centos in a virtual machine of our choice.

    Or use a wire wheel on your Dremel tool... that'll derustify anything.
    --Ben
    Carrboro Bike Coalition - putting the "bike" in "CARrboro" :)
    2011 Motobecane Fantom Cross Uno, 2009 Motobecane Fantom CX
    Previously: 2000 Trek 4500 (2000-2003), 2003 Novara Randonee (2003-2006), 2003 Giant Rainier (2003-2008), 2005 Xootr Swift (2005-2007), 2007 Nashbar 1x9 (2007-2011), 2011 Windsor Shetland (2011-2014)
    Current Linux Usage (by machine): Arch: I Debian: I openSUSE: II

  10. #10
    rugged individualist wphamilton's Avatar
    Join Date
    Apr 2011
    Location
    Alpharetta, GA
    My Bikes
    Nashbar Road
    Posts
    5,837
    Mentioned
    17 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RubenX View Post
    now I'm writing an xml parser to properly display my data.
    Not really fun imho, but may I suggest "cheating" with xsl transform (enable extension=php_xsl.dll in php.ini)

  11. #11
    Look! My Spine! RubenX's Avatar
    Join Date
    Apr 2008
    Location
    Winter Springs, FL
    Posts
    539
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by wphamilton View Post
    Not really fun imho, but may I suggest "cheating" with xsl transform (enable extension=php_xsl.dll in php.ini)
    So that's where they hide the xml parser now? Sneaky smarty pants! They couldn't call it php_xml.dll oh no. Too bad I read this after the 25th nested if statement (very complicated/obfuscated xml data here)... but the way it's looking, it could get to the 400th nested if's... I guess I owe Mr Hamilton a beer.
    "Hoy es un dia normal, pero yo voy a hacerlo intenso" ~ Juanes

  12. #12
    rugged individualist wphamilton's Avatar
    Join Date
    Apr 2011
    Location
    Alpharetta, GA
    My Bikes
    Nashbar Road
    Posts
    5,837
    Mentioned
    17 Post(s)
    Tagged
    0 Thread(s)
    Well, I think it's extension=php_xmlrpc.dll to enable the xml, and the other is for the transform which is an alternative to parsing the dom object. http://w3schools.com/xsl/xsl_transformation.asp

    You might wait on the beer, considering how much of a headache this can be.

  13. #13
    Look! My Spine! RubenX's Avatar
    Join Date
    Apr 2008
    Location
    Winter Springs, FL
    Posts
    539
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by wphamilton View Post
    Well, I think it's extension=php_xmlrpc.dll to enable the xml, and the other is for the transform which is an alternative to parsing the dom object. http://w3schools.com/xsl/xsl_transformation.asp

    You might wait on the beer, considering how much of a headache this can be.
    Nah... the beer goes... it's not gonna be easy but still beats debugging a missing coma in 400 nested if's statements. ATM I'm reading a huge lists of "orders" of a remote server. The XML I get looks kinda like this:

    ------------example-------------------
    <?xml version='1.0' encoding='UTF-8'?>
    <blah blah version x>
    <currentTime>2012-06-18 19:57:08</currentTime>
    <result>
    <rowset name="orders" key="orderID" columns="orderID,clientID,locationID,volEntered,volRemaining,minVolume,orderState,typeID,accountID">
    <row orderID="1234" clientID="111" locationID="222" volEntered="10000" volRemaining="10000" minVolume="1" orderState="0" typeID="333" accountID="555" />
    ...
    -repeat a gazilion time-
    ...
    </rowset>
    </result>
    ------------end example------------------

    I was in the middle of splitting each column item on it's "=" character when I decided to take your suggestion and cheat (libraries are there for a reason).

    But this is just the start. There's gonna be another XML from which I'm gonna get the client's actual address using the clientID. Then yet another XML to get the warehouse addr from the locationID... Then I need to use another site to get estimated travel times between all the addresses... then do some research as per what algorithm could give me an optimized route (TSP, Floyd-Warshall, Breadth-First, Branch, Bound, tinfoil?)...

    I'm starting to understand why the logistics guy at the office was the only guy authorized to have his own coffee machine right there in his cubicle (not to mention the 6 figures salary).

    Good thing this wamp package had mysql too... I'm gonna need it.
    "Hoy es un dia normal, pero yo voy a hacerlo intenso" ~ Juanes

  14. #14
    rugged individualist wphamilton's Avatar
    Join Date
    Apr 2011
    Location
    Alpharetta, GA
    My Bikes
    Nashbar Road
    Posts
    5,837
    Mentioned
    17 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RubenX View Post
    ... Then I need to use another site to get estimated travel times between all the addresses... then do some research as per what algorithm could give me an optimized route (TSP, Floyd-Warshall, Breadth-First, Branch, Bound, tinfoil?)...
    Dijkstra's algorithm. Processing is linear with respect to number of nodes.

    Take care not to accidentally degrade it to the simple "greedy" path algorithm, which is unfortunately cited (incorrectly) in many textbooks.

  15. #15
    Look! My Spine! RubenX's Avatar
    Join Date
    Apr 2008
    Location
    Winter Springs, FL
    Posts
    539
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by wphamilton View Post
    Dijkstra's algorithm. Processing is linear with respect to number of nodes.

    Take care not to accidentally degrade it to the simple "greedy" path algorithm, which is unfortunately cited (incorrectly) in many textbooks.
    Make that 2 beers. And if I succeed on this project, please write my name down in case you ever need an assistant padawan...
    "Hoy es un dia normal, pero yo voy a hacerlo intenso" ~ Juanes

  16. #16
    RacingBear UmneyDurak's Avatar
    Join Date
    Dec 2004
    Location
    NorCal
    Posts
    8,031
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would just use parser and lexer generators hack some grammar together, and call it good. Up front it's a bit more work, but more maintainable that bunch of nested if statements.
    I see hills.... Bring them on!!!
    Stay calm and bring a towel.

  17. #17
    Look! My Spine! RubenX's Avatar
    Join Date
    Apr 2008
    Location
    Winter Springs, FL
    Posts
    539
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    - Lost a whole day troubleshooting mysql... turns out the wamp-included version of mysql doesn't like running off a raid array...
    - Lost quite a few hours troubleshooting phpmyadmin... aparently it sucks for importing *BIG* data dumps... lucky for me, I found some old notes about the "source" command...
    - I had a beer (well, more than one) trying to understand why the dev b4 me put warehouse names on one table, warehouse size on another table, warehouse street number on yet another table, street name on yet another....
    - Had another beer while looking at the output flowing, converting mindless id numbers into meaningful human-readable data..."Orlando Warehouse, 4 million sqr ft, 123 main st, orange county, 6 employees, 7am-5pm, mon-fri"...oh the beauty!

    My PHP pages are getting quite messy... time to start doing some objectification/librarization over here...and I have the right t-shirt for the job:



    Coding makes me happy (when it works)
    "Hoy es un dia normal, pero yo voy a hacerlo intenso" ~ Juanes

  18. #18
    Pentapointed Member ahsposo's Avatar
    Join Date
    Jan 2010
    Location
    On Some Far Away Beach After the Season is Over...
    My Bikes
    A Home Built All Rounder, Bianchi 928, Specialized Langster, Dahon Folder
    Posts
    6,369
    Mentioned
    10 Post(s)
    Tagged
    1 Thread(s)
    Are you running the Hotmail servers this morning by chance?

    They're all messed up.
    Quote Originally Posted by toddles View Post
    If I gotta look up words, it's not worth my time.

  19. #19
    Look! My Spine! RubenX's Avatar
    Join Date
    Apr 2008
    Location
    Winter Springs, FL
    Posts
    539
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ahsposo View Post
    Are you running the Hotmail servers this morning by chance?

    They're all messed up.
    I have nothing to do with neither micro$oft or the omnigoogle. HTFU, read the 5k pages long sendmail conf manual and set up ur own.
    "Hoy es un dia normal, pero yo voy a hacerlo intenso" ~ Juanes

  20. #20
    location:northern Ohio
    Join Date
    Jul 2006
    Posts
    3,568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ^ This RubenProject TM will leave the kitchen table much cleaner.
    --------------------------------------------------------------------------------

  21. #21
    Look! My Spine! RubenX's Avatar
    Join Date
    Apr 2008
    Location
    Winter Springs, FL
    Posts
    539
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by spry View Post
    ^ This RubenProject TM will leave the kitchen table much cleaner.
    ...Fathers of the code, forgive them, for they do not know what they are saying...

    *Rube looks around*

    - Pizza paraphernalia, check
    - Red Bull cans, check
    - Soda cans, check
    - Lots of post it notes, check
    - Multiple books opened, check
    - Several scrap pads with more handwritten notes, check
    - A collection of writing instruments (pens, sharpies, colored sharpies, pencils), check
    "Hoy es un dia normal, pero yo voy a hacerlo intenso" ~ Juanes

  22. #22
    Tiocfáidh ár Lá jfmckenna's Avatar
    Join Date
    Dec 2003
    Location
    The edge of b#
    My Bikes
    A whole bunch-a bikes.
    Posts
    5,401
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    I wouldn't run Apache/mySQL/PHP on Windows. You can just as easily build a Linux OS in a VM.
    If you don't talk to your cat about catnip, who will? =^.^=

Posting Permissions

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