Show Posts
|
Pages: [1]
|
1
|
BPSITE / Geek's Corner / The Gathering of Programmers
|
on: December 01, 2005, 09:54:08 AM
|
I had to mod every source file, and I printed every source file... and yes, I did finish 8 Ah, that's what I thought. Also, that is what Dung did in her version. In my version, I kept the 3-input constructor(params) the same, and simply created a data object in the constructor that would be updated later in the main() program. That way, I didn't have to change the constructor type in all the different employee classes. See below code example: // in Employee.java: // three-argument constructor public Employee( String first, String last, String ssn ) { firstName = first; lastName = last; socialSecurityNumber = ssn; birthDate = new Date(); //WGG creates NULL date object } // end three-argument Employee constructor
// in PayrollSystemTest.java: employees[3].setBirthday( new Date(2,22,1904) ); // update birthdate
It seemed simpler that way. (it's rare when I choose the simpler path, btw) --Slip
|
|
|
2
|
BPSITE / Geek's Corner / The Gathering of Programmers
|
on: November 28, 2005, 01:26:54 AM
|
So is everyone else finished with their Java problems #7 and #8? Yeah, I thought so.
one question: did you modify all of the source files for the payroll program (Hmwk #7) and print them out to hand in? Or did you just show the modified output? I'm curious, cuz it's a lot of source code to print!
(Looks like I need another THanksgiving holiday to catch up.) --Slip
|
|
|
3
|
BPSITE / Geek's Corner / The Gathering of Programmers
|
on: November 13, 2005, 10:56:56 AM
|
To Blackmail BTW!! WTF?! You didn't go to either class this week. The class you did go to you walked back out..... What's up with that, Slip? Time is not a constant; it's a very flexible medium... Therefore, I merely had to approach the campus--even hours after it was over--and the class materials were automatically downloaded into my notebook. Amazing. Then, I realized that I had done this sometime before. Hmm, so this is actually review material, in a way. Then, I woke up and realized it was all just a bad dream, and I hadn't actually registered for this semester. Then I woke up from that dream with a smile, because I realized it was true. --Slip
|
|
|
4
|
BPSITE / Geek's Corner / The Gathering of Programmers
|
on: November 11, 2005, 10:17:43 PM
|
I told you!! Didn't I tell you?? Well I did. You have untill tomorrow afternoon to get it done. remember, you don't have to make it GUI. PS. normaly people who have an account, login then post :rolleyes: Huh? :blink: Hoo r u ranting to? --Slip :alien:
|
|
|
5
|
BPSITE / Geek's Corner / The Gathering of Programmers
|
on: November 04, 2005, 03:27:13 AM
|
I'm glad you like that Slip What i'd really like is for you to find a way to make your AYBABTU animation run only once, then hold at a specifc graphic image. think u can do it? (fortunately, my Firefox setup can disable animated graphics, but... whew! eyestrain.) -Slip :alien:
|
|
|
6
|
BPSITE / Geek's Corner / The Gathering of Programmers
|
on: November 02, 2005, 08:36:45 AM
|
Oh YES! *CHARGING* CLEAR!! *ZAP* :sheep: Well… not really, but seeing that my code takes 6 pages 8 pages (+2 for screenshots) (I couldn't fit as many lines as I thought on one page)[/size] to print it would have been a big post. However, I did find the Export option on my compiler, so I exported it to html and added a little bit to it (my screen shots). Oh right, what the hell is the assignment? The assignment was to: Add two full fourth order polynomials (I’m saying “full polynomial”, I just mean that there are no gaps in the polynomial powers, ex 1x^4 + 1x^3 + 1x^2 + 1x^1) Multiply two full fourth order polynomials Add one full and one NOT full polynomial Multiply one full and on NOT full polynomial Oh ya, did I mention that this is to be done ALL with linked lists? No? Well, they are! Here it is. Project Polynomial IndexCould some please tell me why I’m getting those errors. :unsure: Your next assignment is to integrate the Zero Wing game graphics into your Java program for teaching Multiplication to children: "MAIN SCREEN TURN ON" What is the answer to 6 x 7 ? [ummm, 67?] WRONG!! ANSWER!! <YOU KNOW WHAT YOU DOING??> Try again: What is 6 x 7? [uhh, 76?] WRONG AGAIN!! <YOU HAVE NO CHANCE TO SURVIVE MAKE YOUR TIME> and so on... --Slip :alien:
|
|
|
7
|
BPSITE / Geek's Corner / The Gathering of Programmers
|
on: October 04, 2005, 11:15:13 PM
|
Hmmm, Smi.
Looks complicated. :unsure:
Here are some more thoughts (to further complicated/simplify the tour logic):
The algorithm should have some penalty in not going in a straight line (or large circle). That is, there should be some bias given to paths that are approximately in the same direction (in successive moves). I don't know how to do it yet, but I think it involves taking the cosine or sine of two successive paths and encoding them into a matrix. Then, not only the length of the nearest city but it's straightness along your current path helps the salesman decide where to go.
In the ideal case, you would start in a straight line and move from one end to the other. In another case, all cities are arranged in a circle with very little arc (sine penalty) between cities.
--Slip :alien:
|
|
|
8
|
BPSITE / Geek's Corner / The Gathering of Programmers
|
on: October 04, 2005, 02:13:51 AM
|
I recalculated things. I found that it takes about 4.8E-6 seconds to make a complete path, which brings my 15 city test to 4.8 days to complete. <_< That brings my 20 city test to 2,700 years. :blink: However!! I added a little bit of code saying, “if the current running total is more then the current shortest path, don’t continue down that path!” Having said this, my 5 day runtime went down to 24 seconds!!! There is no real way for me to calculate the amount of time my program will take to complete, but if my program goes at it’s current rate it’ll take about 9 hours. :cool: It finished in 55 minutes :cool: Time to work on that other HW. [Just one of the search programs? :sheep: Speaking of which, Java HW is Page 283 #6.30. Don’t forget your /:( faces! Smi, Werry impwessive. That's a nice optimization. What is the final time for 20-cities? Yeah, I believe that the pointer-array stuff applies to all 3 sort methods. (hah, since I put all 3 sort functions into 1 prog, that'll save me some time. (and I need time, all the time!) We are all just :sheep: in the world. Except for me, of course. I'm an :alien: --Slip
|
|
|
9
|
BPSITE / Geek's Corner / The Gathering of Programmers
|
on: October 03, 2005, 10:34:09 PM
|
I've worked it out with 4 and 5 cities. but the problem is that I don't think that my technique works when there are more cities... the only way for me to see if mine works is for someone to make the program as the instructor suggested (the brut force way), even if that person has to be me if everyone wants to be punks and not show in the forum <_<
My technique works by starting at one city and fallowing the shortest path to all adjacent cities. Here’s the problem, it doesn't look far ahead, and there are paths that are shorter overall. I tried to overcome some of this by starting anew at every city, but this only helps, not fixes the problem.
great graph, Smi!! Looks vaguely familiar, as if in a dream, in a Dungeon, spoken in the foreboding voice of the D.ungeon M.aster... Well, actually those Red paths are looked at, but not in that particular part of the graph. So C-D and C-E are either taken or looked at, but they were rejected at that particular point in the sequence. I know what you're talking about, tho. --Slip :alien:
|
|
|
10
|
BPSITE / Geek's Corner / The Gathering of Programmers
|
on: October 03, 2005, 08:32:30 PM
|
Uhhh, that can't be right. Weeks?? to solve a 20 city problem? Is your computer "powered" by a treadwheel, revolving only by the sheer willpower of an elderly, arthritic hampster--as it negotiates the tricky wire slats with its custom-made walker?? (or, maybe I should finish coding my program...) --Slip :alien:
|
|
|
12
|
BPSITE / Geek's Corner / The Gathering of Programmers
|
on: September 27, 2005, 01:37:44 AM
|
That's impressive Smi, <_<
You can test if it works properly by making the city list very small, like 4 locations, and then seeing if your algorithm works for that quantity.
Btw, I hope this homework isn't due tomorrow. otherwise, i'm hosed.
Could you bring your DM book to class?
-Slip
|
|
|
13
|
BPSITE / Geek's Corner / The Gathering of Programmers
|
on: September 21, 2005, 01:44:32 AM
|
Smi256, Hmmm, I got about 120,000 comparisons in the 10,000 element Merge Sort algorithm. That's about twice your figure.
where did u put ur comparison counter? I put mine after splitting the arrays into 2 pieces, then I counted the comparisons in the for loop.
-Slip
|
|
|
14
|
BPSITE / Geek's Corner / The Gathering of Programmers
|
on: September 15, 2005, 08:30:03 PM
|
Hi, we are on a mission, are from Mission, and seek to get through this semester of programming with minimum headaches and maximum grade. If those are your goals also, then join up (register and log in) and have some fun. We can still use the file area at the Yahoo MC_Programmers group for shared data and code, but discussions may be easier in this forum. It's all voluntary, so do what you like. Just as long as you do SOMETHING. ttyl, Will :cool: btw, this forum does allow small files to be attached to messages, so if that's easier for you, then have at it. :sheep:
|
|
|
|