rantings of a geeky mom

The time does fly

June 17, 2009 - 7:41 pm · Leave a Comment

I’ve been busy busy busy the past couple of months. I wrote an entire CMS with Kohana, and have been letting it simmer a bit to give my brain a chance to breathe. I’ve found that if I complete a project and then jump back into it right away, debugging, making notes for missing features, etc, that I get burned out and end up scrapping the entire thing.

Because at some point I plan to sell this CMS (very niche-oriented and AFAIK there are no other CMS’s specifically built for this niche), I decided to go with some sort of licensing. I’ve used phpAudit — really, the standard licensing program for a lot of people — in the past but to be honest I was never overjoyed with it. It always seemed too bulky and I had a lot of problems when I used it before (mostly, timeouts with people’s licenses and I never could get the local license thing working correctly). I also found a licensing module for WHMCS that looked really promising; however, I don’t have $100 for the module + $17/month for WHMCS (besides, I installed the trial of WHMCS and while it seems like an awesome software for hosts I found it way too much for what I needed.

So I decided I would start coding my own licensing app. And I would use cakePHP for it.

Well, I actually started out using Kohana again but I found myself goofing off more and more every day I worked on the app, which is a surefire sign that something isn’t right with it. I think of it as akin to writer’s block. You get to a point with a story (or in this case an app) and you hit a brick wall. It’s nothing you can put your finger on but you just can’t get any farther without feeling like you’re trudging uphill through molasses.

So I started trying out some things with cake and as I sit here, two weeks later, I’m now farther with the app than I was in 3 1/2 weeks with Kohana, and with code that looks a lot neater and less repetitive. I’m pretty pleased with it so far. Hopefully I will be able to start coding the frontend by next week.

On a totally different front I’ve managed to maintain my weight and actually lost a little more than 1/2 a pound since last month — not bad for someone who is not going out of their way to be Health Gal. I’m still doing my best to eat right and watch my portions, I’m just  not being so strict with everything. Trying to keep a habit of taking a walk with my kids after dinner, so that should help too.

→ Leave a CommentCategories: moi

Why is it so hard to make a choice?!

April 7, 2009 - 7:13 am · Leave a Comment

So I’ve been working on OMGSUPERAWESOME© idea for almost 2 months now. I wrote initially about how I was using Kohana, then started trying out CakePHP and CodeIgniter when I saw that the chances of Kohana’s 3.x codebase being compatible with 2.x were slim to null (heh – I love programming humor :) )

I also have been dabbling a mite in Zend Framework, which, I have to say, I find really complicated but also kind of interesting (although the interesting may due to it being a new framework). I’m a bit wary of it, though, since a very simple query to retrieve 3 rows from the database usually gives me a benchmark of .2 – 1.2, whereis in CodeIgniter I’d get a .01 – .3 and Kohana, a .01 – .8.

I think I will probably end up returning to Kohana because the framework just feels right — I feel like it gives me what I need to help me code faster AND better, while allowing me to do the things I want to do. ZF feels like it would end up being way too much for this project and it just doesn’t feel right to me the way Kohana does. And you know, I would have probably stuck with Code Igniter if I didn’t feel like it was 2x as much work to get certain things accomplished (vague, I know; perhaps a topic for another post).

My biggest concern with Kohana is the compatibility between version issues. However, I did read that v3 will likely not be out until mid to late summer this year, so I suppose we’ll just have to wait and see for now.

→ Leave a CommentCategories: moi
Tagged: , ,

Just a couple of updates

March 25, 2009 - 6:58 am · Leave a Comment

I am still working on my OMGSUPERAWESOME project, although I hit a stumbling block and have spent the last 3 or 4 days tearing my hair out.

I mentioned how I had started developing with Kohana. Everything was working well (for the most part)….then I read a post from one of the lead developers that Kohana 3.0’s code would most likely be incompatible with 2.3.x’s. Apparently this is fairly common with Kohana, and I suppose depending on your point of view it can be a good thing or a bad thing. For me this was very bad.

Maybe I’m just stubborn but I like the tools I’m working with to remain somewhat stable between versions. I don’t want to be told that the code I’m writing now will have to be completely reworked to work with the new codebase. That’s a humongous waste of my time, and any users that may be using my software.

So I was playing with the idea of going back to good ol’ CI, but I gotta say — I really did not relish having to go back to writing 2 to 3 times as much code just to get a semblance of the functionality offered from Kohana or one of the other frameworks. Maybe I’m lazy, or maybe I’m just looking to increase my productivity. Maybe both.

So I started playing with CakePHP again, and spent the better part of last Sunday measuring the difficulty of setting up the MVC for a fairly straightforward part of my app. It wasn’t as hard as I was afraid it would be so I continued working with it and slowly have become more impressed with it.

I’m still a little hesitant to say for sure that I will end up sticking with Cake; I’m concerned that if I release my app and someone has an issue that isn’t directly related to my code (ie, it’s an issue having more to do with Cake) it’s going to be a lot harder for me to track down since I’m not as familiar with Cake. I’ve “made up my mind” that I was just going to say **** it and go back to CI only to remember why I was so frustrated with CI in the first place. On the other hand, Cake is a lot more rigid and I find that I end up bending my app around it, whereas with CI it’s more of a silent partner. Of course, with CI it’s pretty easy to end up with a lot of spaghetti code.

Suffice it to say I haven’t definitively made up my mind yet. *sigh*

→ Leave a CommentCategories: moi
Tagged: ,

WOOHOO!!!

March 19, 2009 - 6:21 am · 2 Comments

25 lbs down! Even though it’s taken me something like 8 months to lost 25 lbs, I’m still really excited about this!

Usually when I try to lose some weight I’ll sign up for the gym and/or weight watchers and begin the ancient song and dance of focusing only on healthy healthy healthy. Inevitably I end up falling off the wagon within a few months and gain all the weight back, and usually a few extra.

This time I decided that while I would make a conscious effort every day to eat healthy (and hopefully get some exercise, although that has admittedly been a lot harder to keep up) I was not going to fall into the same habits as last time. I would allow myself chips or a cookie if I wanted some/it — but I would always exercise portion control. So now, instead of grabbing the bag of ruffles when I’m going to indulge in some chips + dip, I put some in a baggie and when they’re gone, that’s it.

I’m cautiously thinking this approach will work and continue working even after I get to my ultimate goal weight, because I”m allowing for the junk food instead of beating myself up over it. I’m (re-)learning that junk food is okay, as long as you don’t overindulge (like I did for so many years).

Now if only I could push myself to go to the gym!

→ 2 CommentsCategories: moi

Frameworks Part Trois (or, Sometimes when you’re right, you’re wrong)

February 22, 2009 - 3:39 pm · Leave a Comment

Yesterday I posted about my experience trying out CI, Cake, and Kohana side by side while I work on my super-cool-blah-blah-blah idea. I mentioned how I was unable to retrieve lists of things with Cake and Kohana, and how quickly I got through things using CI + DataMapper.

Well, Houston, we hit a problem.

Last night I realized that DM was not encoding passwords before inserting/updating them in the database. I ended up changing it to just encode the posted password value and insert (not an ideal solution, IMO). This morning I was making a few other changes and running some tests and I realized something huge.

DM was not validating any of the data.

Obviously, this is a HUGE concern, and not one I was particularly interested in trying to track down and fix. On a whim I decided to give Kohana one more try, and holy [expletive] am I glad I did.

I have no idea what I was doing wrong yesterday with the ORM library but today it’s been working flawlessly (knock wood). It’s validating things the way it should, inserting and updating the way it should, and (hopefully) will help maintain the relationships the way it should.

As far as the rest of the functions and such, it was extremely easy to switch things from CI to Kohana (the fact that I’m only about 4 files in helps ;) ). I’ve been able to find/figure out pretty much everything from the docs on their site and a little googling.

At this point, assuming the ORM continues working the way it should, I feel pretty good that I’ll finish up this project with Kohana.

Side note: I found a module at projects.kohanaphp.com that’s called “Debug Toolbar” and it’s pretty sweet. It shows execution time, memory consumption, all db queries, and other nerdy goodies for the developer to use. It sits at the top of the browser, out of the way, and is slightly transparent. Cool stuff!

→ Leave a CommentCategories: programming
Tagged: , ,

Frameworks, My Opinion Part Deux

February 21, 2009 - 10:12 am · Leave a Comment

Earlier this week I had a super-awesome-omg-eureka idea for a program. This idea was so hot that I put the forum project on the back burner so I could concentrate on this new idea – something I never do.

As I’ve mentioned here before, I love CodeIgniter. It’s fast, it’s simple, and it’s flexible. However, I decided for this project to try my hand (again) with CakePHP and Kohana, sort of creating side (CI) – by side (Cake) – by side (Kohana) to see which I was able to develop with faster.

For CI, I used CI 1.7.1 with DataMapper for ORM capabilities.
For Cake, I used the latest 1.2
For Kohana, I used the latest 2.3.1 and utilized the ORM library

Now, I was well aware that I would need to reference a lot more for Cake and Kohana, since I only had passing experience with them.  My biggest focus with them was database interaction since this app is database-driven.

I’m still pretty new to ORM, and perhaps there was something I missed, but I absolutely could not get a list of records using Cake or Kohana. I followed the docs on their respective sites and even copied a couple of examples (changing tables/fields as needed), and still nothing. I’m not sure if it’s just me but Kohana’s ORM find_all function does not seem to work at all. The only result I got was “Resource id #31″. Googling both frameworks for some insight brought me no definitive solution. I worked for nearly 3 hours on each to get a complete controller functioning, and only got as far as the C and the U.

On the other hand, using CI + DataMapper, I had a complete controller with all functions – C, R, U, and D – ready to go in less than an hour, including time to reference the DM manual.

I was also less than impressed with Cake’s atrocious loading times. I loaded the same controller from each framework, and my results were CI: 0.348, Kohana 0.83, and Cake 3.29. That means on my (admittedly lower-spec) server, it took 10x as long for Cake to load as CI! I’d hate to see the load times when the entire app was up and running :-\

I guess for now I’ll be sticking with CI + DM. If Kohana can get their ORM library fully functional I’d give them a try again; I will admit that I felt Kohana was more flexible in certain areas and allowed a bit more fine-tuning, as well as having some features that CI doesn’t (Auth, Payment modules).

→ Leave a CommentCategories: programming
Tagged: , ,

forum update part deux

February 15, 2009 - 7:26 am · Leave a Comment

I am more or less finished with the first draft of the forum. The nuts and bolts of the program are there (not highly polished but that’s what second/third/fourth drafts are for), and I am feeling pretty good about things.

Originally I was going to use a simple, hard-coded usergroup method to handle permissions for the forums. However, when I wanted to start adding permissions such as ability to view profiles, users online, ips, etc, it became a LOT harder to use the simple, hard-coded method. So I ended up creating somewhat of an ACL (access control list) for usergroups, which is working out pretty nicely. I combined the ACL (which is stored in the database) with some database caching to cut down on queries and it seems to work pretty well.

So far the hardest part has been syncing everything to work correctly — updating thread reply numbers when a post is created or removed, for example. You look over everything before testing it out and there’s (almost always) one little glitch that managed to sneak in there. So you fix it, then go back and reset the database (because apparently your program felt he was being a nice chap by updating what it could) and try again.

I am now on to rewrite #1. I am going to try my hand with Object Relational Mapping this time. I am hoping it will help speed up the CRUD-writing and make maintenance way easier — 2 things that ORM seems to offer, from all the research I’ve done. For anyone who is interested, I’ll be using DataMapper.

So – here I go! :-)

→ Leave a CommentCategories: programming
Tagged: , , , ,

here’s a story, part 2

February 8, 2009 - 1:46 pm · Leave a Comment

Yesterday I was bored and reading through some old entries here. I came across “Here’s a story” and remembered what happened the day after I got a date to junior prom, and the true reason he is my “What if Guy”…

A good friend of mine whom I went to school with had been hired and worked with me in housekeeping. We usually carpooled to work on the weekends, and she was friends with Randy, also (she’d heard me talk about him all the time
at school) and would sit with he and I after having a cigarette during break.

On this particular day — which was a few months after I started crushing on him — she came back in and sat with us. Apropo of nothing, she looked at me and said “I heard you got a date to Prom.”

“Yeah, I asked [shithead name redacted] and he said yes,” I replied. I glanced at Randy, who had this look on his face… you know, I can’t really describe it. It wasn’t something cliche like he’d been punched. It was more like a total ‘WTF???’ kind of look.

As my friend and I talked a little more about Prom I kept looking at Randy, who’d become quiet (even though he’d been talking with me quite a bit a few minutes earlier). Eventually  he excused himself and went to the men’s employee lounge. We didn’t talk much that day and it wasn’t until I got home that it came slamming home to me:

I FUCKING BLEW IT!

But (stupid stupid me) thought that it was too late to do anything about it; I’d already asked someone else and they accepted. I started dating this other guy after prom and by summer Randy had quit the hospital to go work at [store].

It could be that I totally misinterpreted the look on his face that day. It could be that he thought of me as nothing more than one of his nice co-workers and nothing more.  I know he had a girlfriend while we worked together; as to whether they were still together by prom time, I don’t remember and neither to my diaries.  We never did anything outside of work.  I don’t know for certain that there were any reciprocated feelings on his end. I don’t know that I’m the reason he quit working at the hosptial; he certainly had other logical reasons for getting a job at [store] — it was closer, probably paid a bit more, and (chances are) people didn’t treat him like shit there like some of the bitches we worked with at the hospital did.

I just remember that look.

→ Leave a CommentCategories: moi

Hee

February 2, 2009 - 6:35 am · Leave a Comment

While working on the remove_user function, I have a variable entitled $thread. I need to find the number of rows for the $thread query, and without thinking labeled that one $thread_count. :-D The kind of humor you would probably only appreciate if you buy your own sheets.

→ Leave a CommentCategories: moi
Tagged: , , , ,

Forum Update

February 1, 2009 - 6:07 pm · Leave a Comment

Well, I’ve been working on my forum for a week now, and so far this is what I have done:

  1. Create/Modify/Close/Open/Delete Categories/Forums with per-forum permissions for each usergroup
  2. Create/Modify/Ban/Unban/Delete Users
  3. User Registration & Login
  4. Create New Thread
  5. Modify/Move/Delete Thread (for those with sufficient permissions)
  6. Reply with BBCode and Smilies
  7. Quick Reply with BBCode
  8. Modify/Delete/Restore Posts
  9. Integrated Smarty with Layout Capabilites

Phew! It’s kind of nice to see that I actually did get a lot done; truthfully I keep wondering if I’m wasting my time with this when there’s so many other forum scripts out there that have a team of people behind them.

Another neat thing I did was port CI’s form helper functions to Smarty functions so I can use things like

{form_open url="controller/function" id=$id}
(The id is if I’m modifying something; it appends the id to the action url)
and
{form_input name="field_name" value="submitted_value" default="default_field_value" extra="usually_css_here"}

If anyone is interested in having a copy, let me know in the comments and I’ll attach the functions I have. Currently includes form_open,form_close,form_dropdown,form_input,form_hidden. In addition, I ported the anchor and link_tag helper functions.

There’s still so much to do I wonder if I’ll get it done. I’m pleased with the progress so far, and if nothing else I am learning a lot :-D

→ Leave a CommentCategories: programming
Tagged: , , , , , ,