Forums

The Weapons of Destiny

Quick find code: 49-50-206-60859371

Dantalian

Dantalian

Posts: 3,434 Adamant Posts by user Forum Profile RuneMetrics Profile
:@ Darn it, I went to sleep a little before you posted (had a 2pm to 1:30am workshift today, well, starting yesterday, but you get what I'm saying.) I'll probably be on for a while Sunday afternoon, so if possible, log on then, but if not, don't worry too much, I know the weekends can be busy. "He appears in the Form of a Man with many Countenances; and he hath a Book in his right hand. His Office is to teach all Arts and Sciences unto any; and to declare the Secret Counsel of any one."

19-Sep-2010 08:46:02

Eno Remnant

Eno Remnant

Posts: 5,832 Rune Posts by user Forum Profile RuneMetrics Profile
I don't mean to sound persistent Niht, but after more than a week since I promised adds, I've finally added to my story.
And, overenthusiastic writers with an obessive need for approval enjoy comments, so I'll ask you to take a look. ^_^

Sorry if I'm wasting your time. :(

24-Sep-2010 03:09:27

Dantalian

Dantalian

Posts: 3,434 Adamant Posts by user Forum Profile RuneMetrics Profile
Right, about the add... I meant to write it yesterday instead I worked on a project and got this:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

import math

class TCurve(object):
nNum = 0

def __init__(self, n):
self.nNum = n

def constant(self):
#finds the entire of the constant part of the equation
fTemp = self.gamma(self.nPlusOneOverTwo()) #gets the numerator of the constant
fTemp = fTemp / self.denominatorOfConstant() #gets the denominator of the constant and divides #the numerator by it.
return fTemp

def nPlusOneOverTwo(self):
# Returns the result of the function:
# (n+1)/2 which is used in both the exponent of the integral
# and the numerator of the constant
return ((self.nNum + 1.0) / 2.0)

def denominatorOfConstant(self):
# finds the denominator of the constant in the TCurve function
# (gamma(n/2)*sqrt(n*3.14))
nTemp = math.sqrt(self.nNum * math.pi) #gets non-gamma function part of constant
nTemp = nTemp * self.gamma(self.nNum / 2.0) #finds gamma part of function
return nTemp

def gamma(self, f):
#Performs the gamma function on f
if (f == 1): #Return 1 if f is 1
return 1
else:
if (f == .5) : #Return the square root of pi if f is 1/2
return math.sqrt(math.pi)
else: # if f < 1 take (f-1) * gamma (f-1)
return ((f - 1) * self.gamma(f - 1))

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Yep, that's (most of) the code I have to turn in. In the time it took me to write that, I could have written five times the lines of code. How do I know? Because I did, 80% of the code I wrote yesterday was testing for that code seen above. (That actually is about standard for the software industry.) But, it frustrates me that this tip of the iceberg is all the grader will be looking at.
"He appears in the Form of a Man with many Countenances; and he hath a Book in his right hand. His Office is to teach all Arts and Sciences unto any; and to declare the Secret Counsel of any one."

24-Sep-2010 09:43:51

Dantalian

Dantalian

Posts: 3,434 Adamant Posts by user Forum Profile RuneMetrics Profile
And you'd think with all that testing, my program would be reliable, right? Yet, I know how I could crash it by running a just two lines of code. (Granted, those two lines should never actually be used given what the code is supposed to do, but nonetheless, I could crash it.)

Oh, and for any of you familiar with Java and the C-based languages (which Java technically is one of), you may have noticed the lack of semi-colons. That's because all of that is in Python, which has a far more logical syntax than C-based languages (and is so much more fun to build code in, but alas, I have yet ).

And on the chance that someone familiar with Python reads this story; I assure you, my actual code has tabs in all the proper places. The RS forums, of course, do not like tabs, so they deleted them.

Oh right, the add... that thing you actually care about... it'll be up before Monday. I'll try to have it up Today, if not it will be on Sunday (provided I can get out of bed after the 11+ hour shift I have Saturday.)
"He appears in the Form of a Man with many Countenances; and he hath a Book in his right hand. His Office is to teach all Arts and Sciences unto any; and to declare the Secret Counsel of any one."

24-Sep-2010 09:50:46 - Last edited on 24-Sep-2010 09:52:46 by Dantalian

[#3LTVRBHAJ]

[#3LTVRBHAJ]

Posts: 66 Iron Posts by user Forum Profile RuneMetrics Profile
Computer technology......not my forte...

I'd rather stick to looking up things like "CIPA" (which is a very interesting genetic disorder) than try to understand what you just wrote.

An add would be much easier to read, but take your time....

Perfection comes with patience (atleast I like to think so :P )

.....And @Dogone, I'll read and comment yours if you read and comment mine ^_^

49-50-580-61670097

I've probobly got a bit more time than Aqua does...

25-Sep-2010 04:37:58 - Last edited on 25-Sep-2010 04:40:00 by [#3LTVRBHAJ]

Eno Remnant

Eno Remnant

Posts: 5,832 Rune Posts by user Forum Profile RuneMetrics Profile
Ugh... I am so glad I'm not a Bandosian, or my head would have exploded.

I'll take a look right now Nyx. ^_^

EDIT: Done! Short but sweet Nyx, I'll look forward to future adds!



~Life is a beautiful thing~
~It gives us great happiness, and terrible pain~
~Death is inevitable, you shouldn't fight it~
~Accept Death, and prove your worthiness to live~
~Dogone143-EnoGod~

26-Sep-2010 03:06:34 - Last edited on 26-Sep-2010 03:50:25 by Eno Remnant

Quick find code: 49-50-206-60859371 Back to Top