Archive

Archive for the ‘Coding’ Category

Senior Design Project

October 16th, 2010 No comments

Let me start somewhere close to the beginning of the semester for this story. Our group picked the “Patient Database Administrator” project, thinking that we would be building a full tool for docs to access all their patient records. Yes, in retrospect that sounds too HUGE to be able to do in a single semester, but that’s what we were thinking. We then, before meeting with our client, found code that a previous group had built for this same project, and assumed they were related. At this point, it is 2-3 weeks into the semester, and we still haven’t had an opportunity to meet with our customer!! Once we finally did (for 3 HOURS on a Friday night!!), we managed to make clear the purpose, goals, and scope of this project: create a custom form generating engine that our customer can plug into their overall tool to take all patient records and forms online (including managing the hospital as well).

This project description is of smaller scope than even by the end of that meeting, but we managed to make it more concise over the following weeks, which was nice. Let me describe our customer for a moment though. He is a big-thinking Neurosurgery doc who is finishing up his residency (in the final 2 years I believe) at Emory University Hospital. When I say big-thinking, I mean he sees the big picture very clearly, but doesn’t see all the little steps to get there at the same level as the people he has gotten to accomplish them. This lack of seeing eye-to-eye on many of the technical matters means that we senior design groups receive emails that regularly change, or attempt to alter, the direction we are headed with this project. Some examples include the frameworks we are using have been changed multiple times, typically with more added rather than our overall structure being simplified, and our technology choices were limited to some proprietary software (Flex, which is Flash) that we have to use FREE TRIALS to be able to code in for 60 days. Don’t get me wrong, Flex will likely make coding the front end a lot easier, but that doesn’t mean that it will make our lives easier as a whole since we have to use a framework called Mate with the Flex UI… it’s basically a wreck right now with us trying to put together enough pieces that we can get things rolling so that we can meet deadlines. A minor detail to add, being asked for working prototypes when we haven’t been able to get any real coding done yet, and being asked for the same documentation that has already been sent out, is really annoying from a team managing perspective. Really doc? I sent you those docs about 3 weeks ago!!!

Anyway, we have a lot of work ahead of us. Here is a quick breakdown of the technology limitations and our deadlines for production:

  • Java back-end
  • Hibernate to communicate with the DB
  • Flex UI
  • MySQL DB (ended up being the better choice out of the options, we got lucky here)

Milestones:

  • Start of semester: 8/23
  • Picked project: 8/29
  • Met with customer: 9/10
  • Met with DB professor on campus to discuss our design (and he loved it by the way): 9/24
  • Documentation due date and group presentation to class (end of Sprint 1): 9/27 — we were supposed to have started coding at this point, but didn’t have the time because we met so late with the customer and had so much documentation to do in the limited amount of remaining time for Sprint 1.
  • Upcoming, end of Sprint 2: 11/1 — we plan to have a prototype in place by then, but feel woefully behind because we had so much trouble setting up our local development environments. Really cost us on time!

So we have time to get things done, but are going to have to really push it the next 2 weeks to meet our planned deadline for a working prototype.

Installing cx_Oracle on Windows

July 28th, 2010 No comments

Almost 2 months ago, I started on a project that required the use of Python and access to an Oracle database. It took me multiple days in a row to finally get it up and running so that I could actually make progress on the project, but once I did, I thought nothing of finally getting it to work. However, I was recently approached by another person at work who had to use the cx_Oracle package to access an Oracle DB through Python, and realized the value of actually putting together a post about the steps required.

First off, it is really easy to get it running on Linux. I mean super easy to get Python and cx_Oracle up and running. Secondly, I have an XP machine at work, so no guarantees that this will work with all other Windows Operating Systems until I get to test it on one (not possible till about September at the earliest, I’ll put a todo item in my calendar to try to remember to do it).

Alright, down to the nitty-gritty of it. You first need to install a recent, if not the latest, version of Python, if you don’t already have it of course. When I was installing it on my work computer, that was Python 2.6.5. Now that would be Python 2.7, but since Python is intentionally backwards compatible, it SHOULDN’T matter. For installing Python, be sure to follow one of the many Python install guides available on the web, but the quick run-down of the install process is:

  1. Install Python.
  2. Edit your environment variables to add the Python directory to your PATH variable and create a PYTHON variable. I will cover editing/creating Environment Variables with the later part of this guide because you will have to do it again for cx_Oracle.
  3. Code in Python (you can use an IDE like Eclipse, or a regular text editor like Notepad++).

Next, run the cx_Oracle .msi installer for your particular Windows install. Now that was the easy part.

Next up is the part that most people seem to miss, having an Oracle client on your local machine. Oracle suggests the use of the Oracle Instant Client, and that’s what I used this time. Oracle’s instructions seem to have improved since I first installed the Oracle Instant Client, but that doesn’t mean they are easy to follow.

  1. Go download, and unzip, the Oracle Instant Client from here.
  2. Put it in a place on the C:\ drive that is easy to find/access later (it’s a drag and drop procedure for getting the files there, no installer). My suggestion is to create a directory called Oracle, and place the instantclient directory in there. This way, my path to the Instant Client directory reads “C:\Oracle\instantclient”.
  3. Add this guy to your PATH Environment Variable. You can get to the Environment Variables by right clicking My Computer, select Properties, go to the Advanced tab, click the button that says “Environment Variables”, and now we’re here. From the Python install, your PATH variable (in the user variables section, not the system variables) should already exist from you creating it as “C:\Pythonxx”. Now, add that directory location from step 2 so that the PATH variable reads similarly to mine, which is “C:\Oracle\instantclient;C:\Python26″.
  4. Now you are going to need a tnsnames.ora file. For those of you that don’t know what that is, read here. The company I work for fortunately provided me with one, so I didn’t have to make it from scratch, but basically they contain your connection strings to the different databases you are going to be accessing. I saved mine to “C:\Oracle\network\admin” just for easy memory (and because that’s where someone else’s was when I asked). I hope you didn’t close the Environment Variables screen, you’re going to need it again.
  5. Lastly, you need to add the TNS_ADMIN variable with step 4′s path in it.

You have now installed cx_Oracle successfully. To really test it, you can open up a Python command prompt and run the following lines of code to test it.

  • import cx_Oracle
  • db_conn = cx_Oracle.connect(“user/pass@tnsname.world”)

If either of those steps went wrong, double check the steps. If you still don’t know, comment on the post, or email me (my email is lying around somewhere on this site), and I’ll do my best to help you. There are also many forums and forum threads scattered around that have tried to explain these points as well, but I found them to be inadequate.

Lastly, Google is your friend for finding out about the different functions available in cx_Oracle, and the documentation isn’t terrible for this either.

I’m Behind

June 28th, 2010 No comments

At this point, it’s kind of ridiculous how many weeks I am behind on blog posts. It is a recurring todo item on my personal calendar, but I never quite find the time for it in the day. The worst part about that is that I have content for the blog. LifeHacker did a new summary of the MUST have free apps for the Mac, and I am meaning to supplement it with my 2 cents. I have started my internship (been doing it for 3 weeks now) and have already learned plenty of topics ranging from DNS to proper unit testing in a real development environment to learning Python (which is a very fun language). Sprinkled in amongst such activities and learning experiences, there have been news posts worth my comments (in my opinion), and other developments in my personal life that I have debated discussing and just haven’t for the same reason that there hasn’t been an update before now, I didn’t do it.

So, with that being said, I am working on a post on one of those subjects for later this week and hope to get that trend going again. I’m thinking that the first subject will be all the issues I’ve had during the past couple weeks with WordPress due to upgrading BurgerBlog to WordPress 3.0 without taking a database backup. So frustrating.

See you later this week!

Assignment Design Fail

March 16th, 2010 2 comments

The weekend was definitely a busy one. Between having/attending a party at a friends’ place and then spending the rest of the weekend doing homework (had an assignment for my Algorithms class and a group paper for my Ethics class to finish), it was a very busy, but productive weekend. I got all the work done (eventually), and had a great time Friday night! I’d rant a bit about my Ethics assignments not being clear enough, but I don’t think that’s really necessary when I have better fodder to write about in the form of my Marketing online homework submissions.

So the system is called Management by the Numbers and the site/product is completely new. At the beginning of the semester, they provided us with accounts according to the school we are in and the number we were on the roster (I assume that’s how the number was generated at least). So, the format would be gtxxx, and they initially gave EVERYONE in these classes the EXACT SAME PASSWORD! I noticed this immediately in the email that they sent out to us regarding what our login credentials were. As someone who wants to professionally doing information security for a living post undergrad, I just cringed when I saw this. To make matters worse, I did the first assignment on the WRONG username because ALL the passwords were the same. Of course, I didn’t realize that was the issue when I saw a 0 for the grade, but only after contacting the professor and TA about the issue did it become apparent “Aaron, your username is gtxxx.” “OH MY GOODNESS, I did the homework on the wrong username, I did it on gtxxy.”

After further discussion, I discovered that the company was “working on” a password change “feature,” which I consider standard in ANY login system. I almost asked for a contract to write the code to do it in PHP out of frustration, but thankfully I didn’t because I have had a bunch on my plate this semester. Overall, it was really disappointing. The funny part, that’s not even what I wanted to show with this blog post.

When I was doing the assignment that was originally due tomorrow, I found a few interesting bugs in it (causing the due date change). The first one had to do with an algorithm that was used to obtain the answer for a problem. It was supposed to be:

(($23.90 – 10) / (.71 * $23.90 – 10)) – 1 = 0.99

Instead of:

(($23.90 – 10) / (.75 * $23.90 – 10)) – 1 = 0.75

You see, the .71 in the correct answer was because it was supposed to have a 29% decrease (in this problem, since that number is dynamic) in price for the comparison, but the algorithm had been setup for a static 25% decrease in price instead. This caused correct answers to be completely wrong.

The more interesting bug, pictured to the right, had to do with precision. They were taking the number out to multiple decimal places, and requiring precision according to that, but the dollar amounts were automatically rounding as we expect cents to do. The end result was that a correct answer was STILL wrong. Of course, this was extremely frustrating for me at first, until I thought to myself “I wonder if it will accept the decimal written ALL the way out (I think I did 6 places just to be over accurate). It worked of course, since the issue had to do with their accuracy, but displaying it as a whole cent was extremely confusing. Regardless, I have finished the assignment and the due date has been pushed back to this Thursday now.

This Semester’s Classes

January 15th, 2010 No comments

So, I said in a previous post that I was going to be reviewing Evernote as a note taking a productivity tool this semester. Unfortunately that is much harder now that I have attended my first few classes. 2 of my classes discourage or just flat out forbid the use of laptops during class (the one that doesn’t forbid it only allows them on certain days that we are doing in class activities). For the third class, I’m not going to use a laptop anyways because that is algorithms and you just can’t easily type out those symbols most of the time required by the random proofs and equations that we will be using in that class. The remaining course is Ethics, so I will be using my laptop in that class, and hence will still be able to review the program, just not on the same scale as I would have liked.

The two classes that I cannot use my laptop in is Accounting 1 and Marketing. Overall, the classes seem like they will go well this semester, with the very structured accounting course making it much easier to deal with how much I don’t like the teaching antics of the professor, and marketing seems like it will be nice since the teacher does it very much on a discussion basis (I like). Similarly, Ethics will also be nice because it will focus on us working in small groups in class and then discussing our findings afterward. Algorithms is going to be tough, but as long as I keep up with the assignments and the reading of the textbook before class, I’ll be good.

This weekend is going to be a long weekend, which should be very nice and mean I’ll actually be productive (maybe). I have a new book that I want to read, so it may not be AS productive as I would like. Also, my friend is working on putting together a new project to be discussed further once we have the ball rolling with it. First steps first, we have to really hammer out the goals of the new site and such. Look for further posts about that in the future.

Deleting Personal Information

June 28th, 2009 No comments

So both my girlfriend and myself got tired of how much personal information we had out there on the respective sites that we have joined. The result was the two of us literally sitting down and purging our Facebook accounts and removing our Myspace accounts completely. However, it also brought up a wonderful concept that really should be done.

When dealing with Facebook, the main reasons most people want to keep it is because they have the contacts with old friends and they don’t want to lose all the pictures. Well, wouldn’t it be nice if you could just click a button on a photo album and download all the pictures from that album to your computer in a single zip file? Or be able to go to all the images where you are tagged and download all of those files? As is, you can already go through and save each individual file pretty easily, but that just takes WAY too long to go through all 200+ images that have me tagged in them AND then make sure I have every single image that I ever posted to my profile. Well, long story short, I am thinking about trying to get a group together to make this small application for Facebook. It probably won’t be happening within the next couple weeks, but maybe in a month or so, after I have my business ideas going a little bit (I might make it a first project to get the sites name out there?) I will tackle it. We shall see about that, but at least now I have the idea in writing and out there, so worst case scenarios are a) someone else makes it or b) it never gets made. Either way, here is the start of a possibility.

Also, I have continued working on my business ideas/plans, but unfortunately have gotten side tracked by having to deal with a couple people getting involved that I didn’t really want to have knowing. Today (or it might have been last night, doesn’t really matter) I sent off an NDA to both of those individuals so that hopefully I can tie things up with a pretty bow legally and ensure no competition from either of them (only really worried about one of them even doing anything with the information thought). I will naturally do my best to update on this soon.

Browser Wars

June 15th, 2009 No comments

It has become apparent to me that either web browsers have gone down hill or the web itself is so poorly coded at times that it just crashes all browsers. It is likely the latter, but that doesn’t keep me from complaining about the inadequacies of certain browsers. Everyone knows about how much Internet Explorer sucks, and that is why their market share went from a peak of 95% of all browsers to ~65% of all browsers today [source]. The latest typical browser of choice has become Firefox, and that is the browser that I lately have been bitching about the most.

Recently I encountered an issue with the Gecko engine behind Firefox that made it difficult at best to get a web page to print in the format you desire. As a result of such issues, It has been built into CSS to be able to select the media that the style sheet goes to (selecting print will only send that style sheet to the page if it is being printed). This is extremely handy for trying to get around these bugs that are built into a lot of different browsers including Firefox. As it turns out, Firefox is not able to print all CSS even though it is all supposedly supported. After a lot of trial and error, amongst other attempts at fixing the issue, I found that Firefox didn’t like the CSS “display: inline-block;” which does so happen to be valid… stupid Firefox!

Since starting this post, I have encountered a brand new reason to hate the way that IE6 renders a page. It actually does it counter-intuitively! Here is an example of it:

Argh! So basically I am pissed at web browsers and their difficulties right now, but I must say one nice thing about one of the above mentioned browsers. Firefox is very nice to do web development in. It has a plugin called Firebug that is absolutely awesome and without it, quite a few of us web developers would be lost when it comes to styling a web page.

Categories: Coding, Intuition, Web Tags:

It’s been a while

June 13th, 2009 No comments

So it has been quite a while since I have posted here. The main reason is that whenever I have thought about posting here, it has been about a topic which would directly pertain to one of the people who were reading this blog almost religiously. It is unfortunate that I censored my posts as such, but it was necessary to keep good relations with all those people, AND I have talked to them about those issues at this point (I figured it would be better to talk about these things in person or over the phone than to bring them up through a blog). But on to what I have been doing.

Since my last post: the Spring semester ended (earned a 3.74 for the semester and have a 3.44 overall. Not quite my goal for the year yet, but getting there!); went on a road trip to New Hampshire with my girlfriend to see her folks; started my 4th co-op work term; have come up with a new business idea which I will outline when it is more fleshed out; finished a project at work that has been plaguing me since my previous work semester in the Fall (a media module for the website); solved a printing CSS issue at work; and have had the greatest 6 month anniversary with my girlfriend that could ever be asked for! Overall, it has been a very productive last 2 or so months since I posted.

I don’t have much else that I can think of which will need updates right now, but I am sure that I will come up with something. I have been compiling a long list of links that I will eventually assemble some kind of blog about, I am sure of it. One of the things that I would really like to do at some point this summer is REALLY get to know Photoshop so that I can create some nice website layouts with it. That would be freaking awesome!

Categories: Coding, Inspired, Web Tags:

While Classes are Drawing to a Close

April 23rd, 2009 No comments

Well classes have begun to draw to a close now. There is one more day of classes, and I plan to skip one of those two classes I have tomorrow. CS 2200 classes are complete and there is just the exam left to take next week. EAS 1601 is done, FINALLY, and I just have the exam on Monday and will be done with lab sciences for the rest of my college career. Econ 2106 is the class I am skipping the class for tomorrow because there is an optional quiz tomorrow and my average in the class is already a 98 and we aren’t on a +/- system so it won’t make a difference if my grade is higher than it is right now. All that leaves is one class to attend tomorrow at noon, CS 2340 and then that exam also next week. Fortunately, the final project for CS 2340 has been completed at long last and I don’t have to worry about the project ANY MORE! I am so so so excited about the fact that I don’t have that project to work on any longer. We presented it to our TA today and so are just awaiting our final grade for that. I believe that we will get some extra credit on the final project and can’t wait to just be FINISHED with the class completely. I have found it so hard to find any true value in the class itself and the project has simply taught me who I won’t include in future group projects with the goal of avoiding issues like I have had to deal with this semester.

Other work that I have to do by the end of next week is take care of some website updates for castplays.com, work on my personal code library project for PHP, study for exams, and get some of my stuff home to make the move next weekend easier and quicker. In the mean time, today has been spent basically just turning off my brain and trying to relax a little bit. Tomorrow, until tomorrow night when I go to a party with my girlfriend, it will be back to the books for a little bit so that I can get a mild head start on things since I want to be prepared for my exams next week. Sadly, even with the highest possible grade on my final in CS 2200, I won’t be able to earn an A in that class without some help from the graders/teacher because of my screwing up the tests a little bit and messing up that one project demo by missing the demo slot I signed up for. Shit happens, but it is really sad that the highest I can get in the class right now is about an 87-88 with a 100 on the final in the class… ah well.

As for my personal coding project/code library for my future and present sites, my current goals are:

  • Create a string library to handle things like validating an email address or a date.
  • Create an object oriented db class/find a good one online that does everything that I want.
  • Create a user class so that I can then work on the next task of
  • Creating an authentication process so that I can move closer to actually being underway with my business ideas (more to come on that once they are more concrete and there is a site to back it up).

Until I have more/until tomorrow when I publish the other blog post that I am presently working on, I am going to relax a little bit.

Working with Others

March 27th, 2009 No comments

I am sure that everyone, at some point in their life, has worked in a group to meet a certain end, goal, or something else of the like. Well I presently have a CS class that is geared entirely to group projects. Unfortunately, The very people that I originally thought were going to be the strongest members of the group have turned out to be the biggest annoyances in my life. Well that is over dramatic quite honestly, but this specific someone is definitely getting on my nerves at this point. To properly relate the entire story though, I think that it is necessary to start with a quick retelling of a little bit of last semester than my present issues.

When I was selecting classes for this Spring semester, I decided that it would be great to have as many classes as possible with my friends. As it turned out, I determined that I would try to take all my classes with a single friend (ended up being 3 of my 4 classes) and managed to have a friend in all my other classes. Well, I ended up registering for 2 CS classes and an lab science with this certain person (sorry, don’t like calling people out on ranting blogs because I know this is googleable). I thought that it would be great to take classes with this person because we have known each other since Freshman year and can typically cater our work habits to fit each other’s needs pretty easily.

The very ability for us to be able to cater our actions to fit the other’s needs is what seems to have been the downfall of things. The project that we are doing requires us to work together to make a Supply Chain model with seperate pieces that work together. When we have had group meetings, we have done our best to cater them to everyone’s free times, as one would expect. When trying to get things done for a deadline, we have attempted, for the most part, to do the same thing. Unfortunately, it would seem that such is not quite good enough for this person who has become, seemingly, increasingly pushy with making things fit their own schedule instead of the group’s schedule. It has just gotten under my skin during the course of this semester how hard it is to relate information to this person regarding class work and how things should be done when they are NEED them accomplished on their schedule.

</rant>

As for the actual issue that I have run into with my piece of the project, we have a class in the Supply Chain that handles orders from stores to suppliers. Unfortunately, when I was trying to code the UI for this screen, it won’t work the way I would expect. The Order class is set up to contain an Item (what is going to be ordered or what is delivered), a status, the store, the supplier that will receive the order, and that is it. Seems simple right? Well, when coding the UI, and I am trying to dig down to the Item variables, it won’t let me get to it’s instance variables and instead tells me that it doesn’t know anything about that class. This naturally is driving me a little bit NUTS, and this certain someone has just been adding to my general frustrations by sending me repeated messages/texts trying to find out when I am done so that they can go back and tackle their own part again for it is apparently not possible to code their parts without mine… that’s rich. </rant again>