|
I must say it is well-self-documented-code!
Anyway, IMHO, NULL operations are useful at times.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
bigbrownbeaver wrote: What does it do
The name of the method itself explains it.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
|
I know one better.
void Class::Function()
{
bool result = true;
try
{
}
catch(...)
{
result = false;
}
return result;
}
Nuclear launch detected
|
|
|
|
|
That's an option.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Uh..... that code wouldn't even pass the compiler. You can't return a boolean value in a method declared as type "void".
|
|
|
|
|
True... the return type was boolean.
But I posted the example to see how much code and runtime overhead you need to return true from a function that does nothing.
Nuclear launch detected
|
|
|
|
|
A few days ago, i have to update our prelife server with the new code.
The code itself was written in asp (not asp.net) and developed month ago.
After updating and running some manual tests, we decided that this code works fine.
But we missed something very important...
Take a look in this code and think about what happend, after strSQL gets the value Null (database NULL)...
Function SafeSQLString2(byval strSql)<br />
<br />
if len(strSQL) > 0 then<br />
strSql = Replace(strSql, "'", "")<br />
end if<br />
<br />
SafeSQLString2 = strSql<br />
end function
The workmate who wrote this code isn't available anymore.
At the moment i'm rewriting the complete code and removing all of this trash.
|
|
|
|
|
I hope you're using parameterized queries[^] in your new code. There's no need to eliminate quote marks in a field if you use parameters.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
At the moment i'm banging my head at the wall.
I'm thinking about deleting this piece of source and write it from scratch.
But thanks for the link.
If i ever get the permission to redesign the complete application, the first thing i will do is switching from ASP to something other. At the moment i prefer C#.
|
|
|
|
|
I was responsible for this horror:
Version 1.0 I had the following:
const DWORD ACCESS_NONE = 0;
const DWORD ACCESS_VIEW = 1;
const DWORD ACCESS_MODIFY = ACCESS_VIEW | 2;
const DWORD ACCESS_DELETE = ACCESS_VIEW | 4;
const DWORD ACCESS_ALL = ACCESS_VIEW | ACCESS_MODIFY | ACCESS_DELETE;
const DWORD ACCESS_ADMIN = ACCESS_ALL;
I needed ACCESS_EXECUTE in the next version of the software. So I declared:
const DWORD ACCESS_EXECUTE = 8;
const DWORD ACCESS_ALL = ACCESS_VIEW | ACCESS_MODIFY | ACCESS_DELETE | ACCESS_EXECUTE;
const DWORD ACCESS_ADMIN = ACCESS_ALL;
Where is the horror? We promised the user that old databases and files will run without any changes.
Co-Author ASP.NET AJAX in Action
CP Quote of the Day:
It is the same Friday that blooms as a new enriching day with novelty and innovation for us every week. - Vasudevan Deepak Kumar
|
|
|
|
|
the check:
if ((access & ACCESS_ALL) == ACCESS_ALL)
will fail on (even ACCESS_ALL) old files.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
No other documentation exists except for the code below. Some may be personal preference, but I counted four problems. Maybe you can spot more.
(The code is supposed to be compliant with Java 5.0)
public interface InvitationInterface {
...
public ArrayList sendMulipleInvitations (List listemailAddresses,String msg);
...
}
-- modified at 18:35 Friday 16th November, 2007
|
|
|
|
|
One big thing stands out. Java. Urgghhhhh. Just stop there, move along - there's nothing to see, move along.
|
|
|
|
|
|
Excellent. 'Got tired of all these "great" Java tools. (DB2 Command Center is my personal favorite).
Perhaps is the moment to get back to the roots - "do one thing, and do it well".
Nuclear launch detected
|
|
|
|
|
Vasudevan Deepak Kumar wrote: No official Java support from Microsoft after December 31, 2007.
So, at last they are burying their long dead crippled Java-look-alike obscenity?
Fine. We all use SUNs VM for years now.
Please do not try to sound like there will be no more Java.
Someone might actually believe you.
And those who do not and read the whole story will come to see you as a liar.
One does not have to like Java, but at the very least one has to acknoledgr that it inspired MS to bring us .NET
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
1) I don't like that "Interface" suffix. And that Invitation is an interface (why?). And what it does anyway? Can't say without complete definition, but IInvitationSender sounds better to me.
2) sendMulipleInvitations should be sendMultipleInvitations (unless you did that typo while posting)
3) listemailAddresses - get rid of that "list" prefix
4) um, what the hell sendMulipleInvitations returns? All invitations that were sucessfully send? Or else I dunno... Either the method has wrong name, or strange return type. Anyway, yeah, List of addresses, hmm better use some EmailAddressCollectionn or List<EmailAddress> (assuming there is class like that, otherwise something like StringCollection).
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Let's be positive about this one:
1. there IS an interface, supporting loosely coupled designs
2. it is public, everyone could use it
3. its name starts with capital I
4. all parentheses and brackets are nicely balanced
5. the elipses show where the comments could go
6. maybe documentation will be added eventually?
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I found some meaningless code in my project. do you have any idea about its logic?
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
string sHafta = string.Empty;<br />
try<br />
{<br />
sHafta = ddlHafta.SelectedValue;<br />
}<br />
catch (Exception)<br />
{<br />
sHafta = "0";<br />
}<br />
}
note that sHafta is a local variable
-- modified at 5:27 Tuesday 13th November, 2007
|
|
|
|
|
Looks like the code is "shaftad"
Poor pun sorry.
I still remember having to write your own code in FORTRAN rather than be a cut and paste merchant being pampered by colour coded Intellisense - ahh proper programming - those were the days
|
|
|
|
|
classic!
WPF - Imagineers Wanted
Follow your nose using DoubleAnimationUsingPath
|
|
|
|
|
Leftover debugging code, you know, no one ever has to understand a single line of debugging code, as long as you remember to remove it
xacc.ideIronScheme a R5RS-compliant Scheme on the DLR
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
hi there, i think that maybe you don't need this code in this part, because you're doing nothing , the local variables end in the end of method and I think that this code is just for spending a little more your memory....
exists any posibility that this code has the logic that you wanted to set this variable to any of you controls (like label, textbox etc), but you did not set to anyone of your control.
I think that you forgot to set this value to any of your control.
respect
spaps
|
|
|
|
|
They must have been using the Hafta.net testing framework: Hafta.net.
|
|
|
|