Intergrate Twillio and the Yii Framework

For anyone that wants to integrate the Twillio api with the Yii Framework, here’s a rough guide. Overview: Download the Twilio php api Place the Services folder into your components folder Update your controller Those should be all the steps you need, although I’m looking for a solution to get the code out of the controller and create a Twilio object I can use when I want throughout the application. Comments on how to do that appreciated. Download the Twilio Php API Grab the latest Twilio helper libraries from here: http://www.twilio.com/docs/libraries/ Place the Service folder into your components folder Go /protected/components and place the unpacked Services folder there. You’ll find… Continue reading Intergrate Twillio and the Yii Framework

Image search with images

So this blew me away today. Google’s image search now supports searches… with images. Give it a try with some of their demo images or try uploading your own. I found it working with images that are fairly recognizable. Ahh, more food for the Google-is-only-going-to–make-us-dumber fodder. Give these pictures a go: Success: Fail:

Power consumption in Tokyo since the quake

Since the quake, the people of Tokyo and across Japan have been working hard to reduce power consumption because of the crippled nuclear power situation. The work has been paying off. Comparing to last year’s statistics, Tokyo is being far more efficient with it’s energy. Even on the hotter days, Tokyo has been using less energy than before. Here’s a little graph showing recent data, but if you’d like to see the whole year then head over to the statistics page. You can really see the difference just after the earthquake and now that it’s getting into the hotter months. To make the graph, I used the power consumption stats… Continue reading Power consumption in Tokyo since the quake

PHP: Parse error: syntax error, unexpected T_VARIABLE in…

Yikes, round kick me in the face because I didn’t realize the cause of following error:Parse error: syntax error, unexpected T_VARIABLE in….If you’ve gotten a similar error be sure to look for one thing first. Your semicolons (;)I was missing a semicolon at the end of the line, one line above the one which PHP was reporting the error for.Hope this helps those who run across this error. If there are other causes for getting the unexpected T_VARIABLE error, please let me know!

XML Output with the Yii Framework

My quick solution for getting the Yii Framework to display XML data. I’m just going to give the code from a project that I’m working, so substitute in your own names where necessary. OverviewFiles to create: protected/views/[your_class]/[your_action].php protected/views/layouts/[your_xml_layout].php Files to modify: protected/controllers/[your_controller].php In general, the approach is as follows. Create a layout that wraps our XML and outputs the XML header. Step 1: Create The View FilesFor the layout file, make sure you have at least the bolded text below included: File: protected/views/layouts/[your_xml_layout].php <?php header(“Content-type: text/xml”); ?><?php echo ‘<?xml version=”1.0″ encoding=”UTF-8″?>’?><Response> <Tag><?php echo $content; ?></Tag></Response> I’ll leave it up to you to figure out how you want to wrap your… Continue reading XML Output with the Yii Framework

Rebuilding Picasa Folders on OS X

This fix will only work for those who’ve copied files from a Windows machine and are having trouble getting then to appear in Picasa. Pictures Not Appearing In Picasa After Copy I just imported 40,000 pictures from a Windows box to my MacBook. These were pictures that were taken on my round the world trip in 2010 / 2011. After letting Picasa do it’s magic, I noticed that about 1/3 of the folders weren’t appearing in the folder list on the left hand side. I did a check by going to File > Add Folder to Picasa…, but was dismayed to see that the folders missing were listed there with… Continue reading Rebuilding Picasa Folders on OS X

Should I sign up for an unlimited data plan for Japanese cell phones?

If you’re like me then you want to know if it’s worth signing up for the unlimited data plans offered by Japanese keitai companies. I use KDDI and conveniently lost my old phone somewhere between South Africa and Hong Kong, so upgraded to a smartphone when I got back to Japan. I spent awhile digging around the KDDI web site trying to figure out if it was worth signing up for their unlimited data usage plan. In short :  Double Teigaku Plan :  4.8MB – Unlimited    :  2,100 to 5,900 yen IS Flat Plan        :  Unlimited            :  5,400 yen Cost Breakdown… Continue reading Should I sign up for an unlimited data plan for Japanese cell phones?

Costs for transfering money to Japan from the US with PayPal

For those of you who are interested in transferring money from the United States to Japan with PayPal… I would recommend against it because of super high fees Details of my transfer (July 2011): Amount to receive:     88,000 JPY Amount sent:           91,432 JPY (1,186 USD) Market exchange rate:  79.18 PayPal exchange rate:  77.04 Transaction Charge:When using PayPal across borders you will be charged 3.9% on transfers with a standard account. If you pump up the amount you send or do business with on a monthly basis you might be able to get a rate of 3.5% or so. Either way you’re going to be losing a LOT of money. You… Continue reading Costs for transfering money to Japan from the US with PayPal

Baby Syndrom

I find it odd how every stage of life throws a different set of social pressures at you. There is no avoiding them and the most recent one to come my way is the pressure of having a child. Within the past 6 months friends around me have given birth to four children and the joy with which the talk about the children makes me want one too! Yet, if we have a child, then we are immediately cemented to our location and many of the pleasures that I take part in on a daily basis will go out the window. Not to mention that the pressure of providing for… Continue reading Baby Syndrom

Published
Categorized as 未分類

Built a New Computer

Last weekend I went to Akihabara to purchase a computer. Most places you can go and pick up a computer that is prebuilt and preconfigured, but Akihabara lets you customize and outfit your computer in any way you want. For example, buy computer parts and get a free English lesson as one sign touted. This was the first time that I’ve pieced a computer together from scratch. Something to be proud of? There was a lot of giga-this and that, bus speeds, slot sizes and a thousand other odds and ends to trip up along the way, but I had my trusty advisor and coworker along with me to navigate… Continue reading Built a New Computer

Published
Categorized as 未分類

Happy for ‘Bron

It’s about time LeBron made for some kind of controversy. I read in the ESPN forums about how LeBron should grow up and be more mature and shake hands at the end of the game. I think it was exactly that, immature and selfish, not to congratulate the other team on a great performance on their end. It’s natural to be frustrated and not to want to look your opponent in the eye or give them a pat on the back just after they whopped your ass, but that’s something you grown into. LeBron should be judged heavily for this and maybe a chip or two can be laid on… Continue reading Happy for ‘Bron

Published
Categorized as 未分類

Stuck in the Web

I read about a mother finding her lost child on Facebook after 20 odd years of separation and reminded me of friends that I had been out of touch with since high school or earlier. Conveniently and, admittedly, frighteningly I was able to traverse the deep roots that run deep into the society of America and the world. I was equally fascinated and disturbed that information can be this easily accessed from anywhere in the world. What we put up online will now be forever immortalized in the digital kingdom. Even if I was to remove my account from Facebook, the bots and spiders from Google, the Way Back Machine… Continue reading Stuck in the Web

Published
Categorized as 未分類

Top 10?

In honor of the Cavs historic collapse so far in the playoffs I thought I would try and counteract the negative forces in the universe by helping my bowling team look a little less lowly by winning 4 of 4 tonight. A strong performance in the first and third games pushed us over the edge and we narrowly edged out the 11th place team to grab all four. We were still so far behind the 11th place team in terms of total wins that we are stuck firmly in the cellar, but it was nice to see our win total leap over the 10 win mark. On a personal level… Continue reading Top 10?

Published
Categorized as 未分類

Tron

Watched Tron for the first time today (in its entirety). 1982 release date and computer graphics above and beyond anything else that came out in the late 70’s or early 80’s. The dialog sucked, although the infusion of numerous geeky phrases and puns made up for it a bit. Come on, you scuzzy data, be in there. Come on. Never having seen Tron as a child leaves me feeling joyous and empty. On the one hand, it’s one point missing from the geek column, but on the other hand, it suggests I had other things to occupy my childhood aside from movies. I do remember the video game, which apparently… Continue reading Tron

Published
Categorized as 未分類

May is the best month for sports

The Cavaliers lost today to the Orlando Magic, second loss in three games now and they have yet to dominate a game like they did all regular season. James continues to put up impressive numbers, but I get this sinking feeling that he’s trying to put the whole team on his back. One man can make a difference, but I don’t buy the rhetoric that one man can carry a whole series. The French open has also started. My own foray with tennis succumbed to a rain delay on Sunday. Good since my forearms were pretty tired from climbing in the morning, but bad because I was looking forward to… Continue reading May is the best month for sports

Published
Categorized as 未分類

Climbing at B Pump

B Pump is a climbing gym two stops from Koenji. Located in Ogikubo it is a bouldering mecca for the Tokyo elite climbers. Not including your truly. For the third time in 1 week, I went to the gym. This marks my official return to rock climbing. Between games of tennis and going to the climbing gym, I’m finding a little bit of my old self. Both activities are ones I did extensively when I was younger and hope to revitalize. Like bowling it gives me something to look forward to in the evenings and helps energize me for the days ahead. The B Pump climbing gym:http://www.pump-climbing.com/html/gym/bpump.html

Published
Categorized as 未分類

When you’re feeling blue and want to be bluer

Two songs that bring tears to my eyes, but I love em. Johnny Cash – Hurthttp://www.youtube.com/watch?v=SmVAWKfJ4Go Harry Chapin – Cat’s in the Cradlehttp://www.youtube.com/watch?v=zH46SmVv8SU

Published
Categorized as 未分類

Where should I live in Tokyo?

So you are moving to Tokyo? You want a cool place to live or at least a low down on what your options might be? First let’s start off with the geography of Tokyo. The #1 distinguishing “landmark” is the Yamanote (山手線 – drop the の) line. Either you live inside the Yamanote line or outside of it. The area is oval shaped about 6km wide and 10km tall – roughly Wall Street to the Upper West Side and 1st Avenue to Union City. Living inside the Yamanote line will immediately increase your rent, but you’ll have full access to the Tokyo metro system as well as the Yamanote line… Continue reading Where should I live in Tokyo?

Published
Categorized as 未分類

When do you say you’re sorry?

Saying sorry to someone is a fine line. First, you want to be wrong. Second, you want the other person to be right. Then, I believe, you can feel like you are in a position to say that you are sorry. If you are just guessing that the other person is right then that, of course, no longer makes the fact that you are wrong seem so factual any more. Then there is the case of not admitting you are wrong for fear of not setting a precedent. This is the worst kind of situation to be in when it comes time to resolve an argument. I have always felt… Continue reading When do you say you’re sorry?

Published
Categorized as 未分類

Tennis Time

Tennis with my coworker today out in Chofu. The weather is starting to warm and although I thought it was going to be chilly out there, a few minutes of running around proved that the temperature was just right. My serve was very rusty, but the ground strokes came back to me quite quickly. Playing tennis is my form of zen. When I’m out on the court I think about nothing but the game in front of me. That kind of clarity and reduction of distractions is something hard to come by and I hope that I can get back out on the court again soon. Looking back on the… Continue reading Tennis Time

Published
Categorized as 未分類