|
Don't feel too bad about it, yours was pretty horrible too.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Thanks... that's, uh, comforting.
Chris Maunder: Fixign now.
|
|
|
|
|
|
I was the one that formatted it! You should have seen what it looked like before. I won't post it because it's way too large, but trust me, it was pretty bad!
|
|
|
|
|
I am not at all surprised that the original code was not nicely formated. Which means that the original code had no redeeming features.
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
Eeeegads!
This code is why code reviews were invented.
That programmer should be forced to keep working on that until it's fixed, that way you at least contain them and stop them doing this elsewhere.
If they haven't fixed it after a week, fire their ass.
Whoever the developers were that let it through a code review...Fire their asses too.
Of course I jest.
There wasn't a code review, there never is in these situations. So fire whoever is responsible for ensuring there are code reviews.
If nobody is responsible for ensuring there are code reviews, fire the person responsible for ensuring that there is a person responsible for ensuring that there are code reviews.
When you've recursively made your way to the top of the Org Chart and fired everyone and the company no longer exists, this mess of code will have served it's purpose.
-Rd
Hit any user to continue.
|
|
|
|
|
... where they breed such ingenious people?
I have a similar thing here. Thousands of lines in one (static) method which are supposed to generate each and every database query the entire application may need. A nightnare to debug...
"I just exchanged opinions with my boss. I went in with mine and came out with his." - me, 2011
--- I am endeavoring, Madam, to construct a mnemonic memory circuit using stone knives and bearskins - Mr. Spock 1935 and me 2011
|
|
|
|
|
Where did you get this stuff? Didn't teachers in university/college tell that you need to split a job into smaller chunks like subfunctions?
|
|
|
|
|
wow
|
|
|
|
|
He must be suggested to join anti-if campaign.
// ♫ 99 little bugs in the code,
// 99 bugs in the code
// We fix a bug, compile it again
// 101 little bugs in the code ♫
|
|
|
|
|
|
The reason I'll go home now (for today):
public SendAction(final Mail oMail, final boolean probe) {
this(oMail);
setText("Send Probe");
send_as_probe = true;
}
public SendAction(final Mail oMail, final int later) {
this(oMail);
setText("Send Later");
send_later = true;
}
Nice. It's pretty clever (sort of )- someone wanted to call the same object in another way...
see'ya tomorrow... need to go home and daze my programming mind with some beer...
Torsten
I never finish anyth...
|
|
|
|
|
Looks kind of funny... feels like the urge for booze increases... cheers mate
(yes|no|maybe)*
|
|
|
|
|
right - that helps most times. Did I mention that I live really close to a German Biergarten[^]
I sorted out all of the booleans (there were some more in the deeper code...) and deleted 2 constructors in this Action.
public SendAction(){
setId(SendAction.ID);
}
public SendAction(final Mail oMail, final SendMode oSendMode) {
this();
}
regards
Torsten
I never finish anyth...
|
|
|
|
|
TorstenH. wrote: Did I mention that I live really close to a German Biergarten
who doesn't, every german citizien lives near one... and in bavaria... which I actually do...
(yes|no|maybe)*
|
|
|
|
|
If only something would point me in the right direction...
Warning: require_once() [function.require-once]: open_basedir restriction in effect. File(/home/fitpccom/public_html/fit-pc1/includes/version.php) is not within the allowed path(s): (/home/fitpc:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/fitpc/public_html/fit-pc1/includes/joomla.php on line 71
Warning: require_once(/home/fitpccom/public_html/fit-pc1/includes/version.php) [function.require-once]: failed to open stream: Operation not permitted in /home/fitpc/public_html/fit-pc1/includes/joomla.php on line 71
Fatal error: require_once() [function.require]: Failed opening required '/home/fitpccom/public_html/fit-pc1/includes/version.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/fitpc/public_html/fit-pc1/includes/joomla.php on line 71
|
|
|
|
|
I spotted it! Line 71 is using PHP.
This is not the age of reason, this is the age of flummery, and the day of the devious approach. Reason’s gone into the backrooms where it works to devise means by which people can be induced to emote in the desired direction.
|
|
|
|
|
Let me fix this for you
guyzz I haz a problem with my app. i get this weird error when i try to run it can soembody fix for me an give me proper codz plz? i haz no clue what is wrong as i cut and pasted exactly what was on that website
Warning: require_once() [function.require-once]: open_basedir restriction in effect. File(/home/fitpccom/public_html/fit-pc1/includes/version.php) is not within the allowed path(s): (/home/fitpc:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/fitpc/public_html/fit-pc1/includes/joomla.php on line 71
Warning: require_once(/home/fitpccom/public_html/fit-pc1/includes/version.php) [function.require-once]: failed to open stream: Operation not permitted in /home/fitpc/public_html/fit-pc1/includes/joomla.php on line 71
Fatal error: require_once() [function.require]: Failed opening required '/home/fitpccom/public_html/fit-pc1/includes/version.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/fitpc/public_html/fit-pc1/includes/joomla.php on line 71
Programming is a race between programmers trying to build bigger and better idiot proof programs, and the universe trying to build bigger and better idiots, so far... the universe is winning.
|
|
|
|
|
gavindon wrote: guyzz I haz a problem with my app.
Oh no, a lazy n00b in need of help!
Luckily we have uber Google searches[^]
It's an OO world.
|
|
|
|
|
Look at the paths - user fitpccom causes the trouble:
/home/fitpccom/public_html/fit-pc1/includes/version.php
/home/fitpc/public_html/fit-pc1/includes/joomla.php
But, well, you're right: require_once should be renamed to require_thrice .
"...then shalt thou count to three, no more, no less. Three shall be the number thou shalt count, and the number of the counting shall be three. Four shalt thou not count, neither count thou two, excepting that thou then proceed to three. Five is right out. Once the number three, being the third number, be reached,..."
|
|
|
|
|
Private Function GetFullName(firstName As String, middleName As String, lastName As String) As String
Dim fullName As String
Dim firstEmpty As String = String.IsNullOrEmpty(firstName)
Dim middleEmpty As String = String.IsNullOrEmpty(middleName)
Dim lastEmpty As String = String.IsNullOrEmpty(lastName)
If firstEmpty Then
If middleEmpty Then
fullName = lastName
Else
If lastEmpty Then
fullName = middleName
Else
fullName = lastName
End If
End If
Else
If lastEmpty Then
fullName = firstName
Else
If middleEmpty Then
fullName = String.Format("{0} {1}", firstName, lastName)
Else
fullName = String.Format("{0} {1} {2}", firstName, middleName, lastName)
End If
End If
End If
Return fullName
End Function
I wasn't sure if I should put this in "Clever Code" or "Hall of Shame".
This is not the age of reason, this is the age of flummery, and the day of the devious approach. Reason’s gone into the backrooms where it works to devise means by which people can be induced to emote in the desired direction.
|
|
|
|
|
There is a small change in the specs, we now have two more optional (middle?) initials. Please adapt your code...
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I actually know two people with 5-letter initials (they each have double middle and double last names).
This is not the age of reason, this is the age of flummery, and the day of the devious approach. Reason’s gone into the backrooms where it works to devise means by which people can be induced to emote in the desired direction.
|
|
|
|
|
Here it is pretty normal to have several "first names", in Dutch we actually call them firstnames (plural), although first, second, third, etc. would be more logical. I have four. So we don't really have a middle name or middle initial, when you ask me for a middle initial you'd get three of them. And all that is without double or composite names.
How about the code?
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Luc Pattyn wrote: How about the code?
Ok, I'll construct the N-name control. The user can enter any number of name parts, and select (from a drop-down) the type each name part is. It will look a bit like this:
[First v] _________
[Middle v] _________
[Last v] _________
[Freak v] _________
[Add Name Part]
Of course, there will be validation rules (e.g., last names cannot appear before first names). Happy now?
This is not the age of reason, this is the age of flummery, and the day of the devious approach. Reason’s gone into the backrooms where it works to devise means by which people can be induced to emote in the desired direction.
|
|
|
|
|
No
(yes|no|maybe)*
|
|
|
|