Cycling and bicycle discussion forums. 
   Click here to join our community Log in to access your Control Panel  


Go Back   > >

Foo Off-Topic chit chat with no general subject.

User Tag List

Reply
 
Thread Tools Search this Thread
Old 06-17-12, 08:00 PM   #1
RubenX 
Look! My Spine!
Thread Starter
 
RubenX's Avatar
 
Join Date: Apr 2008
Location: Kissimmee, FL
Bikes:
Posts: 619
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 1 Post(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
RubenX is offline   Reply With Quote
Old 06-17-12, 09:33 PM   #2
StupidlyBrave 
Chepooka
 
StupidlyBrave's Avatar
 
Join Date: Sep 2006
Location: South Central PA
Bikes: 1990 Trek 1400 7spd; 2001 Litespeed Arenberg 10 speed
Posts: 1,167
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Dual boot centos
StupidlyBrave is offline   Reply With Quote
Old 06-17-12, 09:33 PM   #3
Artkansas 
Pedaled too far.
 
Artkansas's Avatar
 
Join Date: Oct 2005
Location: La Petite Roche
Bikes:
Posts: 12,858
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 1 Post(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.
Artkansas is offline   Reply With Quote
Old 06-17-12, 09:46 PM   #4
wphamilton
rugged individualist
 
wphamilton's Avatar
 
Join Date: Apr 2011
Location: Alpharetta, GA
Bikes: Nashbar Road
Posts: 9,848
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 186 Post(s)
wamp is a LAMP stack for windows including apache and mysql.
wphamilton is offline   Reply With Quote
Old 06-17-12, 10:20 PM   #5
RubenX 
Look! My Spine!
Thread Starter
 
RubenX's Avatar
 
Join Date: Apr 2008
Location: Kissimmee, FL
Bikes:
Posts: 619
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 1 Post(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... :\
__________________
"Hoy es un dia normal, pero yo voy a hacerlo intenso" ~ Juanes

Last edited by RubenX; 06-17-12 at 11:24 PM.
RubenX is offline   Reply With Quote
Old 06-17-12, 11:59 PM   #6
Koobazaur
Senior Member
 
Koobazaur's Avatar
 
Join Date: Jan 2012
Bikes:
Posts: 171
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(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.
Koobazaur is offline   Reply With Quote
Old 06-18-12, 02:00 AM   #7
RubenX 
Look! My Spine!
Thread Starter
 
RubenX's Avatar
 
Join Date: Apr 2008
Location: Kissimmee, FL
Bikes:
Posts: 619
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 1 Post(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
RubenX is offline   Reply With Quote
Old 06-18-12, 12:38 PM   #8
Artkansas 
Pedaled too far.
 
Artkansas's Avatar
 
Join Date: Oct 2005
Location: La Petite Roche
Bikes:
Posts: 12,858
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 1 Post(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.

__________________
"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.

Last edited by Artkansas; 06-18-12 at 12:46 PM.
Artkansas is offline   Reply With Quote
Old 06-18-12, 12:42 PM   #9
bigbenaugust 
derailleurs are overrated
 
bigbenaugust's Avatar
 
Join Date: Feb 2005
Location: KIGX
Bikes: 2009 Fantom CX, 2012 Fantom Cross Uno, Bakfiets
Posts: 1,980
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 7 Post(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, and a Bakfiets
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), 2008 Citizen Folder (2015)
Non-Bike hardware: openSUSE Leap - LinuxMint Debian Edition 2 - Mac OS 10.6 - Android 4.4 - CyanogenMod 13
bigbenaugust is offline   Reply With Quote
Old 06-18-12, 01:02 PM   #10
wphamilton
rugged individualist
 
wphamilton's Avatar
 
Join Date: Apr 2011
Location: Alpharetta, GA
Bikes: Nashbar Road
Posts: 9,848
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 186 Post(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)
wphamilton is offline   Reply With Quote
Old 06-18-12, 01:38 PM   #11
RubenX 
Look! My Spine!
Thread Starter
 
RubenX's Avatar
 
Join Date: Apr 2008
Location: Kissimmee, FL
Bikes:
Posts: 619
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 1 Post(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
RubenX is offline   Reply With Quote
Old 06-18-12, 01:49 PM   #12
wphamilton
rugged individualist
 
wphamilton's Avatar
 
Join Date: Apr 2011
Location: Alpharetta, GA
Bikes: Nashbar Road
Posts: 9,848
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 186 Post(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.
wphamilton is offline   Reply With Quote
Old 06-18-12, 02:20 PM   #13
RubenX 
Look! My Spine!
Thread Starter
 
RubenX's Avatar
 
Join Date: Apr 2008
Location: Kissimmee, FL
Bikes:
Posts: 619
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 1 Post(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
RubenX is offline   Reply With Quote
Old 06-18-12, 02:43 PM   #14
wphamilton
rugged individualist
 
wphamilton's Avatar
 
Join Date: Apr 2011
Location: Alpharetta, GA
Bikes: Nashbar Road
Posts: 9,848
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 186 Post(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.
wphamilton is offline   Reply With Quote
Old 06-18-12, 03:40 PM   #15
RubenX 
Look! My Spine!
Thread Starter
 
RubenX's Avatar
 
Join Date: Apr 2008
Location: Kissimmee, FL
Bikes:
Posts: 619
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 1 Post(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
RubenX is offline   Reply With Quote
Old 06-18-12, 09:50 PM   #16
UmneyDurak
RacingBear
 
UmneyDurak's Avatar
 
Join Date: Dec 2004
Location: NorCal
Bikes:
Posts: 8,552
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 13 Post(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.
UmneyDurak is offline   Reply With Quote
Old 06-19-12, 05:29 AM   #17
RubenX 
Look! My Spine!
Thread Starter
 
RubenX's Avatar
 
Join Date: Apr 2008
Location: Kissimmee, FL
Bikes:
Posts: 619
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 1 Post(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
RubenX is offline   Reply With Quote
Old 06-19-12, 06:41 AM   #18
ahsposo 
Tuetonic Member
 
ahsposo's Avatar
 
Join Date: Jan 2010
Location: Stalag 13
Bikes: A Home Built All Rounder, Bianchi 928, Specialized Langster, Dahon Folder
Posts: 7,064
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 164 Post(s)
Are you running the Hotmail servers this morning by chance?

They're all messed up.
__________________
Quote:
Originally Posted by thelmatimynagle View Post
i glad turn hobbits
ahsposo is offline   Reply With Quote
Old 06-19-12, 07:19 AM   #19
RubenX 
Look! My Spine!
Thread Starter
 
RubenX's Avatar
 
Join Date: Apr 2008
Location: Kissimmee, FL
Bikes:
Posts: 619
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 1 Post(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
RubenX is offline   Reply With Quote
Old 06-19-12, 07:31 AM   #20
spry
location:northern Ohio
 
Join Date: Jul 2006
Bikes:
Posts: 3,586
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
^ This RubenProject TM will leave the kitchen table much cleaner.
spry is offline   Reply With Quote
Old 06-19-12, 07:42 AM   #21
RubenX 
Look! My Spine!
Thread Starter
 
RubenX's Avatar
 
Join Date: Apr 2008
Location: Kissimmee, FL
Bikes:
Posts: 619
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 1 Post(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
RubenX is offline   Reply With Quote
Old 06-19-12, 02:50 PM   #22
jfmckenna
Tiocfáidh ár Lá
 
jfmckenna's Avatar
 
Join Date: Dec 2003
Location: The edge of b#
Bikes: A whole bunch-a bikes.
Posts: 5,440
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 11 Post(s)
I wouldn't run Apache/mySQL/PHP on Windows. You can just as easily build a Linux OS in a VM.
jfmckenna is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -6. The time now is 11:00 PM.