Posts that have the tag "programming"
New Blog Update
I've been working on my new blog software for a few months now. I don't intend on adjusting the outward appearance of my blog in any appreciable way, so when I move from the old software to the new software, it should look the same. Rather, all of the changes I'm making are all on the back end of things.
I've been working to objectify my PHP code. Right now, my blog spans over 20 disparate files. There are a few files that are common to them all (similar to classes), but they're mostly for the more complex features. The problem I've been having is reconciling similar functionality and standardizing my coding practices. For instance, I recently spotted a bug in my site redirect script. Were my program stored in a few central classes, I would only have to modify a few portions of the code. However, because everything was apart, I had to modify 15-20 different files correcting the bug. Of course, even with classes, I may have to modify a fair amount of items. For instance, adding, editing and deleting information has a similar procedure with a different query string. With 4 different information classes with an add, edit and delete method in each, that's 12 instances of the exact same code. Making a method for the redundant code makes the code more succinct AND makes it easier to modify down the line.
Currently, I have information classes: my blog entries, comments, image info and image folders. I also have a class for database use, a utilities class, a user authentication class and an HTML class. So far, I've written most of the database and information classes. I need to fine tune and correct any logic errors and try to synchronize common class types. I've also finished writing my utility classes, as they were taken from the old utilities I used before.
The authentication and HTML classes will take a fair amount of time, but most of the logic and styles for each have already been written. I'll just need to slice them up and edit them to function correctly in a modular fashion.
If I were to give a percentage of completion, I'd say that I'm somewhere around 60%. I've completed a lot of the logic grunt work and I have a little left. Afterward, it will be about testing the applications to insure proper working order.
Posted on February 22, 2010 at 12:26 pm. 0 comments. Tags: website admin blog images programming php mysql database
Java
I recently got into the GUI portion of learning Java with swing. Now that I'm able to program items with tangible results and computation that I can't achieve via PHP, I've started using Netbeans to program Java programs to test out functionality and figure out structure. My knowledge of the structure of a Java program was somewhat tenuous and by playing around with it now, I'm able to figure out which portions of code where.
In the near future, I look to learn Java IO and maybe Java NIO. Hopefully soon thereafter, I can learn network programming with Java.
Posted on August 16, 2009 at 12:19 pm. 0 comments. Tags: Java programming network programming
Java Books
I couldn't read the Sam's Teach Yourself Java 9 in 21 Days book any longer. The book was just not teaching me very much. While reading, I felt that I was learning more because I had learned other programming languages before this book than because the book actually imparted any information.
The book was touted as a beginner's book, but it came off as more of a review. Thus the actual information provided was very shallow and described in very poor detail. I had read about half the book and still felt that I was unable to construct a program on my own. A lot of other information was missing or required me to infer from examples. For instance, the main function in a Java example seemed recursive when it would call the class of which it is a part. It took me a while to realize that the main function was special. Moreover, most of the main functions had a lot of language attached to them, such as "void", "static", etc. None of those were explained in any depth.
I think what was most annoying about the book was that a lot of information was mentioned or discussed, but was completely out of place. For instance, early on, an entire chapter was devoted to handling errors and exceptions, which seemed out of place considering that at that point, I had barely learned much actual programming, let alone enough to produce many major errors that were anything more than syntactical. Moreover, the chapter didn't even do that great of a job explaining what catching an error would do. There was a lot of other information that was described as important, but the book said that it would be explained later on. So, you're being told about something that wouldn't be explained in any depth whatsoever. In fact, there was a lot of information that was described as important without any explanation as to why it was so important.
In the end, the book was frustrating. I got a minimal amount of information out of it and I just moved on to another book. In this case, I went to Murrach's Java SE 6.
Posted on May 19, 2009 at 10:29 am. 0 comments. Tags: java book programming computer
Command Prompt and registry
I've been contemplating the necessity to devise a command prompt batch file to edit icons in Windows Vista. Windows XP and earlier versions had options within Windows Explorer to edit the icons used for file types. For whatever reason, this relatively simple task was stripped from Vista, which certainly pissed me off as it made the process so much more difficult than it should have been.
The current process I employ (which can be seen as a registry "hack") is to search the registry for the file extension in: HKEY_CLASSES_ROOT*file extension*. There's a value called "default" which gives a file type name. Within HKEY_CLASSES_ROOT is the list of file type names. Within that folder, is a key called "DefaultIcon" which lists a path to an icon.
For example, if I wanted to change the AVI file icon, I would have to search for HKEY_CLASSES_ROOT.avi. I find that the file type name is "avifile". So, I would search for HKEY_CLASSES_ROOTavifileDefaultIcon and change the entry to whatever file I want, including, but not limited to PNGs, dlls and exes. I'd restart or refresh icons and everything would be hunky dory.
Now, the problem with the above mentioned strategy is that it just takes too damned long. It's tedious when you want to change multiple files. For instance, I extracted the old-skool Windows 98 icon for avi files (gray video camera) and just adjusted the colors in this file to make multiple icons. I then color coded all of my video file types. So, AVI is still gray, mpeg-1 is still teal, just like back in the day. Meanwhile, MKV is a blue color, OGM is a green color, WMV/ASF is a red color and MP4 is an orange color.
I want to simplify this process so that I don't have to spend 20 minutes changing a bunch of icons. Thus, enter the registry batch. The idea is to utilize a script that reads the value at: HKEY_CLASSES_ROOT*file extension*default and stores it into a variable (let's call it $filetype), then changes the value of HKEY_CLASSES_ROOT$filetypeDefaultIcondefault to the icon I want. I just need to take the time to actually do this (along with million other things I need to do.
In the meantime, I started the Murrach's Java SE 6 book I mentioned earlier. Already, halfway through a single chapter, I feel as though I've learned more than I had the past month.
Posted on May 18, 2009 at 10:31 am. 0 comments. Tags: Batch programming command prompt registry windows
Computer Books
I've bought the following books:
Murach's Java SE 6, by Joel Murach and Andrea Steelman
C++ Primer Plus, by Stephen Prata
Beginning Java Objects, by Jacquie Barker
My plan is to finish Sam's Learn Java 6 in 21 days (or most of it) and move on to Murach's Java SE 6. After that, I'll read the Beginning Java Objects book as OOP appears to be a very important concept that I'm required to learn if I want to go at all far in programming.
From there, I will probably start reading about Java ME. Once I've developed a few applications for my Blackberry, I think I'll continue on to learn C++.
Though, I'd also like to pick up a book on 3D rendering and read through that as well. Maybe I'll learn to program games (yea, right).
Posted on May 11, 2009 at 05:05 pm. 0 comments. Tags: Java C++ Java ME books programming
Moved the Server
I've since moved my web server from my hacked Xbox to a virtual server running on another computer of mine. The aforementioned hardware instability I had with the Xbox became too much to handle as I couldn't restart the device reliably. As such, I chose to utilize a more controlled environment, hence, a clean installation on a virtual i686 environment, care of VirtualBox. Xbox, on the other hand, has been shoved off to file server duty. It will now function as a file server and backup server.
In the meantime, I'm about 200 pages into my Java Book. Another 400-500 to go. The book is divided into days. I'm currently on day 7 out of 21. Afterward, I will probably move on to another Java basics book. Reason being that I want to get all I can from one person and then get all I can from another person. It's like going to any school. You'll have one teacher teach you math and then another teach you another math. Both will give you different perspectives on how things function. After I'm finished with a second book, it's on to learning Java ME and from there actually designing applications. I have another book on designing games in Java ME, but I'm unsure if I will actually design them or if I'll just take it all in for edification. read more...
