Wednesday, March 28, 2012

Refactored case report program

I decided to just bite the bullet and reorganize the program I'm writing to make some reporting easier at work. Python project organization is a pain.

http://stackoverflow.com/questions/391879/organising-my-python-project

http://stackoverflow.com/questions/1642975/folder-and-file-organization-for-python-development

http://www.python.org/doc/essays/packages.html

I think I have it figured out, and some of the problems I had with importing my modules last night might have been operating system specific. I'm doing the development in OSX since I don't want to boot into my Linux VM every time I want to bang out an idea.

I'm using Excel for 90% of the reporting right now due to time constraints. I'd LOVE to do it 100% in Python so that I can do much more elaborate and flexible reporting. The last 10% is yanking out some numbers based off how long a case takes to close so that I can make a histogram. I spent way too long trying to get Excel to do that and failed. It's going to be much easier using Python, but I'm making it harder than it needs to be so that I can set up a solid library of functions I want to use in the future.

Monday, March 19, 2012

adding PE projects

I've been working to consolidate my Project Euler solutions into one big program, and so far using Git and GitHub have been working out splendidly. I added the first 4 projects, and now I'm working to add the next 6 or 7 which I have scattered between several computers.

Luckily the next several are on my Macbook, which has Git and GCC and is completely identical to the Linux box (at the level I'm working with it anyways). So, I have been trying to find a Git workflow that allows me to add and commit to the remote repo from OS X, and put the finishing touches in Linux.

Pre-step (did once): Clone the master git repository.

Step 1: Find file in OS X, verify it works in the original XCode project I made it in.
Step 2: Go to the local OS X repo directory and run "git pull", which gets all the latest changes I have made
Step 3: Copy over the existing PE solution to the local repo directory, and rename it appropriately
Step 4: Add, commit, then push to the remote repo
Step 5: Go to the local Linux repo directory and run "git pull"
Step 6: Make changes, add, commit, push.

Now what I've outlined is a very simple case. Typically I make a new branch on the OS X side, push that branch to the repo, pull that branch (with "git fetch") in Linux then merge to the master after I make changes. I'm still figuring out when to use "git pull" and when to use "git fetch". I think the work I'm doing is so trivial it doesn't matter.

Wednesday, March 14, 2012

A reminder about character array sizes

char *charpointer = "iameight\0";
char array[9] = "iameight\0";

The strlen size of charpointer is: 8
The strlen size of array is: 8

The sizeof size of charpointer is: 4
The sizeof size of array is: 9

The above is the result of a small "sanity check" program I keep around. It's super helpful.

grip gotten

Ok, I think I have a handle on basic Git (branching, merging, fetching from remote repos into a branch, pushing a remote branch, pull requests).

I'm somewhat back into C mode now. I should dust off some old forgotten projects, or maybe take the time to hack on some GTK stuff again.

Tuesday, March 13, 2012

Getting a grip on Git

Ok, so I know how to edit and add files to my local repository, and then push them to GitHub.

Matt forked my project. What can I do with this? I tried to add a new remote repo, create a branch, switch to that branch, and then pull down what he's done, but it didn't really work how I thought it would. I figured it would basically remove what I had existing and then put what he did, but it tried to merge the two and did a bad job of it.

My intention is to simply run things exactly how he is to try it out. What do I do?

I guess I'll be doing more studying later. Oof. I'm having a horrible time searching for what to do.

Monday, March 12, 2012

Still programming

I'm still learning. I didn't stop.

At some point it started to feel like work (some of it is actually related to my job) and I don't feel like writing anything about what is essentially boring stuff.

My nights and weekends have been spent on the case management and analysis project I'm doing in Python for my day job. I can't justify working on it during normal work hours since I'm too busy, and technically it's not something I'm supposed to be doing (although nobody has complained about the results so far). I could have knocked it out weeks ago but I'm taking my time to make sure I do it as pro as possible. For example, I'm trying to gear it towards a proper distutils installable module, even though it wouldn't ever be used that way.

What's really irritating is that I've learned so much over the past few weeks that I want to scrap the whole thing and start over again. I realize thought this is a dangerous road, so I've written out exactly what the first version needs to accomplish to be functional, and once that's in place and running I'll branch the code and do a massive refactor. That's another thing - I'm trying my best to use Git properly. I put a lot of time over the weekend into reading Pro Git, which has so far been either really helpful or really confusing.

Right now I'm almost done with the first phase of the first version of the program. Phase one is implement a robust class for loading and filtering the case data, and a class for pulling out numbers from the data. For example I'd load a case list, pare it down to a specific date range and a specific territory, and then count how many cases there are in that filtered list, or count how long the cases took to close, count how many unique accounts there were - stuff like that. Phase two is to use that functionality for generating reports in the form of graphs and HTML (to be then converted to PDF or straight to email).

My hope for version 2 is to implement a proper MVC design pattern with some sort of preview for the output prior to exporting.

Let's call version 3 a proper application for not only viewing cases but for on the fly filtering and adding. By that point I'll probably have to start using a SQL database, but hopefully I'll be ready for that by then.

I know - I've said it before that this isn't ChrisLearnsPython, but I'm having a good time with it and it's super hot right now. I complained a lot at first that my hinderance with learning more C was finding projects to tackle. I can't STOP thinking of projects to do in Python.

Once I do get back to C it probably won't be vanilla C, I'll likely keep on with my Objective-C learning so that I can tinker more with Cocoa and iOS.

Friday, March 9, 2012

Off Topic: Video Conferencing

I've been using video communication tools since the late 90's. The first webcam I ever used (probably in the mid-90's) was black and white and connected with a parallel port interface. I only had one friend with one, so it wasn't all that useful. By 2000 I was doing it on a regular basis with friends, using Netmeeting or other tools - I forget what they were all called. I think AIM and ICQ had some sort of video features.

Anyways, the war was waged and Skype is the winner (on Windows, anyways).

I've used it in my personal life quite a bit. Not so much anymore since the wife moved in, but since my parents are overseas I still use it every so often. As a personal communication tool I find it a mandatory install on all my machines, and will for a long time.

As a professional tool, however... I'm undecided. We have a paid account in the office that lets us do multiple video chats at once, and when it works well it really makes a difference. However, when it misbehaves it tanks the productivity of the meeting.

Here are the reasons I think the technology is not quite there yet:

1) Interface. There needs to be a full screen UI that assumes you're viewing the screen from far away, like in a conference room. I'm fairly young and even I can't see text that well from fifteen feet away. It often turns out the person closest to the front of the room controls the system.

2) Problems compound when more people connect in. If someone cuts out in the chat it might not be cutting out for everyone. One on one it's easy to tell who's having problems. Two people joining in and everyone has to confirm with two people that they're audible/visible. Three people... four people... etc. The first ten minutes is everyone asking each other "can you hear me?".

3) Feedback. I've imposed an insistence that everyone wear headphones so to avoid squealing feedback. Laptops are the worst offenders since the speakers are too close to the mic.

4) Not knowing who's available. I wish Skype was smart enough to do some face detection to set the here/away indicator when someone is actually in front of the computer.

Is video even that great of a leap past audio for your average meeting? The quality isn't so great that I could hold up a small device and anyone could discern details. I might be too socially dim to care that much about seeing someone's face.

Anyways, just some off topic thoughts that run through my head several times a week.


Sunday, March 4, 2012

Project Euler progress on GitHub

I'm unifying my Project Euler progress, and I'm going to use this opportunity to learn more about Git and GitHub.

I thought a good deal on where to do the actual work (Windows, OS X, Linux) and settled on Linux since Windows has a bizarre Git implementation, and OS X would let me cheat by using a front end for Git and keep me away from the command line (which I need to be stronger at).

Git is sort of easy to learn. I feel like I'm doing things the hard way sometimes. I had assumed it would just "know" when I add a new file to the project, for example, but it didn't. I have to really be mindful of what I'm doing (in hindsight an obvious sentiment).

https://github.com/cheydrick/Project-Euler

The first go at it is just the foundation. I'll make functional the ability to choose which project to run at the command line next, and then continue adding the projects I have already finished. I'm looking forward to this, and I hope I'll have the chance to learn more about Git and proper source control practices. Maybe I can get someone to fork my repository and make a change so that I can learn how to merge changes into the master branch (or is it clone and pull... woof with the terminology).

Thursday, March 1, 2012

Biking

I haven't been programming much this week. Work has been very busy and I'm too tired to do anything other than mindlessly tool around on the internet.

My wife has got me riding my bike with her. We've gone out a few late afternoons this week. Sore, but getting better. I'm happiest when I'm improving myself somehow. So, I don't feel bad about not programming since I'm doing something to improve myself.