Monday, April 14, 2008

Getting into AJAX with Prototype

I've been working with PHP for about 5 or 6 years. I first got into using it while working as a Database Admin at Greenville College, trying to write a web based reporting interface for the college's student data system. I had previously been using Perl for everything CGI and PHP made working with databases a lot easier. After taking a job as a network admin at a bank, I had a lot less use for PHP. I used it when I could to 'keep my skills up' on freelance work and Bank intranet stuff. Now I had been hearing about AJAX for a couple years and knew it was something I should pick up. I tried reading a few tutorials on it and learned quickly that it was a little different between browsers and took a bunch of code to get working. All the tutorials I found were more about getting it set up rather than what you did with it. They all started with the Asynchronos JavaScript and XML bit, explained the first half and never said what to do with the XML. Well, after a little playing I put it aside for a while. I recent picked it up again and found the same old tutorials and still no luck. I asked an old co-worker of mine Dan Coulter who wrote the phpflickr class if he could give me some assistance. He pointed me to Prototype which is a JavaScript framework that makes dealing with AJAX much nicer. At first I thought it was all about the AJAX, but it isn't. It really makes JavaScript much easier to use cross-platform. First of all there is a utility function for accessing DOM elements. It looks like this

$('myelement')

This returns the element with the ID of myelement. Want to change the content of a DIV called stuff?

$('myelement').update('New Content');

even better the $$() function lets you get lists of objects like

$$('div');

Would return an array of all the div tags in your document or

$('div.myclass');

would return all divs with the class 'myclass'

But what about AJAX?

As I have learned recently AJAX is less about the acronym and more about making calls to other web pages without reloading the current page. This is where PHP & AJAX really make nice friends. With Prototype, making an AJAX call is this simple:

new Ajax.Request('mypage.php',{method:'get'});

This basically opens a call to the mypage.php page and returns the results to the browser. Now this example doesn't do anything with that result. For that you have to extend things a little, and add in the $() stuff

new Ajax.Request('mypage.php',{
method:'get',
onSuccess: function(r){
$('mydiv').update(r.responeText);
}});


This code runs the mypage.php page, takes the results of that page and replaces the contents of the element mydiv with it.

I am still digging into Prototype, and find new things to do with it each time I sit down with it. So, if you are interested in picking up AJAX or just beefing up your JavaScript programming, I would highly recommend it.

Friday, April 11, 2008

Backstage Meetings

I have to say that I am not easily starstruck. My dad was in charge of a lot of conventions when I was young and I met a lot of special guest speakers, in college I was the stage manager or assistant stage manager of the Agape music festival for 3 years and saw and dealt with a lot of artistist there. I ran sound and was stage manager for Nashville North in Taylorville, IL for a couple years, where a lot of big name country acts came through. All that to say I'm generally not impressed by fame. Well, that is until it becomes personal. One of the first cassette tapes I ever owned was Phil Keaggy's Find Me in These Fields and over the years his style has been a major influence of my playing (not that I can play like Phil ) I have seen him in concert a few times. Once on his Crimson and Blue tour back in 1994, on the Keaggy, King, Dente tour, once in a masterclass and concert at Greenville College and last night at Harvester Christian Church. We arrived to find that the "Artist Circle" seating area which we had tickets for was oversold and we had to sit in an "artist circle overflow" area. They were not bad seats, I wasn't really upset by this. At intermission we were told that because of this error, the people who had to sit there would get to have a personal meet and greet with Phil after the show. So after the show we went back and I got to meet Phil. Pretty much a handshake, a couple stupid sounding compliments from me, and a picture. He also gave us all signed copies of his recent CD set, but it was enough. You listen and idolize someone for that long and when you get a chance to meet them face to face, it's pretty cool.

So although I don't easily get starstruck, I do make exceptions.

Monday, November 19, 2007

My Robot has 10,000 Views!

Well, I know it's small change for some, but I was pretty excited to see that my Gibson Robot Guitar Video has over 10,000 views. For those of you who are wondering, I did the animation with Blender. Which is an open source 3d package. Well, Thanks to all who have watched and I'll let you know when you can go vote :)



Sunday, November 18, 2007

Accepting Undeserved Gifts

I recently received a gift. Now mind you, I like gifts, a lot. Who doesn't really? But this was one of those take your breath away sorts of gifts. A gift I did not want to touch in case it was some sort of mistake. But soon it sank in that this brand new guitar in front of me was in fact sent to me by...anonymous. There was no card or tag or from or anything. It did not say who paid the bill or ordered it. It was just sitting there waiting to be picked up, plugged in and played. Being the inquisitive person I am, I immediately called my parents, neither knew a thing about it and so I started trying to figure out who would have done this and WHY! I have ideas of who may have been invovled in this, but I came to a realization. Finding out who sent this gift is not the point. If they wanted a phone call saying thanks, they would have put in a note or called to make sure it arrived intact. Instead, I think the sender of this gift wants me to do what the gift calls for, to be pulled from it's case, tuned up, turned up and played on. To be used in worship is the type of thanks this type of anonymous gift calls for.

Now why has this hit me so hard? I do not deserve this kind of gift. Sure there I days when I feel like I deserve everything I want and then there are days when I know what I have coming and know I deserve every bit of it. Usually the latter is true. But I think that this gift I have received outlines something important. Christ came to earth to die in our place as the biggest undeserved gift ever. We spend so much time trying to figure out why or wrestle with the nuts and bolts of Christian life and forget to just pick up the gift with a greatful heart and use it to the best of our ability. Does Christ expect our thanks? Yes, but I think the thanks he wants is not the thanks that we generally say in our bedtime prayers, but instead using of his gift to glorify his name.

Wednesday, November 14, 2007

Gibson Robot Guitar


Gibson is releasing a self-tuning guitar called the Gibson Robot Guitar. They are having a make your own video contest to win one. So here is my entry....




Hopefully they will add my video to their site soon for voting. I already have over 1000 views on YouTube so at least some people have seen it :) Enjoy.

The Gibson page is here

Wednesday, October 17, 2007

Out with the Old...


So my effects rack of 13 years finally decided to die on me. It was an ART SGX2000 and it just started flaking out. So I have started from the ground up. I have a BOSS volume pedal from many years back that still works great so to that I added a DS-1 Distortion and BD-2 Blues Driver. Also today I got in a CH-1 Chorus pedal. I built a temporary board for them and this is what it looks like. I got the 1-spot 8 pedal power kit and the CoreX2 solderless cable kit. So far I am very happy.

Wednesday, July 11, 2007

The Wishbook

I used to love making wishlists. As a kid I would circle so many things in the Sears "Wishbook", or I would find something I wanted and work hard to save my pennies to get it.

I have kinda gotten out of the habit in recent years, because as a father of 4 I usually do not have any extra cash to spend on myself. But as I go along I have found that day to day life has actually made me stop wishing for things. I don't spend time dreaming of the what ifs. I am not talking about being materialistic, sitting around being jealous of those who have what we want is very unproductive. But I think that wishing for things can be a great motivator for us to tackle new goals, expand our horizons and go after things that may, in our current circumstance, seem unattainable. Things can certainly own us and there ARE wrong reasons for wanting things. To outdo someone or to hoard something, these are not good. On the other hand things can be symbols. Symbols are so important. Take a look at company logos. It is not enough just to have a name, you need a symbol. If we wish for things in our life that are representative symbols of who we want to become, they can not only aid us once we have them, but can motivate us to become that person who 'deserves' that thing, and perhaps help us take our lives in a new direction that we may have only dreamed or wished about.

Recently (as you can see in another blog post of mine) I entered a contest. First place prize is $57,000. I made a decent entry and so I thought "What if I won?" At first my thoughts went to how much debt I could pay off, but then for the first time in a long time I did a little dreaming. My guitar and rig are old, an old rig for a tired guitarist, but then I thought, what if I could spend $$$ on a real setup. So in the spirit of wishing, here is a link to my wishlist of choice.

Guitar Center Wishlist

As you can see, johnnyGizmo wishes to break out of his cubicle and pursue something more. I have a new excitement in my life. I realize that I very well may not win this contest, but the wishing it prompted has given me something that I needed just as much.

Saturday, June 30, 2007

Heinz Ketchup Commercial Entry

I made an entry for the the Heinz "Top This TV Challenge". Check it out. First prize in the contest is $57,000!!! Let me know what you think :)

Download All the Videos from A Given YouTube User with a Simple Script.

I wrote a little Perl script that takes a YouTube username and with the help of FFMPEG, downloads and converts all the public videos that user has posted and converts them to any format FFMPEG supports like mpg or mov.

read more | digg story

Sunday, May 27, 2007

Update and an Observation

Well, its been a while since my last post. We are now very close to completing our paperwork. We have a couple more documents to get and then a lot of photocopying and notorization to get done. The a big chunk of $$$ will get us into the "waiting phase" of the adoption. At that point things will be out of our hands until we get our referal. We are getting closer all the time and it feels like it is taking for ever. I also want to thank the people who have dontated funds either through Chipin or directly to my Paypal account. Your donations certainly have helped us with the costs of this process.

On a different note, I noticed something that I do lately. When I am around my kids, I talk about myself in the 3rd person. Why do I do this? It's not like my kids don't understand the concept of the word "I". But apparently phrases like "Daddy has to go to work" are now how I talk. Well anyway, talk to you all later because Johnny is going crazy :)

Tuesday, March 20, 2007

Our First Donation!!!

Well we had our first donation through ChipIn recently, in response to the getCals program (which is hosted here getCals if you need it) So thanks to your donation (you know who you are!) you have paid for one of our passport photos.

Wednesday, March 07, 2007

Home Study and Ranting about the Child Shopping Network

I am not much of a ranter, but after this short update, I have to vent...

Well, we have made it through the bulk of the dreaded "home study". We have a little more online training to do as well as some infant CPR classes, but it is pretty much done. So now we prepare our final documentation to be notarized, translated, etc. and send off our next big payments to our adoption agency. We were very happy to work with Baptist Children's Home in Mt. Vernon, IL. They were a great organization to work with and were very friendly and helpful.

---BEGIN RANT---

We are hoping within the next few weeks to have our dossier completed and ready to go. Then we wait and save as much money as possible. Visiting El Salvador will not be cheap. We are probably somewhere in the range of $7k - $9k still in fees and travel costs before we can bring our daughter home. It will also take about 10 months for all the paperwork to be processed. It is a long way to go and it really makes me sick when I read about celebrities who jet over to some country pick out a kid and those countries grease the wheels for them like in this case of Angelina Jolie's Vietnam adoption which will only take 3 months. Friends of ours who are adopting from Vietnam who have all their paperwork submitted still plan to wait another full year before they can bring home their child.

These people (Madonna, Angelina, etc) make me sick. They throw their money around, have their lawyers get all their paperwork together, and go get their kid. Then try to look like some sort of humanitarian by bringing home a child that their nanny can take care of. Then there are many people that I know who spend 1-2 years of paperwork, tens of thousands of hard earned dollars, emotionally taxing ages of waiting to do the same process. Do I have sour grapes? Sure. Would I prefer to have millions of dollars to just slap down and bring our little Miley home? Absolutely. But I don't. I just wish more people would be able to see how difficult it is to adopt a child if you are not a 'super-star'. That you have to invest a lot of your time, money, effort, heart and life into bringing this child home. It is certainly not the child-shopping-network that the super-rich get to use when it strikes them that they want a baby without the hassle of that whole getting pregnant thing.

---END RANT---

So anyway, thanks for reading. If you want to make a contribution to our adoption you can of course use the chipin widget on my sidebar.

Thursday, February 15, 2007

The Lost Podcast with Jay and Jack

After the most recent Lost episode "Flashes before your eyes" I called into the Lost Podcast with Jay and Jack and they put my call on the show. Check it out Here and you can check out their website here.

Jay and Jack do 2 podcasts a week, one right after each new episode where they do a rundown of the episode and play listener calls and then a recap show on the following monday. They do give out some spoiler type information, but usually give a good warning to skip ahead when they do. Give them a listen if you like the show Lost on ABC.

johnnygizmo

Wednesday, January 24, 2007

getCals Getting Hosted

I recently got an email offering to host getCals since Google decided I broke their EULA somehow on googlepages. Once I have a new link available, I'll post it here. Also if you have used getCals in the past or get it in the future and want to show your appreciation, you can always use the chipIn box here to make a donation towards our family's adoption of a little girl from El Salvador.

---EDIT---

Well, here it is. Thanks Nick for hosting it for me!

getCals

Adoption Fund Raiser

We have all heard the Internet stories about people posting websites asking for money for this or that, or trading paperclips for mansions or whatever. Well I guess I thought that I would see if I can tap into some of that love to assist in our adoption story. Using a site called Chipin.com, I have set up a fund raiser for our adoption. I put in the most $ we will probably need and gave it a year. If you would like to donate to our cause, please feel free. We will find the funds one way or another to bring little Miley home. Perhaps you can help.


As an update on our process, we are getting done with our paperwork phase and are in the process of doing our 'home study'. Things are moving along. It is hard to think though that we will have to wait for so long after we get the paper and money sent in before we can bring her home.

Thanks for reading
Johnny

Saturday, December 23, 2006

A Simple Juggling Video

I had a little time on my hands and so I grabbed the video camera and did a little juggling so I could see what I looked like. Here is some of that. Some simple diabolo, 4 ball and 5 ball juggling. No tricks to speak of, just basic stuff. So if you are easily bored, don't watch :) And hey I'm even wearing my WJF t-shirt. I'm sure Jason Garfield would be proud (or would hide his head in shame that I am in any way assosicated with the WJF)



Sunday, October 22, 2006

Start of Our Adoption Journey

Well, we got the news last week that we have been accepted by an Adoption agency to begin the process of adopting a child internationally. This is pretty exciting and hopefully in the next 12-18 months we will go to El Salvador and pick up our child. There is lots of paperwork and expenses to the dealt with between now and then and we are trying to get everything in order for it to happen. All told, it will probably end up costing somewhere between $15k-$20k dollars to complete the adoption process, but we are holding fund raisers and are being supported by our family to help cover the costs, but even still it is going to take a lot. If you or anyone you know wants to help by making a donation, send me an email johnny.matthews+adoption@gmail.com. If you can not help financially, that's fine, but we would appreciate your prayers as we follow this path.

Friday, October 20, 2006

Juggling with an Oddball

I've been working on 5 balls for a while now, I don't get as much practice as I would like, so I have been trying to make the most of the few minutes I get here and there. One issue I have with 5 balls is counting throws. I am trying to get certain throw counts solid before moving on.

I have been stuck at 7-8 throws for a while. So last week I picked up 4 balls of one color and 1 of another to act as a sort of "tracer". Now I place the odd ball in the 5th ball position. For me, this is in the palm of my left hand (I start on the left)




Now it is visually very easy to see throw #10 is the 2nd throw of the odd ball. It is also easy to figure other #'s of throws this way. If you wanted 13 throws, put it in the 3rd ball position and it will be the 3rd throw. You just need to know in what order you throw the balls.

Now I'm sure this is not rocket science to anyone, and certainly not a new idea, but I must say in a matter of a couple practices I have gotten to 16 throws after a couple months of only having had qualified a couple of times. Now I can qualify most of the time and am ready to make some upward progress.

I have also thought of a way to introduce an idea that I used to use whe practicing the guitar. I would set my metronome to a tempo where I could accomplish what I wanted to play. Then I gave myself a few tries at that tempo. If I played it to my satisfaction I would bump up a notch, otherwise after a few tries I would go down. So applying this to learning 5 balls. I start with a flash. When I do it well, do 6 throws. Now if I don't get 6 within 3 tries, I go back to 5. If I do get six, I go to seven throws. 3 tries at 7, if I get it I go to eight, otherwise back to six. You get the idea. So using this in conjuction with the oddball, once you learn where to place the oddball for 5-25 throws, it should be an easy game to play to help get the pattern solid without making yourself go insane counting to 8,9,8,9,10,11,10,11,12 etc.

What are your thoughts? How did you work through the initial hump? Let me know what you think.