Join Carlo in his adventures through space AND time...

CakePHP & Load Balanced Server

Posted: March 10th, 2010 | Author: Carlo Cruz | Filed under: Uncategorized | No Comments »

Please note when using CakePHP and a load balanced server (multiple server & a database server), use the database way of saving sessions.

Less likely to play up session wise.


Lysterfield

Posted: November 24th, 2009 | Author: Carlo Cruz | Filed under: bike, mountain bike | Tags: | No Comments »

A video of me and a friend of mine doing the Commonwealth Games track at Lysterfield


CakePHP Learnings

Posted: April 28th, 2009 | Author: Carlo Cruz | Filed under: programming | Tags: , , | No Comments »

CakePHP is great, I can’t imagine creating another web application without it or something similar to it. It’s just that sometimes you’ll think “This is how I’d do it normally… But with cake… mmmm.. maybe like this?”. Then if that didn’t work, you’re stuck.

Using the Auth component and trying to create a user account from another Controller that is NOT the “user” controller will lead to weird password hashing. In my experience.

If you want to create files in a certain folder in webroot, most of the time you just need to type in “foldername/file.txt” and not the full path. ie “pdf/stats.pdf” and not “/home/user/htdocs/app/webroot/pdf/stats.pdf”

No matter how many times i’ve used a HABTM relationship before, it still gives me a headache.  Sometimes I feel that sticking to two BelongsToMany relationships would be much easier.

If you have created and modified fields in your table, CakePHP will automatically update it if it does not have a value in the controller.

The manual actually has most of the answers you’re looking for. It’s just sometimes tells you in an obscure or indirect way.

If you want it saved, put it in an array. If that doesn’t save either, put that array in another array.


Bike Brake Failure

Posted: February 8th, 2009 | Author: Carlo Cruz | Filed under: bike, road bike | No Comments »

Today on my way to my Sunday morning ride along beach road, i discovered that my front brakes were malfunctioning and was favouring one side, not to mention the fact that it didn’t release it’s grip on the tyre. I road home a sad puppy with only 5km done for the day.


Heat Wave

Posted: January 29th, 2009 | Author: Carlo Cruz | Filed under: bike, heat, road bike | Tags: , | No Comments »

So hot… 30 degrees and we (mother and I) rode home from the city. Mother did not make it as it was really quite hot. The heat didn’t bother me as much but I could tell that I cannot travel as fast as I normally would had it been cooler.

Long story short, warm is water is not pleasant.


My Mighty Mugg Hunt

Posted: January 27th, 2009 | Author: Carlo Cruz | Filed under: mighty muggs, toys | Tags: , | No Comments »

So it seems that my Mighty Mugg hunt has come to a complete standstill. All the stores that I frequent that sell Mighty Muggs sell that bad ones and do not seem to be getting any new stock soon. I really do not want to have to resort to ebay as I have a love-hate relationship with it. Alas, I will not rest till my collection is complete.

Long story short, I need more toys.


Sunday Bike Ride #1

Posted: January 18th, 2009 | Author: Carlo Cruz | Filed under: Any given sunday, bike, road bike | Tags: , , | No Comments »

I have returned from my sunday bike ride with my Uncles James and Rainier, along with some of their friends. There was 6 of us in the group including myself.

Waking up at 6.20 in the morning is difficult, my uncle, Rainier, even called me at that time. Still couldn’t do it, so I woke up at 6.30. Our meeting point was at the intersection of South Rd and Beach Rd and our ETA from that point was 7.00. Our destination, Mordialloc Pier.

Apon departure of my home to get to the meeting point, I realised a mistake I had made. It was cold, even colder travelling on the bike. I was frantically searching for mail boxes containing the precious and rare junk mail. I had to ride  quite a bit of distance before I acquired said precious documents, but I did and I shoved it up under my jersey. It made me quite warm and the bike breeze bareable.

Apon arrival at the meeting point, James proceeded to introduce me to the othe r cyclists I did not know, Joe, Mike and Alex. I sure do hope those are their correct names. But someone was missing… My 6.20 wake up call had not yet arrived. Dun dun duuuuuuuuuuuuuun. As it turns out, Rainier was just late.

We set off at a nice speed, a comfortable speed, then it kept increasing… and increasing… Until we were “cruising” at 30 km/h. James fell behind at the start, then soon after Mike (yellow jersey guy) did as well. Then we were four. I was behind two people in our pack of 4 and had no trouble keeping up, so I decided to make it more difficult for me and ride side by side with Rainier, with Joe (blue jersey guy) infront of me and Alex infront of Rainier. This was still quite a nice ride for me. Suddenly Joe (blue jersey guy), got tired or something and pulled out to the side. I accepted the challange of behind the pace maker and kept the pace of the 30km/h speed. While I was exerting an enormous amount of energy trying to keep the 30km/h pace, my co-pace maker Alex (red jersey guy), looked like he was taking a casual stroll through park. I was next to him trying to get air into my lungs. Was not a pretty site. After perhaps ~5km I had to pull out of pace making, otherwise I would’ve died. Joe (blue jersey guy) had no trouble reclaiming his pace making throne and I was happy to let him have it.

It was a fast ride for me, I could have kept up the pace making if the road was relatively flat, but it wasn’t, that portion of the ride was hilly and the co pace maker Alex (red jersey guy) kept plowing on up the hills at the same speed.

Rainier eventually got bored and sped ahead of the pack only to wait ahead for us to set the pace  for the rest of the 300m left till our destination.

Afterwards they we were talking about the pace and how that was faster then usual. Great.. on the day I ride, they rode faster then usual. Way to try and kill a guy. James and I started heading back after a little break and Rainier and the rest headed towards Frankston for a bit more of a ride. We rode at a good speed, not too difficult, not too slow. We overtook some people on a hill, and those people overtook us on the way down. There was a crash that we witnessed on a bike when a rider fell off hard. People were quick to assist and direct traffic to avoid further accidents. I did not witness the crash itself but I heard the rider fall and I would not have a clue as to what happened.

The rest of the ride was uneventful and slow as I was pretty burned out by the end of it and the South Road hills were of no help. Especially the 7-11 hill. One thing that didn’t hapen this time was that I didn’t cramp up, which was a good sign, but my back did hurt, which suggests that I need a bigger bike, as it’s only a 50cm bike and i’m 6′1″

Long story short, I need a new bike.


Carlo the Handy Man

Posted: January 5th, 2009 | Author: Carlo Cruz | Filed under: gundam, mighty muggs, revoltech, toys | No Comments »

I have a toy shelf. Did it using a stud finder, drill, and a screwdriver. Couldn’t find the level so the shelf IS crooked.

My Toys

Loading image

Click anywhere to cancel

Image unavailable

Please note, my picture taking skills are indeed worse then my shelf making skills. So the photo is crooked, not so much the shelf, which is also crooked, but not as bad as the picture makes it look.


Project: Double Meta Refresh Update

Posted: December 23rd, 2008 | Author: Carlo Cruz | Filed under: programming | Tags: , , , | No Comments »

I have now implemented a CSV type upload feature for the double meta refresh project that I have happenning. It’s going along pretty well, I haven’t encoutered any problems yet, except for a limitation with the CakePHP framework where a $model->saveAll() wont’ work on a HABTM relationship. But it doesn’t matter.

I’m thinking of opening it up for beta testing in the near future, but if someone wants access now, just drop in a comment and register to the site and I should be able to give you access.

http://www.doublerefresh.com

The task I am trying to accomplish now is to implement the groups for urls. This feature is to replace the per link country redirection to a group based country redirection. So if you have a whole batch of links that you uploaded via CSV, you wouldn’t have to edit each link so that only the US ips get through. You would just edit the group. Saves you lots of time.

Long story short, I need to get this done quicker so I can get rich quicker.


Cramps

Posted: December 18th, 2008 | Author: Carlo Cruz | Filed under: bike | Tags: , | No Comments »

So while I was doing my normal bike route yesterday my legs started cramping up like crazy. At first it wasn’t anything painful, so I just got off the bike drank some water and stretched the calves a little bit. Apon jumping onto the bike everything was feeling all good and peachy until 10 mins later when I had to stop because of cramps. It wasn’t a flat out “OMG CRAMPIIIINNNG” type feeling, it was more of a “oh, that was a weird fee- oh there it is again, why is my calf getting pangs of pain?”.

I decided to turn back earlier then I would normally and lucky I did so as my other leg cramped up really bad. A few tinges of pain then a roaring thunderous applause. Like I had just jumped out of a 747 without a parachute and landed in a 1m deep pool of water, and survived, but in my right calf. That kind of pain. Luckily I slowed down enough so that the fall off my bike was not so bad and I found myself a bench where I could sit down and wait till the pain went away and stretch my calves out in the mean time.

I eventually did get home, but it was a ginger ride home but I seem to be holding up well today.

Long story short, I need more bike accessories so that I don’t cramp.