The Education of a Programmer (Me)

Just another WordPress.com site

Even more inches and Github Commits

Well, Bugs and I, from my previous post have made many more strides on my “wascally web app”. (Pardon the pun, but I’m full of them when I’m trying to make sense of this stuff.) Now, it’s deployed and useful. I’m at the stage, now, where it’s fun working on it and making the incremental improvements which ensure that my admins will not only use it, but will like how it comes out.

The nice part was solving each of these incremental mysteries and then improving it without saying, “I can’t do this, solve it for me,” on the various boards. I added in a search feature for subscriptions based on the user id so I can grab each users subscriptions. It was built in response to not being able to delete a user until the subscriptions were accounted for because of foreign key relationships. Later, read today, I changed the table structure of the underlying subscription table to enable cascade deletions so when you delete a user, the database also deletes the user’s subscriptions.

I’ve left the ID to be set by the admin because it works and because I can reuse IDs that way for deletions. Oracle’s default behaviour is to reserve 20 id’s at a time when you write an incremental ID trigger. So this seems to circumvent that. It’s a little more work from the admin, but it’s not too onerous.

I fixed the name entry into upper case through javascript. It works and it’s not problematic, so I’m happy about that.

I built my dropdown lists with a little bit of help and then added those into the page along with finding the IE problem. It turned out to be client side and with a little adjustment to the quirks mode, it’s all good. So this is, effectively, done and deployed. YaY!!

Advertisements

Getting Ever and Ever Closer

As I type the title, I hear Bugs Bunny, “Slowly he turns, step by step, inch by inch.” That is how this web application feels like. Step by Step, Inch by Inch I make some progress. I finally was able to break through the ODP.NET issues. I broke down and used the managed driver and then insured it was registered in the machine.config files for both x64 and x86 architectures. To me, this feels a bit like overkill. I had set the .dll to Copy Local=”true”, so IIS should not need to access the server’s copy. (Though I had already copied there just because I had learned that valuable lesson quite painfully recently.) Be that as it may, that is what it needed. After that came the ORA-12504 error. It couldn’t find the proper tnsnames.ora file. However, that is a relatively easy fix. I just changed the Data Source = from the alias to the full TNS name. Violá, the app likes the change and now it works.

Of course, I wouldn’t be discussing “step by step” if that were the end of things. Version 1 in classic ASP allowed you to filter a user list by the sponsoring agency. I didn’t include that this time. However, my users are quite content not to have it as long as they can have a search box which allows them to query the user base. It didn’t take me too long to find this page. I modified the basics to fit what I wanted and it works. I had to go back and make a modification and that was to ensure the search always hit the database in upper case. However, I’ve used ToUpper() many other times, so it was a quick fix.

The next step has arrived. How do I ensure that the data which is being entered is written into the database using only upper case for the subscriber names? I’ve worked through a couple of different solutions and they haven’t panned out. In fact, the whole thing has shown me that the ID field trigger on the database isn’t actually catching on that it needs to fire and the application doesn’t need to set the ID. So for now, I will set the ID in the /Users/Create page. It’ s not my preferred solution, but it’s on the list of enhancements.

Also on the agenda are to see why the site renders perfectly in Chrome and Firefox, but won’t render in any version of IE (I run 11 myself), but will render perfectly in IE when I use my IIS Express configuration locally to test the site functionality. I tried to alter the properties at the solution level, but garnered an error stating the .NET versions don’t match. Back to that drawing board. I need to build radio buttons and/or drop down lists for /Users/Create and 3 fields which need to be restricted as to their possible entries. So far, everything I have researched shows it’s really easy, but doesn’t work.

And, if I can do it, make sure that the first and last name entries go into the db in upper case, not lower or mixed case.

Simple? Maybe. But it’s taking time to research since this is the first ASP.MVC app I’ve built.

Book Review – Microsoft Visual C# 2013 Step by Step

I’ve recently been reading Microsoft Visual C# 2013 Step by Step by John Sharp. As usual, the disclaimer is that I received a copy of the book for free in return for the review. I’ve not linked to the book because I blog as part of O’Reilly’s reader review program and recently Microsoft Press books have been removed from their site. Out of courtesy to them, I am not going to link to Microsoft’s site for the book.

The book is aimed, as you read it, for programmers who are wanting to get a foundation in the basics of C#. As such, the book is a good reference work. It takes apart each of the different parts of the language and shows you how they are used in basic format. The first part of the book introduces you to the language, it’s absolute basics, and Visual Studio. The second part, getting the object model under control. Part 3 extends it, and finally, part four shows you how to build something simple for Windows 8.1; as that is Microsoft’s application focus currently.

Overall, Mr. Sharp does an excellent job describing the basics. If you’re a more experienced programmer wanting to see what’s new in the language, this isn’t really your book. But that’s not a negative. It’s not designed for that level of programmer. The examples are clear and concise. However, my one concern is that, as with most beginning books, what you’re learning along the way doesn’t build on itself until the final portion of the book when it all builds at once. However, if you’re going to be new to C# and you’re not coming from Java, this is certainly a good book to start with.

Decisions decisions

Well, I’ve had a few things on my mind recently. I’m still having the deployment problems. I don’t think anyone is surprised to hear that. What disappointed me was taking this to iis.net and to asp.net and having someone at the latter site patiently tell me this was an odp.net problem and that I should take it to Oracle for assistance. Really? This is a deployment problem. On my dev rig, this works perfectly, so I doubt that it is an Oracle failure.

OTOH, I also have been thinking. I like using VS2013 and all of the abilities I can find when I use it. However, I also know that I need to learn to use other text-editors to greater proficiency. I typically use either Sublime or Notepad++ when I’m at the office. They both work well and I’m used to them. However, I used to live in the GNU/Linux – Unix world before I started really trying to learn to program and now that I work as a programmer, I recognize my need to learn the basics, at least, of Vim and Emacs. It’s not really a want to, it’s a need to. It’s just part of programming life. I have worked with Vim a bit in the past as I thought it might be easier than Emacs, but I know future work I want to do will be better done in Emacs. So I need to make a concerted effort to get a good working knowledge of it.

The trick is being able to get over the learning curve and then figuring out what all I can do with it as I learn it. I know that, like anything else in programming, I have a lot of work ahead of me to get over the hump. Back to the mines….

The more I know…..

Well, the next part of the line is “The less I understand.” However, that really isn’t accurate right now. I am understanding more. Not necessarily getting where I want to go, but I’m understanding more. So far, in building the new admin section for the program suite, I’ve been able to get comfortable with a basic MVC program. Really it doesn’t have to do much, it does simple CRUD against the database and I have built custom tables for it to work with. There were a few neat tricks I’ve learned along the way which have made it much prettier. Now my headache is trying to get it deployed on IIS 7.5. I just can’t get it past showing me the front screen at the best I’ve got. Now the latest error is “System.BadImageFormatException: Could not load file or assembly ‘Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342’. This assembly was compiled for a different processor” which implies that, though I matched the odp.net dll to the version which is on the server and is in the GAC, it still is fighting me.

Oh well! Back to the drawing board.

 

Down the road, I want to start implementing more SOLID principles along with Unit Testing and Mocks. It will be more detailed, but just as much fun to learn….

Updates

Well, I had planned on writing at least once a week, starting in January and here we are in May and I’m writing for the first time in who knows how long. (Before anyone can answer, yes, I am aware of the fact that WordPress knows…) 

Life has been busy and that hasn’t always been a bad thing. I’m a newly minted A+ certified techie (Yay!) and have actually completed the next class behind that one. So now I’m a certified Web Design Professional; whatever that will mean to others. 

On the programming front, I was successful, finally, in getting ODP.NET working with EF 5 and have built a newer version of the Hot Calls program which seemed to run correctly in the first preliminary tests. Once I get this other project under control, I think I will test it further to see if I want to work it out and deploy it. Should it go the way I expect, I want to go ahead and blog about the progress and how I did it. I’m using MVC 5 to build the administration interface and it appears to be ready for deployment. I just need to figure out why I am getting 403 errors trying to attach to the web server to deploy it. Once I have that figured out, I want to get it running and decommission the old site. The current admin piece uses Razor syntax, but it isn’t as elegant or efficient as the MVC version.

My Good Lady Wife has had a few health problems of late, so I’ve been away from this beast to worry about her. She is getting stronger and back to her ornery self which makes me feel better. 

I’ve not abandoned my book reviews, just really haven’t had time for them and haven’t stressed about that. 

Packt Publishing Sale

My friends at Packt Publishing have just published their 2000th title! (Wow, and I haven’t got all of them to my wife’s delight.) To celebrate they are running a pretty awesome sale from the 18th through the 26th. They are running an unlimited Buy One-Get One Free sale. I’ve already started compiling a list… Go check it out at http://bit.ly/1j26nPN and stock up on spring reading material.

Book Review – Algorithms in a Nutshell

I’ve recently been reading Algorithms in a Nutshell by George T. Heineman, Gary Pollice, Stanley Selkow. As usual, the disclaimer is that I received a copy of the book for free in return for the review. This book is dense. It was tough for me to get through. That’s not really a negative, it’s an admission that for all of my education in learning programming languages and writing programs, I’ve never taken the time to learn the Computer Science behind the craft of programming.

That said, this is not a book for getting an introduction into algorithms. This is a book for reference when you know what you’re doing and you want to confirm how this algorithmic pattern or that pattern will impact the program and the speed of computation. The book is well written and there is tonnes of example code throughout the book to explain what the authors are saying about each type of algorithm. There are also a tonne of algorithm types in the book to demonstrate the principles. The epilogue alone is worth the price of the book when you read it. I might have placed it at the front as a prologue to explain what I was reading first. However, as I said, I don’t have the same background and I certainly would have benefited from an introductory level book on the topic before attacking this one.

However, when time and tide avail me, I will certainly read something more introductory first and then I will return, with more knowledge in hand, to this book to see what else I can extract from it and see how it can make me a better programmer. If you are already a programmer dealing with these types of algorithms on a daily basis, then you should have this book at your side.

Stretching the limits

Well, this has certainly been a busy week for me. I’ve been working on the intranet site. I’m cleaning up the smaller pages before deploying them. I’ve also started the framework for the new version of the Hot Calls program. I’m going to use Entity Framework 5 and ODP.NET this time around. I can’t really use EF in the logic portion, but I should still be ok. I’m trying to work out whether I can stack multiple queries in the same method so I don’t have to have 11, but can shrink it down to 5.

Also started working with PowerShell to create a shell program which would allow me to help a co-worker with a batch extraction of SP2007 lists to be upgraded to work in SP2013. That’s going to be interesting because I haven’t worked that much in PowerShell, but with my Linux background, I should eventually grab on pretty well.

I took the first half of the A+ exam yesterday and passed it, so I have to finish stuff off for the second half and take it. That keeps me fairly on pace for class and means I’m going to make most of my goals for this period. YAY!!!

Well, that’s the quiet life of a programmer for now. Back to the books and the work for me!

Goals for 2014

Ok, I am going to do this post, along side everyone else who does it at some point around the new year. If you’ve been reading this, you know I do a lot of book reviews. Well, I need to change that a little bit. I need to start writing more about how I’m getting from point A to point B in my career as a professional programmer. At the same time, I have to do what all programmers should do and work on my skills to increase my abilities and my value as a programmer overall. So, with that in mind, I’m setting out a list of goals for 2014 and expecting that I will blog more about it as I go along.

1. Continue my degree course. I’ve been in school so long these days, I’ve become convinced I won’t get out of school. Well, all kidding aside, I’m around midway through my first term at Western Governor’s. I enjoy it and I’m seeing good progress, so I need to get moving faster in my mind. 

2. Learn a new programming language. I’ve heard it said many many times that if you want to get better as a programmer, learn a new language and  preferably something outside your comfort zone. Well, I need to learn two languages for the degree above: Java and Perl. So somewhere in there, I should start getting a jump on things and work my way into this.

3. Rebuild my current codebases. This is a punt as this is already planned for this year. I’m almost done with one site’s re-write and soon I’m going to do the other re-write and then re-do the major project. Really, I’m doing this because I know what I wrote works, but it’s not the cleanest or most efficient way of doing things, so I want to get better and if getting better means doing full re-writes, then so be it.

4. Write more websites. I have a list of sites I could be building or should have built by now, so it’s time to start scratching them off the list and getting stuff done. Take a couple of those sites and use them as portfolio pieces where I can show off, because I already know the customer needs on them and in those cases the customer doesn’t really worry about web presence, so it’s really a playground for me.

5. Blog once a week. Most days, I don’t know if anyone actually ever reads this, but if I want people to read it, I need to write more often. So I’m going to commit to at least one post a week so I can start writing enough to get attention and hopefully keep an audience. It’s my fault that this blog seems to languish at times, so I am the only one who can fix it.

Well, that’s a lot for one programmer this year, so it’s time to get cracking. See you soon!