Epnix.Com

A place to test and try things out

Well for the most part all went well with moving the forums from utopianguild’s .org site to the .com site. One. Thing I had forgotten we I first got started with it was when I did the exports out of mySQL that i was going to a older version and needed to make it compatible.  Which, btw,  means someone should probably look into getting that upgraded.  Nothing wrong with it security /patch wise as it’s up to date , but there have been improvements in efficiency and such.  Anyhow by not making it compatible when I tried to do the import it would throw an error.  I wish the error would have been something along the lines of  “it’s not compatible” instead of the cryptic mess it tossed.  Another wonderful thing about mySQL is the export features.  If the system doesn’t like the export cause maybe there are to many records or such, it just saves a empty file.  Yep just changed the title of this post to “Things about mySQL that make me go gray faster”.  The good news is, I’ve gone though this before so I recognized the problems which jogged my memory and changed accordingly.

Today however, as I type this, some new problems are cropping up within the forums.  One is when I go to the system tab in PHPbb3 , even though I ran the update, it’s showing as not updated.  Just on that tab though.  The main tab says that everything is just fine.  Also, at least one user isn’t seeing the forum listing right away….

UPDATE: Kind of multitasking, typing this as I am working on the forums.  Tish pointed out on the system tab that the update didn’t complete right, so I went to update it, and BOOOOOOOOOOOOOOOOOOOOMMMMMMM Now I have nothing.  WTFH !!!!!!!!!  Why is it that what should be the easyest of things end up taking days to resolve. It’s always something new.. Gerr…….

UPDATE #2: Stupid .htaccess files.  Granted that’s what happens when you use a system designed for Apache on IIS, but somethings I have no control over.  Still fighting with the system, but at least it has a pulse.

UPDATE #3: OK so I can’t ever do a automatic update on this server, it’s always going to be a well probably though some other program like Dreamweaver or Expressions Web that will allow me to download and replace files in a local set then upload the changes.  The Autoupdate HAS to put the that file in there, but the hosting servers does not allow for it. The very pressence of said file makes the site unreachable.  Nice eh?  UGH! Hopefuly we got all the files updated this time, and everything will work well.

So as I sit here trying to manualy setup and configure a WAMP server A few thoughts cross my mind.  The most pressing one at the moment is WTH is wrong with mySQL (or my server) that’s preventing it from installing and running right on my system.  I’ve tried to get this stupid (yeah not the first word that came to mind but probably the better choice) database server up and running and it keeps hanging on verious steps.  It’s really geting to be quite a pain in the butt.

Which basicly leads to the next question as to why I can’t take the easy road and just download and install a pre-packaged WAMP. It would save me many hours and much aggervation… well at least for now. I mean, I know the reason, as soon as I want to make some form of change to a configuration and not know where it’s at.  I’ll blaim my lack of knowledge on the fact I’m using a package.  Which would then prompt me to want to get another server just so I can play around with things, which would lead me right to moment like this where I’m asking why the stupid thing won’t install ….

Quick Update: As I’m typing this, it did finaly work… Haazaa!!!!!!

… So it doens’t matter if I set things up like this now or later I’m going to eventually run in to the same problems, so better deal with them sooner I guess…. Gerrrr.

Well Now just to figure out the virutual hosting, I know how I need to set up apaches config, well for the most part.  It just the whole folder structure that I’m trying to figure out.  Even though it’s my server, I’m trying to set it up in a way that would mimic how differnt sites would have their own area with thier own FTP and mySQL (and of course phpMyAdmin access). I realize that phpMyAdmin has to be in some sort of default folder for the webserver instead of in the individual site folders, but does that go on the same level as the the vhosts?  Do I make sure that, that folder listens to 127 .0.0.1 only? If it does how would remote users access it? A specific port maybe? hmmmm

Well got the upgrade to WordPress installed, which is always a good thing, though I’m not sure if it will post to my Facebook page or not.  Hopefuly I didn’t accidently delete something important, guess we’ll see shortly after I hit the publish key.  Also with the update I picked up a new theme for the blog, I had the other one for a bit, time for something new.

I still have some house keeping to do, but most of that will happen when I get the other blog going.  I know I have a hard enough time keeping up with one blog, how the heck am I going to keep up with 2.  Well part of it has been my instance of getting the other site working, so I don’t post anything cause I need to get the other site working.  This of course leads to frustration cause I couldn’t seem to get it working (though I’ve made some great progress as of late), which then lead to me not working on it at all, and not posting at all for….. Months.   Hopefuly that won’t contiue to be the case, and I can get posts moved, and categories trimmed and shaped up.  Then I’ll be back to posting happly on which ever topic moves me.

Enough typing for now, have work to do.  Now to see if this carry’s over to face book (crossing fingers).

Ok bad pun on Class development but that’s where I’m at in the current book.  I think I already have a follow-on book lined up for when I get done with this one.  It’s still a Intro style book, I tend to do that cause everybody has a different approach as to how to teach, what’s good foundation stuff and what’s not.  One example of this, the Head first book suggests using just a simple texted editor like notepad, instead of a IDE (integrated development environment) like NetBeans. The logic is your learn the IDE more then the language.  However the book I’m looking at reading next is the exact opposite.  It has whole sections dealing with how to use NetBeans to type out Java applications, Apps and so on. So yeah, in my opinion it’s always good to read though a couple of books.  The big down side though is sometimes you don’t want to pay to much attention when a topic is discussed that you think you already covered in the previous book.  This is tedious for sure, but it still needs to be read so you don’t miss the chance at some little gem of knowledge that you might otherwise not have known. 

Anyhow, back to the chapter at hand, They are discussing a methodology or approach to writing classes. Their task list goes:

  • Figure out what the class is suppose to do
  • List the variables and methods (Don’t forget to create methods to encapsulate your variables)
  • Write prepcode
  • Write test code
  • Implement the class
  • test
  • Debug and re-implement, repeat as much as needed.

This seems like a pretty straight forward and logic approach, which brings to mind a few questions (I know, I seem to question everything sometimes).The first and foremost is that I need a better method of deciding what classes I need, Ok not really a question as much as a observation.  Next is, that they, rightfully, say a programming workplace might have a different approach to writing java code.  I realize that everybody does things a little bit differently but really, how much could you change without totally throwing out any sort of quality control.  If you dropped test code and debug.  Ok almost went off on a rant without really knowing how it works in a real programming shop.  So if anybody would like to fill in the blanks as to how the real work flow for a java programming shop it would be cool to know.

More About Objects

No comments

Here is my Code:

class Horse {

int HairColor;
String Name;
}

public class RefObjTest {

public static void main (String [] args) {
Horse a = new Horse();
Horse b = new Horse();
Horse c = b;

System.out.println(“We have 3 Horses”);
a.Name = “A”;
b.Name = “B”;
System.out.println(“The first horse is ” + a.Name + “, the second is ” + b.Name + “, and the last ones’ name is ” + c.Name + “.”);
System.out.println(“Changeing Horse c’s Name”);
c.Name = “C”;
System.out.print(“The first horse is ” + a.Name + “, the second is ” + b.Name + “, and the last ones’ name is ” + c.Name + “.”);

}
}

And Here is my Out put.

We have 3 Horses
The first horse is A, the second is B, and the last ones’ name is B.
Changeing Horse c’s Name
The first horse is A, the second is C, and the last ones’ name is C.

The good news is, I can see what’s going to happen.  What I don’t understand is, Why would I want this?  If I’m looking at houses on the street, or horses in the barn, Seems like it would be really inefficient to create a full object for each one. Hmmm Well I suppose it could be just where I’m at in the book, maybe there’s a better way of doing things down the way as far as utilizing the classes that are made.

Ok, I’m going the spare you the Why this question comes to mind, but I’m still going to ask the question. Can Elephants Jump?  I just put that question into Facebook / twitter as this Chapter starts out talking about putting a Giraffe into a Rabbit variable.  and calling Rabbit hopper = new Giraffe(); .  So I thought yeah, might be interesting seeing a Giraffe hopping, but then thought oooh what would be even cooler was seeing a Elephant jump… If they could how much would the ground shake?  Ok Back to java.

Variables in themselves are pretty straight forward until they talk about Object reference variables.  I think I know what they mean, but the examples they are giving are not helping at all. So I’m stuck trying to sort though what is correct.  It’s these times that I wish I had a Instructor or at least a mentor that can say ok that example is causing more confusion, here look at it THIS way, until it finally make sense.  Or they could listen to what I’m thinking and say yep, you actually got it, ignore that example.

What I’m looking at is this.

Horse a = new Horse();
Horse b = new Horse();

To me, I’m looking at 2 instances of the object Horse.  One instance is called “a” one instance is called “b”. And lets say I sent some color Instance Variable on “a” to be red and on “b” it’s brown.  Let me Show the whole Code:

Horse a = new Horse();
Horse b = new Horse();

a.haircolor = red;
b.haircolor = brown;

So how I have 2 objects, that are instances of Horse.  According to the book I have 2 Horse Objects, and if I did:

Horse c = b;

To me I would now have 3 instances of the horse object with b and c being exact duplicates of each other.  According to this book though I only have 2 objects as b and c reference the same object.  The difference is, if both b and c are referencing the same object then if I make a change to a variable in b wouldn’t it also be changed in c?

Looks like time to let Google do some walking.

I’ve decided to name the learn Java posts based on the chapter titles.  I’m sure I could use the exact title in the title of the post, but there’s usually no need for that, just something close.

The book says when designing a object think about what it “Knows” and what it “does”.  For me it’s just easier to remember Variables and Methods.  I suppose I could mix their example with what works for me to get Variables and what it does.  It’s just a paradigm to help one remember what your looking for when creating a class.  The be correct, your thinking of what the Objects instance Variables and Methods are going to be.

In some ways I see java as being messy with all the files.  One file per class, a large program would have a lot of bits and pieces scattered all over the place.  Well yes, it would be all in one folder, and yes, it can be contained in a .jar file but still.  Of Course I’m looking at it from a solo developer point of view. Where you would have to work on all sorts of different files at any given time.  However in a team perspective, it makes more sense, as everybody could easily work on their with out locking out someone else from what that other person has to work on. Good news is keep all the files in one folder then Compile via wild card:

javac *.java

Then hope you didn’t have any errors.  I wonder if there is a command to redirect error output to a file.  I remember doing that way back when, in High School no less, when we had to learn Pascal.  Except instead of file, we dumped to a printer.  It was funny, you’d send the job and then listen for the printer.. If it only buzzed for a few lines then you had some small syntax error, maybe forgot to declare a variable or something If it printed pages of errors, you missed a semi-colon and didn’t even bother to look at the printout.

Well looks like I can

javac class.java –Xstdout filename

though in a option to put all the resultant class files in a different directory

javac class.java –Xstdout complemsg.txt –d finished files

That should make everything all neat and tidy.

Lessons in Java

No comments

I have a plan.. Ok maybe not so much of a plan as a lose set of possibilities. One of which is to make apps for the Blackberry.  The reasons are 2 fold.  One is to make any oddball app that I want, though I have to admit the Blackberry community is pretty good at covering that.  The other is to make some a little bit of money, if I can sell 100 copies of a app that people want at a $1 a piece, that’s still $100 bucks more then I started with.  Not to mention the fact that in most cases I probably want the app also.  It give me more programming experience, so I’ll be getting paid to learn. Finally anything that is a web technology is good for my current career choice.  Not a bad deal all the way around.

Of course there is a slight problem, part one of this many part problem is knowledge of the Java Programming language.  I’m a little lacking there.  So This is the beginning of Project file on learning Java.

What will be seen under this category and tags is my notes on learning the language and some of the pitfalls along the way.  I know they will be useful for me, but I also hope that they will be useful to anybody else that may be trying to learn the language at a future date.  I guess one more thing I should say is I’m not trying to teach the language here.  There are plenty of books out there and some websites that will do that.  Again, this is more my thoughts, notes, and “discoveries”

My posts and projects are a bit disjointed at the moment, I have this listed as Project 2 even though it will probably be posted before project one.  I will be bouncing around to give the brain a break on a particular topic, and even thought I started the server project a bit ago, Java is what I’m working on now.

What I’m using:

I personally learn best from various “teach yourself” books and the one I’m reading right now is called “Head First Java” Second Edition, by Kathy Sierra, and Bert Bates (ISBN 0596009208) (hmmm side note, I guess if I’m going to do that I should learn how to do a proper citation).  It’s a 2005 book, but I don’t see a 3rd edition at this time, and this one does seem to be well regarded, with good and recent reviews.  So I guess it’s a good place to start.

For Java, using JDK 6 update16, which btw this was the first sticking point in learning Java.  You can’t just go to Sun’s website and click on the java button.  That’s going to take you the version that you need to run apps.  To write programs you need the development tools. Personally there is to many choices at that link.  If all  your trying to do for now is learn java look for the block that’s labeled Java SE Development Kit (JDK).  Download that and install.  The Book recommends also downloading the documentation.  Which I did, but haven’t installed it yet.  After getting it installed I had to add to the windows Path statement where the JDK Bin files where.  When copying the path from windows explorer make sure to copy the path to the JDK, not the JRE that installs.  Yeah, Duh! I know, makes sense huh?  Well sometimes logic fails at 2am.. oops!

Today’s Notes:

Source file Contains one Class, Class Contains one or more Methods, One method contains a set of statements.

Basic “Hello World” Program:

class HelloWorldApp {
   public static void main (String[] args) {
      System.out.println(“Hello World!”);
   }
}

NOTE the “S” in String[] is capitalized. Along with System, but I had gotten that one right. (Book uses a different example)

Must have a “main” method in every app, but not in every class.  Apps can contain multiple Class files.

Syntax:

  • Statements end in Semicolon’s
  • Most white spaces don’t matter
  • Must declare type and name of variables (ie. int weight;)
  • Classes and methods must be defined with in curly braces { }
  • // Single Line Comments
  • /* Multiline comments
        are like this with the Asterisk slashes */

while (condition) {
   statement;
}

for (initialization; termination; increment) {
    Statement;
}

One thing I can’t seem to remember the order of creation.

  1. write / Save the .java file
  2. Comple .java file : javac appfile.java This makes the .class file
  3. Run the .class file: java appfile.

I was, and well still am, planning on using this blog as sort of a digital notebook of some of the stuff I was working on.  This way, if my thought process was flawed as I’m learning / trying things out, someone more knowledgeable on the subject at hand could chime in and correct me.  The only problem is, as I’ve discovered from my sister-in-law that some that have come here, I pretty much confuse.  So It looks like I’ll be making 2 blogs.  One that’s going to be “personal” one, and one that’s more for the techno babble.  Granted some of the tech is going to spill over to the personal one, cause well it’s what I do.  But I’ll try to keep it to more reviews and such. 

Which is which, well Epnix.com is going to be the Tech blog. Where the categories / tags will be set for each of the myriad of projects that I have.  The personal one well hasn’t been made yet, which is actually the source of the first project that I’ll be posting about. 

This of course doesn’t mean if your not technical don’t read the epnix blog, just warning everybody what to expect here.

I have found my nemisis when it comes to blogging, and it is the “delete” button, that includes it’s best friend “backspace”.  Why?  Becouse that’s pretty much what has happened the past few months to me posting a new blog entery.  That and I don’t sit here and hammer out blog posts untill they are done.  Though in some cases, one should consider themselves lucky that I’ve not posted some of the “walls of text” that I’ve written.

Side Note: funny thing is, when most people get started reading something, they finish it, no matter how bad it is.  I wonder why that is? Maybe a glimmer of hope that something intellengent would come out of the 10-20 minutes that they have just wasted prior to that?  Or I suppose it could be that everybody DOES love a train wreck and just has to poor though it all.  This way in the event they happen upon the unlucky sod that wrote it, they can let them know in detail what was wrong.  I don’t know, I suppose I could look into it more… what do you think?

Regardless I’ve had more then a couple of posts that have never made it out of draft as I didn’t like them for one reason or another, and instead of fixing them.  Delete!There were 2 in the que just a few mins ago, one was another verision of this very post, that just hit the magic delete function.  One reason is that I’ll get started writeing a post, then have to leave it for one reason or another.  Writing, interupted, well at least for me, is never a good thing as it takes hours for me to get back on track as to where I was going with something.  The problem is, when the writing got interupted, it may be days before I get back to it.  So anything I thought was a good idea or maybe somewhat humorius, is gone.  Also when I look over the post in question I start thing oh that wrong, and this don’t work, and….. bah, might as well start over.   After that the big problem is, I had so much to day about whatever it was I was about to write about. Plus I want to add on the latest “news” or thoughts to what is already a large post.  I end up with a wall of text that has a tempral, space / time issue.  I alude to future stuff while I write past stuff as if it was happeneing shortly before writeing it instead of days later.  Yep, and another post bites the dust.

Anyhow, so let me get this post off before it goes by the way side and gets deleted like so many others.

Have a good one