Friday, March 26, 2010

Mileage Rate Google Gadget

I added my first gadget to Google Gadgets today.  It's a travel mileage rate calculater!  You can find it here:

Please remember to change the settings of the application to your settings.  This can be done with the drop down arrow on the top right corner of the gadget.

Enjoy, and let me know if I should change something with it!

Monday, February 1, 2010

Yii Olde PHP IIS Difficult for Web Services sometimes

I have been trying to set up the Yii framework on my laptop for work on IIS 5.1 so that it will hit a web service (yes, it is work related!). I got to this point after I compared Zend, CakePHP, Seagull, Symfony, and Yii. Obviously, I'm not going to put up the comparison here - for all intents and purposes, I chose Yii. I'm not saying if it's a good choice or a bad choice in here either. This post is about my experiences with it for the past couple of days. It's a nice breather from my normal comics (which I will resume (I even got some cool software for it!)

This does not mean that I won't be doing more comics, but I'm going to start varying my blog content a bit.

A little about me - I do mostly .NET and Java work, and haven't done PHP in years. If it seems I'm bumbling around here, that's because I am.  This is more to document the issues that I found - hopefully, it'll help someone else that stumbles across this article.  If you want to leave a helpful comment, please do!

I'm using PHP 5.3.1 VC9X86 Thread safe found here.
I'm using the Yii framework 1.1.0 found here.
I'm following Larry Ullman's Blog - it has been really helpful as an article to just get started.

1. Install PHP 5.3.1 (yay!  no problems here!)
2. Create a virtual directory in IIS...
Of course, since I just installed PHP, I need to let IIS know that it exists, so I made the following changes as well (Yes, I did try opening up a PHP page without them.  It didn't work so well...):
 3. Download and install Yii!  Since it's just a Zip file, I just grabbed everything and dumped it into the directory my virtual directory was pointed at.
Don't mind the "test" folder under PHP - I created that and I will get to it in a moment.  As you can see, theres demos, framework, and requirements, and 4 other files.

4. Check to see if it worked.  The requirements folder, as I understand, is for just that.  I went to the requirements folder in my localhost: http://localhost/phptest/requirements/: HUZZAH - good enough.
Sweet!  It looks good!
5. I open up my command prompt and navigate to C:\Projects\PHP\framework (the Yii framework) and located yiic.bat.  This bat file creates the basic structure of your website.
Syntax: yiic webapp path/to/directory.
I ran: yiic test C:\Projects\PHP\test

As advertised, it did an awesome job of creating my whole directory!  In fact, if I navigate to http://localhost/phptest/test/, it should open up a working (skeleton) site for me:
Aw, crap.  A Google search gets me this: http://www.yiiframework.com/forum/index.php?/topic/5632-yii-iis-issue/
Apparently, the Assets and Runtime folders that are generated are needed by Yii to cache and persist.  I normally see the permissions on the properties tab of the folder.  However, as my laptop does not have any of that set up, I had to do the following:
Network sharing has to be on for both the assets and the runtime folder.  I opted to bypass the wizard and just do it myself.  This step may be different for you depending on how your environment is set up.

On a refresh of the page, I saw the following error (yeah, another one...  I know, it's actually a warning...)

The culprit is in my php.ini file, where I installed PHP (C:\Program Files\PHP).  Look for the following line:
;date.timezone =

This tells PHP what timezone to use (you can Google it to learn more).  I'm opting to change this line because, apparently, I love running into warnings that are showstoppers...  An alternate would be to change the ini file to not break on mere warnings.  I changed the line to this:

date.timezone = America/Los_Angeles


Note the removal of the semicolon (first character in the line).  Otherwise, this line won't be called.
 
6. Setting up the web service - I created my own web service to work with as I needed it for a demo and may not be able to connect to the internet.  You folks at home can use the sample one provided by the good folks at w3schools - http://www.w3schools.com/webservices/ws_example.asp.  The wsdl can be found here: http://www.w3schools.com/webservices/tempconvert.asmx?WSDL

So, how do I consume a web service?  According to the help docs Yii provides - http://www.yiiframework.com/doc/guide/topics.webservice, it looks like this:

$client=new SoapClient('http://hostname/path/to/index.php?r=stock/quote');
echo $client->getPrice('GOOGLE');
 
This would mean that in order to use the w3schools example, our code would look like this:
 
$client=new SoapClient('http://www.w3schools.com/webservices/tempconvert.asmx?WSDL');
echo $client->CelsiusToFahrenheit('27');
 
The verdict? Not so much.
 
This isn't Yii's fault.  For my research on the internet and lots of trial and error (this example seems to be everywhere), I found the answer.  I don't even remember what website I found it on now.  Apparently, in order to consume a webservice (at least for windows servers), there's more code needed.  The above syntax creates the SOAP request incorrectly, and the service gets nothing instead of '27'.  Not only that, the call returns a stdClass object, causing an error when echo tries to display it.  The error is Object of class stdClass could not be converted to string, in case you're wondering.
 
Let's tackle the calling of the web service first.  What's happening is that, when the SOAP request is being generated, PHP doesn't know where to put the 27.  The CelsiusToFahrenheit call should look like this instead:
$client->CelsiusToFahrenheit(array('Celsius'=>'27'))
The array contains all parameters to be passed in.  'Celsius' tells PHP what the tag to hold 27 is.  I got the tag name from the WSDL description.

This doesn't change the fact that the object returned is an stdClass type.  In order to read the object from it, the code should look like this:
$client=new SoapClient('http://www.w3schools.com/webservices/tempconvert.asmx?WSDL');
echo $client->CelsiusToFahrenheit(array('Celsius'=>'27'))->{'CelsiusToFahrenheitResult'};
The name 'CelsiusToFahrenheitResult' is also found in the WSDL, within the response section.

And that's it (so far)!  I'm not going to put any actual source code here for now.  I may if people are still having problems with this.  So, that's it for now on Web Services using Yii, PHP, and IIS 5.1.  Feel free to use the comments section to ask away.

Thursday, January 28, 2010

Taking a break

Hi all,
Thanks for reading Spam of Dom!

I'm going to take a break from doing comics for a little bit. The whole process of drawing/inking/scanning/coloring/writing/posting is taking far longer than I really want to spend each day doing, so I'm going to do a little discovery effort to streamline my production.

It should improve my quality as well. I'll post what I've decided to go with along with my next comic.

Anyone know of or have any guest comics handy?

Thanks!
Dom

Tuesday, January 26, 2010

Dangers of Facebook 6

<< Previous
All Dom Comics
Next >>
<<Previous
Dangers of Facebook
Next >>
Here's a six panel for today!


I played Bangkok on Mafia Wars.  It's good - a logical next step for the game with the introduction of Factions.  The ability to send envelops of Baht (money) is great too, especially as the jobs themselves don't give you enough money to even buy equipment, much less property.  I don't have enough friends that send me money though, so I'm forced to do mastered jobs until I get enough.

I was able to complete my money laundering collection though!  The reward seems pretty...  an increase in property take would have been better.

Annoyances: the "Get Help" link exists after you have requested help.  It should disappear - it works in all the other cities, why not here?  It's called reuse of code Zynga!

I would really like to see the following features added - a way to change currency from one city to another, even if it is in an incredible ratio ($1000 - 1Baht), and a way to change my politico corruptos into cell phones and the such.  Please, Zynga?

Sunday, January 24, 2010

Prison Shower Scene

<< Previous
All Dom Comics
Next >>
<<Previous
Metamorphosis
Next >>
Thanks Mandy for the guest comics!

Now, back to Dom, who's stuck in his jail themed comics still.  Don't worry, it's coming to a close soon.


My original idea was to have the other prisoners be confused to what exactly the anatomy of a giant pencil monster was like and not know where to place... it.  But I thought I'd bring the old lady's arm back into existance!

On a unrelated note, I had a great weekend =)

Saturday, January 23, 2010

hope is illegal in big corporations

<< Previous
All Dom Comics
Next >>
<<Previous
Guest Comic
Next >>

Friday, January 22, 2010

Mousetrap

<< Previous
All Dom Comics
Next >>
<<Previous
Guest Comic
Next >>


First guest comic! Yay me!

Thursday, January 21, 2010

Blog Addict 5

<< Previous
All Dom Comics
Next >>
<<Previous
Blog Addict
Next >>
I've been... detained for a while.  Busy with all sorts of things.  I haven't had time to draw much - lots of scribbles and ideas, but nothing much offically drawn and inked.  Here's the latest:

So, while I'm in my mental jail, I had a friend offer to do some guest comics.  I thought that was the coolest thing ever!  Woot!

I'm going to go see Eddie Izzard this weekend in San Jose/San Francisco with the wifey's sister and parents, so there will be no updates from me this weekend. That said, everyone have a great weekend!

Monday, January 18, 2010

Benevolence, Part 2

<< Previous
All Dom Comics
Next >>
<<Previous
Metamorphosis
Next >>

Yeah, so I fell off the face of the earth for a while there.
I'm going to give up the date portion of the title, as I haven't updated in a while. Well, hopefully, this gets the ball rolling again. I should change my description to: updates sporadically...

Wednesday, January 13, 2010

January 13, 2010 - Benevolence

<< Previous
All Dom Comics
Next >>
<<Previous
Metamorphosis
Next >>
Ah, why not make todays be on time(ish)?


I've decided that old ladies are hard to draw... especially ones missing an arm!

January 12, 2010 - Blog Addict 4

<< Previous
All Dom Comics
Next >>
<<Previous
Blog Addict
Next >>
I've typed the words instead of writing them out by hand.  Does it look more readable, or is it just an excuse for me to try to cram more words into the comic?

I meant to get this out earlier, I really did.  As soon as Mark McGwire made his announcement, I was like, "That's awesome!  It fits!"
But then, I was told of GameStop's trade in deal ($40 off certain games when you trade in Borderlands).  Considering I bought Borderlands for $40, this was an awesome deal for me!  However, I did like the game, and decided to give it another spin before I traded it in (deal ends the 24th of January).  And I played it, so I never got around to actually doing the comic yesterday.  But it's in today!

Sigh, day late, dollar short as they say.  It's already old news =(

Monday, January 11, 2010

January 11, 2010 - Rule 34

<< Previous
All Dom Comics
Next >>
<<Previous
Rules
Next >>
Ah, good old rule 34 for the internet!

Here's the obligitory link to the Playmobil site.
Here's the site that I stole the photo from - SHHH!

We swapped out our guide dog in training Turner today for another guide dog in training. Her name is Zesty! And she's a handful - so much energy! I'll take a picture tomorrow and put it up with the next post. She's cute!

Sunday, January 10, 2010

January 10, 2010 - Muse

<< Previous
All Dom Comics
Next >>
<<Previous
Metamorphosis
Next >>
So, apparently I've decided to call my giant pencil a muse.  The theory is, they have the inspiration, but instead of just giving it to you, they absorb you and become you.


We had the Insight holiday party last night at Mulvaney's B & L last night.  The food was superb and the service fantastic!  The drinks were strong too, so I had a blast!

Our Christmas gifts from Insight were portable hard drives, so yay!  I can now back up all of my comics :-P

Anyways, I just wanted to get this comic up really quick before I go see my little from Big Brothers Big Sisters of America.  I'm already late as it is!  (and just a plug for them, it's a good cause - your little becomes as much a part of your life as you become of theirs.  Very rewarding)

January 9, 2010 - Blog Addict 3

<< Previous
All Dom Comics
Next >>
<<Previous
Blog Addict
Next >>
So, another late post - is getting eaten by a giant pencil monster an excuse?

Friday, January 8, 2010

January 8, 2010 - Inspiration

<< Previous
All Dom Comics
Next >>
<<Previous
Metamorphosis
Next >>
And this makes me all caught up!  Yes!

 Yeah, I was sitting today on my throne (not the couch as the comic depicts) trying to figure out what to do a comic about.  My ideas come in waves, and I was badly in need of a wave.  So, I'm sitting there, thinking and stuff, and wham!  A weeks worth of stuff hits me!

Enjoy my pencil dude.  You'll be him in a few upcoming strips!

January 7, 2010 - Dangers of Facebook 5

<< Previous
All Dom Comics
Next >>
<<Previous
Dangers of Facebook
Next >>
Ug, let's pretend I put this up yesterday eh? 


I've spent a bit of time lately surfing through my old high school friends on Facebook.  What I do is that I start from someone that actually friended me, and then looking through all of their friends.  If I see someone I knew, I click on them and look through their photos, and all of their friends (security permitting).  It's kind of like cyber stalking, but with no particular target.  And I judge, oh yes do I judge.  It's what Facebook is for, right?

I think I'm being all sentimental about this stuff because my high school reunion is coming up. It's not this year, but 2011. So, I see a lot of friend surfing in this next year! Oh joy...
I wonder if they've found me in the same manner. If they did, then they’re jerk voyeurs that should have friended me! No I’m not a hypocrite! I wonder if they’ve judged me, as I’ve judged them?
Anyways, as you can see, the comic gears are going again. I may have the next one drawn and inked before the day is over (here in California!)

Wednesday, January 6, 2010

January 6, 2010 - Happy Birthday Card

<< Previous
All Dom Comics
Next >>
<<Previous
Cards
Next >>
Happy Birthday January Babies! Good luck this year!

Tuesday, January 5, 2010

January 5, 2010 - Five Second Rule

<< Previous
All Dom Comics
Next >>
<<Previous
Rules
Next >>
If you're curious on what Tofuccoli is, please see the Soylent Green comic.


And yes, this did happen at dinner the other night.  Some bread fell on the dog in the restaurant and the wifey just picked it up and ate it!  Ewww!!!! Fortunately, there was no puking wife later that night!
Here's a picture of the dog in question - excuse my jeans.

Looks nothing like my drawing huh? Turner is a 6 month old guide dog puppy (lab) and we're raising him until he's about a year old.  Easiest and best puppy ever, and I hope he passes (mostly because if he doesn't, then we have to contend with all of our friends and family that want him since he's such an easy dog).  For more information on Guide Dogs for the blind, click here.

Monday, January 4, 2010

January 4, 2010 - Blog Addict 2

<< Previous
All Dom Comics
Next >>
<<Previous
Blog Addict
Next >>
Ah, the adventures of my newly bought drug dealer and I continue...


I also finally set up my blue ray player! I had to buy a component cable from Fry's since the HDMI cable requires my HDTV to have some sort of copyright protection on it, which it doesn't. So we got that and Enchanted. I was debating whether or not to make a comic strip about Giselle trying to figure out what a tampon is for when she's in the real world, but figured that it's a little late, with the movie being released in 2007 and all...

And now begins the first workday of the new year!

Sunday, January 3, 2010

January 3, 2010 - Out In Public 1

<< Previous
All Dom Comics
Next >>
<<Previous
Out In Public
Next >>
Here's a double!

We went out to dinner with Sukhi, Aaron, and Joe last night. Tried Fats, but considering the 1.5 hour wait, we decided to eat at Bravo Pastaria across the street (they also catered at my rehersal dinner). We got sat next to this family, and I wish I could have busted out my Nintendo DS to beat down the kid there. He ate dinner while playing - wtf? Learn to control your kids people!

Ahem, anyways, it was a good day, especially as I beat the wifey twice at Boggle. That's right, I know you read this - I win, you lose! Yeah! *does little happy dance*

Saturday, January 2, 2010

January 2, 2010 - Blog Addict 1

<< Previous
All Dom Comics
Next >>
<<Previous
Blog Addict
Next >>
Ug, I've spent the day trying to figure out how to advertise my blog more. I must have typed in ANAL in the search bar over ten times today. I'm not a pervert (well, I am, but not for typing in ANAL), it's just the number of letters it needs before it autocompletes to Google Analytics. Apparently, I have a readers from the US, Canada, Japan, and Taiwan!

I'm tacking on Google AdSense (yes, I feel like I'm selling out) onto the blogs. I think it will be interesting to see what it pulls from my blog! BWAHAHAHA! I signed up for a couple of comic lists as well.

Did I go outside today? No! I'm not as awesome as my comic guy:

Would I be doing a public service if I started converting drug dealers to street advertisers?

Oh, and if you think my drug dealer impression isn't very good, I blame Chris Rock.

Friday, January 1, 2010

January 1, 2010 - Happy New Year

<< Previous
All Dom Comics
Next >>
<<Previous
Cards
Next >>
It's the first of the year! Woot!