Tag-Archive for » track «

Monday, December 08th, 2008 | Author: renaebair

Here’s the new hotness! Time Track now uses a single data file so it won’t junk up your hard drive with lots of dirty files on each run. It stores data for multiple projects including their time logs and total run times in a single file. I even got to use a hash for the very first time!

Adam helped me a lot with this refactoring because, honestly, I still suck and he’s the shit at refactoring, considering that’s what he does all day long (all night long too)! If you try to run the code make sure to enter the same project name on each iteration or you’ll just be adding times to new projects. The next step is to give the user an option to select from a project that’s already been created, but for now in order to get that effect you just have to type in the same project name each time. :)

Category: Uncategorized  | Tags: , , , ,  | 2 Comments
Sunday, November 30th, 2008 | Author: renaebair

 

Shack for my ugly codez

Shack for my ugly codez

After a chaotic holiday weekend and chaos with sugar-injected children, I finally found a free hour this weekend to create a nice, cozy class for the time_track app! Now it just needs a big refactor before I can start implementing new features and functionality. So far I think I’ve covered most of the Ruby basics other than blocks and procs but I’m not sure I’ll need those for this little program right now.

I finished Chris Pine’s “Learn to Program” book this evening. I’m looking forward to spending some time re-reading Why’s Poignant Guide To Ruby; I think I’ll find some nice gems (hahahaha) in there now that I have some more foundational knowledge of programming under my belt. 

For now here’s the new codez:

Thursday, November 27th, 2008 | Author: renaebair

OMG wow I need to learn how to use classes! I’ve been working on the time_track app and it’s getting so out of hand. I took the advice of Ben regarding the time formatting (see advice here) and I’ve also added reading/writing to a yaml file. At this point it’s incredibly bloated and needs some work, so that is the next step.

So far the application prompts the user to hit “enter” to being time tracking and then “enter” again to stop time tracking. When the user stops the tracking the two times are subtracted and the resulting time is stored in a yaml file. In addition, all of the times in that yaml file are added together and the running total is stored in another yaml file.

Yes, this is still a very simple little application. But I have delusions of grandeur for this app, so let me tell you all about its distant future! I want to create an open-source time tracking application that requires as little user input/maintenance as possible and has built-in fault systems to detect possible user error (in case the user leaves and forgets to stop the timer). I believe this would be incredibly useful to programmers that do a lot of client work and whose clients demand very accurate time logs.

Here is how it would run: When you open the application it sits unobtrusively in your menu bar (think Caffiene). When you click its icon with your mouse of choice (I prefer the Razer Lachesis; great for coding and gaming fun) it starts time tracking. You go about your work, writing beautiful code. When you want to stop tracking time you simply click the icon again in your menu bar. The total time is stored. You can click it again to start tracking time when you are ready to work some more.

The app will have a nice functionality that detects when there hasn’t been key strokes or mouse movement over a certain period of time and it will prompt the user for input to determine if they are still there. If it gets no response it will create a ticker at that very point in time (but won’t stop tracking) so that when the user returns (if they were ever really away) they can choose to look back and find out where they should have stopped the timer.

The app will of course calculate the time logged for any date range so that a programmer can keep very accurate time logs of his work on projects. There will also be a quick way to change between time tracking for different clients in case you end up working on multiple client projects a day. I’m very excited about it and I know it’s going to take a long time to write and will probably be quite impossible. But the delusion is there and I’m going to follow it! :)

So here’s the gross code I’ve written thus far and my next step will be to compact this all into a nifty little class:

Category: Uncategorized  | Tags: , , , , ,  | One Comment
Tuesday, November 25th, 2008 | Author: renaebair

I wrote my first little app in Ruby tonight. Well, that’s a lie. I’ve been writing cute little inapplicable apps for the last month but they’ve just been exercises out of Chris Pine’s “Learn to Program” book. Tonight I actually decided to write a very basic time tracking app armed only with the knowledge I’ve cultivated thus far and it came out swell. I know it’s quite basic and lame, so please laugh. I am laughing at it right now. But I’m learning as quickly as I can with only 2 hours of time a night available for learning Ruby. 

I did end up having to use a hack to display my time (from seconds) to a pretty-formatted date/time string. But I hope to come back to this problem later and come up with my own solution. It doesn’t store the data to a file yet but I’ll be adding that tomorrow evening. I know it will only take 5 minutes but the kids do wake up around 5am and I’d sure like to sleep now :)

Here’s the nuby code:

Category: Uncategorized  | Tags: , , , , , ,  | 3 Comments