Wednesday, May 9, 2012

It's time to start on paperwork...


If you've been reading previous entries of this blog, you're probably wondering how I moved on to step 13 so quickly. No I didn't suddenly feel a mass of inspiration and crank out every remaining piece. And no, I didn't give up either. However, I need to submit my paperwork within the next 6 days or so and since there's a lot of writing to be done, I need to get started. I have completed the vast majority of my project (I'd say around 90%) and am still poised to finish laying out these last components and ironing out some bugs. 

However, I've been burning the candle at both ends and it's physically, mentally, and emotionally wearing me out. I've developed a twitch, it hurts to look at any light, I'm having regular anxiety attacks, and I haven't consistently showered or done anything but work and schoolwork for weeks. Besides, I've hit the cap of one of the common project constraints - time, and have to go live with what's working and just note what I didn't have time to fully implement. It will just have to be enough. 
  1. Write the Recipe Builder update logic
  2. Write the Recipe Builder delete logic
  3. Write the HTML builder for Recipes
  4. Write the database interaction methods for the Meal, Meal Plan, and Daily Plan classes
  5. Update the meal planner tab based on the successes and failures of number 4
  6. Write the GUI logic for the meal planner tab (all three interaction methods)
  7. Write randomizer logic for meal plans
  8. Design GUI for meal plan randomizer
  9. Design GUI for shopping lists
  10. Design logic for shopping lists
  11. Design printer control for shopping lists and meal plans
  12. Debug remaining errors on Recipe Builder
  13. Write Capstone Project Paperwork and submit it.
  14. CELEBRATE!!!!!!!! (when I pass, anyway)
Wow, apparently I'm too fried to even comprehend what I'm reading about my capstone deliverables. I guess tonight is going to be a time to try to relax enough that I can stop panicking and start working again later. I am taking Friday off to work on my project and paper, but Sunday is Mother's Day so the weekend is shot. Again, though, perhaps if I clear my mind for the rest of the day I'll be able to come back and really push through the report-writing phase tomorrow, Friday, and Saturday. 

Tuesday, May 8, 2012

Meal Randomizer

Now that I've laid the groundwork for Chef Helper and a user can view formatted recipes, build recipes using customizable components, and create full meal plans, it's on to the little tidbit of functionality that prompted this venture from the beginning. Of course I'm referring to the meal randomizer. Though I've built menu plans to hold up to 6 recipes, for appetizer, main course, two sides, dessert, and a beverage, the randomizer is going to start by being focused on main dishes. For one thing, I'm not quite sure how to have it pick complimentary foods to put together and for another, who has time to regularly cook a main dish, two sides, an appetizer, a dessert, and a custom beverage? Exactly.

I've been giving a lot of thought to how best to accomplish this. Iterating through recipe lists should be fairly simple and straightforward. If I shoot for a simple randomizer to start (I can always add complex logic later that looks at spreading out costs, ethnicities, primary foods, etc), I should be able to get this part done fairly quickly. I'm thinking I'll have the user create the meal plan framework which will create all the daily plans and meals to work with and then just iterate through these lists, filling in the blanks.

Remember when I said quickly fairly quickly? It should come as no surprise that I was wrong. To start with, some of yesterday's work didn't get saved (or I totally overlooked something) so I spent most of my time this evening tracking down those bugs and using a different algorithm for creating daily plans from the meal planner.

I'm now running into another problem with the randomizer. I've got it set to search through the master recipe list for recipes with a meal part of main dish. I can't get the equivalency to work! No matter how I do the search, I can't seem to figure out how to find these matches. I think part of this might also be related to my Recipe Builder snafu where I can't get meal part, ethnicities, food types, and commitments to update or store correctly.  So I went back to try to locate these failures. Ironically, they seem to be the same type of errors I'm hitting with the randomizer.

I think part of the problem is the difference between what's in the database and what's loaded in the master lists. I update those damned master lists after almost every transaction, but it still seems like I can't get them to match up. I'm wondering if I'm going to have to recode chunks of the writers and loaders to solve this problem. I sure hope not, but this program has reached a level of complexity where I've lost track of what it's doing.

In fact, despite the looming deadline, I'm thinking I will finish tonight's work with some code cleanup and go through each class and add the comments describing each step. Maybe that will help me wrap my mind around how I decided to code each phase. I'll just have to work on the functional coding again tomorrow when I've taken some time to refamiliarize myself with my design. Sometimes it stinks to have a memory as bad as mine!

Monday, May 7, 2012

Another day, another migraine

First off, I'd like to admit that I probably don't have a migraine. I do, however, have a headache that's been going on for at least a week and yesterday my eye started twitching. I've heard that stress can cause that, so figure at least I have a reason for feeling this lousy.

That being said, I am again hard at work on Chef Helper. I don't really know what I meant when I scheduled task number 5, so we'll just call it done in light of me getting closer to completion of the meal planning section. I've now got my UI to drill down to the level of Meals and Recipes and have realized I'll need to update the deletion scripts on the Meal Planner and Daily Planner as such:

  • If a meal plan is deleted, so is every daily plan associated with it and every meal associate with each of those.
  • If a daily plan is deleted, so is every meal associated with it.
  • If a meal is deleted, who cares. 
After an hour or so of work, I've got the code ready to accomplish each of these tasks. I've tested it a bit and it seems to work, but further testing/debugging will be needed down the line.

So I moved on to implementing the meal planner tab button logic. I've managed to come up with code to successfully save a recipe to the breakfast appetizer slot and update the tab. I've also managed to come up with code to successfully clear a recipe from the breakfast appetizer slot but I cannot seem to get the tab to update and I've tried a number of algorithms. For the time being, I'm just going to offload that work to another method and get all the other buttons working. Then I'll toy with that method and see if I can't get everything to refresh properly. What do you know, I found a workaround that works just as well without the overhead. I just set the associations on each daily plan as I updated it rather than trying to rebuild all the master lists from the database. 

And with that little bit of success, which has been copied to the other 34 buttons on the meal planner (yeah, that was a lot of copy/paste/update/pray there), I have completed the meal planner. Tomorrow work will begin on the randomizer logic and GUI. Hopefully that won't take more than a couple of days, and I'm taking Friday off to work on this thing. As you can see, that's followed by creating shopping lists which is followed by printing. Then the last step of the coding phase is to debug those pesky little errors on the recipe builder and Chef Helper will be done at last!



  1. Write the Recipe Builder update logic
  2. Write the Recipe Builder delete logic
  3. Write the HTML builder for Recipes
  4. Write the database interaction methods for the Meal, Meal Plan, and Daily Plan classes
  5. Update the meal planner tab based on the successes and failures of number 4
  6. Write the GUI logic for the meal planner tab (all three interaction methods)
  7. Write randomizer logic for meal plans
  8. Design GUI for meal plan randomizer
  9. Design GUI for shopping lists
  10. Design logic for shopping lists
  11. Design printer control for shopping lists and meal plans
  12. Debug remaining errors on Recipe Builder
  13. Write Capstone Project Paperwork and submit it.
  14. CELEBRATE!!!!!!!! (when I pass, anyway)

Sunday, May 6, 2012

Onward we stumble...

It's another Saturday closer to my deadline so instead of getting much-needed rest, I'm up with less than enough sleep and already cracking the whip. Okay, so technically it was work that called me with an over-the-phone fix-it request. But since I'm up and really want to finish this, I'm working already.

It looks like today's task is to get the meal plan section going. My hope is that with my pre-designed GUI skeleton and the practice I've gotten working with the myriad of Recipe classes that this section will go quickly and smoothly. I guess it's time to find out!

Okay, first point. I've already mentioned that I wish I had written interfaces and coded to the interfaces so I would always remember the methods I need. I'm hitting that again with the meal plans as I now have to look at my recipe classes to try to remember what methods I need. Another point that I may have mentioned before is that it's handy to have code to determine a new object's database ID. My original plan was to do so but I had changed it (by accident - I forgot!) to just write to the database and then search for the new object to get its ID. Yeah, it's way easier to determine what that ID should be ahead of time. I'm definitely using this approach for all the meal planner classes.

Oy, another bit of a snag! I wrote most of the important methods for the Meal class and am working on the ones for the Daily Plans and then Meal Plans, but guess what I need for testing and don't have... that's right, recipes. And as you'll note in a previous post, I have some bugs to track down in the recipe builder. That and I wrote the SQL scripts to do a cleanup of the database and it takes a ton of SQL coding to build a single recipe. Perhaps I overreacted. I can just make a bunch of BS ones by taking my eggplant recipe and adding digits to it. Yeah, that will work for testing.

It's taken a number of hours today, but I have entered all the database interactions and whatnot for the meals, daily plans, and meal plans. I haven't been able to test them because I need some fodder for testing and am thinking it will be easier to create fodder if I implement the rest of the GUI first. Probably not my best plan, but I really want to be done with this project.

Aside from being uncertain if my various methods will work, I've discovered two potentially life-shattering issues. First off, when coding for the daily plans and meal plans, I'm afraid I may have hit a circular bit of logic. The meal plans contain a list of the daily plans involved and the daily plans contain the meal plan they belong to. I'm not sure if this is going to turn into a cluster when I try to update one master list and it requires entries from the other master list. Perhaps I'm being paranoid about it and it will work after all, so I'm still hoping. If not, throw another problem on the debug file!

The other concern I have involves dates. I think I've zeroed in on working code to pull them from the database and put them back into the database. However, I didn't think about how the use was going to put them into the form for the database. Trying to parse user input for dates doesn't seem like a particularly winning idea. I guess I was just imagining a date picker GUI piece and didn't realize Java doesn't have one natively. I'm going to search around and see if anyone has an implementation they're willing to share...

So a search for pre-built date modules came up with some solutions, but I really don't know how to import the libraries and then use them. I think my knowledge of Java Swing is still too rudimentary to be able to plug in custom components outside of the NetBeans IDE. It's a shame but perhaps it should be a version 2.0 issue and I should go with a rudimentary date entry field. Yeah, I think I'll do that and see what happens.

  1. Write the Recipe Builder update logic
  2. Write the Recipe Builder delete logic
  3. Write the HTML builder for Recipes
  4. Write the database interaction methods for the Meal, Meal Plan, and Daily Plan classes
  5. Update the meal planner tab based on the successes and failures of number 4
  6. Write the GUI logic for the meal planner tab (all three interaction methods)
  7. Write randomizer logic for meal plans
  8. Design GUI for meal plan randomizer
  9. Design GUI for shopping lists
  10. Design logic for shopping lists
  11. Design printer control for shopping lists and meal plans
  12. Write Capstone Project Paperwork and submit it.
  13. CELEBRATE!!!!!!!! (when I pass, anyway)

Thursday, May 3, 2012

Worn out - making little progress

The time crunch draws ever nearer, and with having to renew my driver's license this morning, being very busy at work, not getting enough sleep, a 3-day headache that just started laying off this evening, and being tense and stressed all the time, I'm not doing so hot. I am absolutely exhausted and demoralized, with emphasis on the exhausted. I can't concentrate, I have no motivation, all I really want to do all day long is curl up in bed and sleep.

Needless to say (but I will anyway), I'm not getting much work done on ChefHelper at the moment. Thanks to Lyndsie's support (and prodding - thanks love!) I am still trying to get stuff done, and as you can see have made slow but measurable progress despite my hardships.

If you look at my list of remaining tasks, you'll see that I'm on number 3 - Write the HTML builder for Recipes. I'm well into the coding for this section but unfortunately discovered some pretty serious bugs in the process. I'm attempting to push through the HTML and check it off the list, but I'm going to have to note these bugs on the Recipe Builder to track down later:

  • Builder doesn't load commitment. If you save without setting it, it reverts to null
  • Builder doesn't properly save the food type. It saves as a blank every time and overwrites whatever's been previously stored
  • Builder can't load or save meal parts :(
  • Additionally, I overlooked the note builder for recipes. It's probably best left until version 2 since it's not vital at this stage.
I have built what appears to be a working class for converting Recipes to html. It's not half as pretty as I had wanted but aesthetics will also have to wait until version 2 because it appears that though a JTextPane will accept an html-tagged String, it only recognizes very basic html and style choices. I'm sure there's a way to do it better but I don't have time right now. 


  1. Write the Recipe Builder update logic
  2. Write the Recipe Builder delete logic
  3. Write the HTML builder for Recipes
  4. Write the database interaction methods for the Meal, Meal Plan, and Daily Plan classes
  5. Update the meal planner tab based on the successes and failures of number 4
  6. Write the GUI logic for the meal planner tab (all three interaction methods)
  7. Write randomizer logic for meal plans
  8. Design GUI for meal plan randomizer
  9. Design GUI for shopping lists
  10. Design logic for shopping lists
  11. Design printer control for shopping lists and meal plans
  12. Write Capstone Project Paperwork and submit it.
  13. CELEBRATE!!!!!!!! (when I pass, anyway)
Since as I mentioned, I already feel like crap, I'm going to count the HTML builder as a 'win' and call it a night. Tomorrow I'll start on the database portion of the meal planner and will hopefully get most if not all of the meal plan working this weekend. I may also consider starting number 12 before then. The program is running at about 66% of capacity and that should give me plenty to write about. We'll see.

Wednesday, May 2, 2012

Got a couple out of the way but wasted too much time!

I only scheduled a couple of hours to work this evening. Though I squandered a lot of that time chasing functionality I could do without, I did accomplish goals:

  1. Write the Recipe Builder update logic
  2. Write the Recipe Builder delete logic
  3. Write the HTML builder for Recipes
  4. Write the database interaction methods for the Meal, Meal Plan, and Daily Plan classes
  5. Update the meal planner tab based on the successes and failures of number 4
  6. Write the GUI logic for the meal planner tab (all three interaction methods)
  7. Write randomizer logic for meal plans
  8. Design GUI for meal plan randomizer
  9. Design GUI for shopping lists
  10. Design logic for shopping lists
  11. Design printer control for shopping lists and meal plans
  12. Write Capstone Project Paperwork and submit it.
  13. CELEBRATE!!!!!!!! (when I pass, anyway)
I'd like to note very briefly where I went wrong today. I set up two save buttons, one to update the recipe and one to save the information in a second recipe. I envisioned the second recipe saving all the recipe details as well as all of the associated instructions and ingredients. 

Yeah, that functionality eludes me despite having blown a solid hour on it this evening. It's really not that important anyway. If I just change that second save option to save basics in a new recipe, it will work just fine. I would have liked the functionality to copy the ingredient and instruction lists but found there to be too many variables to pull off in my limited time. 

I have commented out all my new algorithms and that functionality has officially been moved to the version 2.0 list. Tomorrow I'll start on item 3 above and see if I can't get this sucker done! And thus concludes our broadcast day.

Monday, April 30, 2012

Over-optimistic but still going

Hello again, anyone willing to read this blog. As the title of this post suggests, I may have been a bit overly optimistic recently. Namely, I thought there was at least a passing chance that I could have my project at a sufficiently complete state by the end of today. Though I have been moving along quickly, I'm not quite that far along.

Thankfully, Lyndsie convinced me last week to take today off of work. I got to sleep in a smidge and have been working on my project all day long. I couldn't say how many hours I've put in today, but probably at least 8 hours of the day. I've been debating how many hours total this project has taken, and I kind of wish that I had been keeping track. My timelines have all focused around deadline dates rather than time worked (with my lack of experience, I had no way of forecasting how much time would be required for each step) so I didn't really think about it. I surmised 150 hours so far, but Lyndsie suggests significantly more. I can't even express how much I'm looking forward to finishing this baby and getting back to my everyday life!

Today's work has focused primarily on building the Recipe Builder in the GUI. In addition to laying out the elements of the main builder tab, I've almost finished the functionality. Perhaps more importantly, I've finished work on 4 pop-up windows for editing validations, instructions, foods, and ingredients. That's no small feat considering the interconnections of all the different components.

What's really interesting about working on these user interfaces is the number of features I've discovered I had planned that were real nice-to-haves but not need-to-haves. There's a lot of functionality that I thought would be in the prototype that I've had to cut for the sake of time and scope control, but the project is coming together. Most of these things I've cut have been aesthetic matters like logically sorting the validations instead of alphabetizing them and presetting sizes on the windows. As I've been advised, these things can all wait for version 2.0.

I'm just about out of time to work on this today and really just have one goal - finishing the Recipe Builder window, which at this point is mostly a matter of deciding the logic necessary to save new recipes or update current recipes.

I would like to note something that this experience is teaching me - the value of programming to an interface! Most of my classes have a method to write to the database. They also share a number of other methods involving lists and refreshing data. Though I have named all of these methods the same and have copied code between them (oh, by-the-way, really important to make sure everything's been renamed. Spent a log of debugging time finding mistakes), I find that I forgot to do a couple in my earlier work. For example, I apparently never got around to coding the Recipe class to write to the database. How silly is that? I've got my form ready to save this sucker and have to go back and write the database writer!

Short story long - if I'd written the Interface earlier (which I considered) I would have not been allowed to leave out these methods and would have remembered them earlier. Yet another live and learn experience.

Here's the final news of the night - I just finished the rather lengthy code to save a recipe to the database and guess what - now my program won't run. Apparently it can no longer find the Recipe class, which is really preposterous! Through process of elimination (and logic) I can determine conclusively that there's a problem in the new database writer method. And voila, a few minutes of searching and it's taken care of (ironically, I didn't really change anything in the end but went back to how it was when I started).

And that's all the work I am going to do on this sucker today. My remaining tasks include:

  1. Write the Recipe Builder update logic
  2. Write the Recipe Builder delete logic
  3. Write the HTML builder for Recipes
  4. Write the database interaction methods for the Meal, Meal Plan, and Daily Plan classes
  5. Update the meal planner tab based on the successes and failures of number 4
  6. Write the GUI logic for the meal planner tab (all three interaction methods)
  7. Write randomizer logic for meal plans
  8. Design GUI for meal plan randomizer
  9. Design GUI for shopping lists
  10. Design logic for shopping lists
  11. Design printer control for shopping lists and meal plans
  12. Write Capstone Project Paperwork and submit it.
  13. CELEBRATE!!!!!!!! (when I pass, anyway)