|
A possible problem with the code is that the programmer seemed to be sizing the array in a very arbitrary way. Unless of course "This is a test" is the max intended size of the array and the rest of the code isn't going over the array size.
Plus it forces every programmer who looks at the code to start counting on his fingers, getting to 10 and saying, "damn" before starting over because he couldn't remember if he included the space between 'this' and 'is' ;v)
|
|
|
|
|
Did this forum just change it's name again? WTF? The horrorror!
----
It appears that everybody is under the impression that I approve of the documentation. You probably also blame Ken Burns for supporting slavery.
--Raymond Chen on MSDN
|
|
|
|
|
Shog9 wrote: Did this forum just change it's name again?
Yeah... was I disappointed! I thought it was going to be a forum about using code words while talking with prostitutes.
led mike
|
|
|
|
|
|
I don't know - you look away for just a minute and the Kid Sister police swarm all over the place.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Isn't it obvious? The new name describes the content more accurately, but is also more politically correct.
Oh for the days when one could call politician a politician and no one was offended by the name.
Phil
|
|
|
|
|
Yeah. We were getting too many general WTFs. I want specific, code related WTFs.
This wasn't PC motivated. This was RTFM motivated.
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
My mistakes go to "subtle bugs", and all other to "coding horrors"?
|
|
|
|
|
Yep!
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
one of my team mate has written like this in c#
if (Request.QueryString["test1"] != null)
{
--- do something
}
else
{
Response.Redirect(Request.UrlReferrer.ToString(), false);
}
What the --------
-- modified at 6:24 Thursday 29th March, 2007
|
|
|
|
|
Could you please translate this for all the C++ programmers here
Alcohol, the cause of and the solution to all of life's problems - Homer J. Simpson
|
|
|
|
|
if "?test1=..." appears in the URL for this page
{
--- do something
}
else
{
send a request back to the client to get their browser
to re-request this page without the "?test1=..." bit on the end
} That's uuuh-gleeee
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
Actually it sends them back to the page that referred them to the current page (which isn't a good idea because Norton and McAfee like to change your settings so referrer information is not passed with the request).
Request.UrlReferrer
|
|
|
|
|
Hy one of my groub member in a project showed me this:
public static String startPhred(File directoryToEdit) {
try {
String text = "";
BufferedReader in;
if (directoryToEdit == null) {
directoryToEdit = new File("J:/user/daten/950599/");
}
try {
makeScript(directoryToEdit);
} catch (Exception e) {
e.printStackTrace();
}
Process p = Runtime.getRuntime().exec(pfadScriptFile.getAbsolutePath());
in = new BufferedReader(new InputStreamReader(p.getInputStream()));
StringBuffer out = new StringBuffer();
return out.toString();
} catch (IOException e) {
e.printStackTrace();
}
return "EXCEPTION AUFGETRETEN!!";:confused:
}
This was nice
Or the same guy did this:
TraceData is a class that we need in our project.
So he wrote, because he need a collection of this class:
public class TraceDataList{
public List <TraceData> traceDataList = new ArrayList<TraceData>();
}
public List getAb1Files (){
return traceDataList;
}
public void add(TraceData data){
traceDataList.add(data);
}
...and a method with the parameters for traceData, where he
did make a new Object and added it to his list.!!!
}
end of class!!
And yes he programms for about 1 1/2 years in Java!!
|
|
|
|
|
|
The below code was written by two of my team mates in two different projects. Below code in MFC.
...::OnMouseMove(...)
{
CRect rc; GetClientRect(rc);
ClientToScreen(rc);
POINT pt; GetCursorPos(&pt);
if (rc.PtInRect(pt))
{
}
}
What they are tryin is, checking the mouse pointer is over the window in OnMouseMove Handler... What to say?...I think one should Cut and Copy the above logic!!!..
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
Brilliant piece of being sure!!
|
|
|
|
|
Check whether they've used SetCapture anywhere. If the mouse is captured, you will get mouse event messages outside the window's client rectangle. Also, note that GetCursorPos tells you the current position - a WM_MOUSEMOVE message tells you that the mouse moved when captured or when over the window at some point in the past. Perhaps they were trying to filter out old events? This would only be a problem if the application isn't very responsive to window messages, however.
If you want to know the cursor position when the message was generated, that appears in the WM_MOUSEMOVE message's lParam parameter. This is actually relative to the client rectangle already, so ClientToScreen is not required. MFC's OnMouseMove function extracts the lParam message parameter to the point parameter.
Do note however that Windows limits the rate at which it sends WM_MOUSEMOVE messages so that applications aren't overwhelmed, if the application is busy. You used to be able to see this effect in Windows Paint if you moved the mouse very rapidly while drawing - the line would be in lots of straight segments, rather than being smooth - but modern PCs are well up to the demands of Paint, so you don't see it any more.
(Personally I would use ScreenToClient on the cursor's location and then use client rectangle-relative co-ordinates throughout, rather than converting the other way).
|
|
|
|
|
Yeah, that's exactly what I was thinking as I read the code. I wonder what the truth of the matter is....
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: I wonder what the truth of the matter is....
Here the truth...[^]
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
Mike Dimmick wrote: Check whether they've used SetCapture anywhere
No they didn't use it.
Actually what the requirement is,
1) for the 1st project to change the dialog apperiance while the mouse hovers in it. That is the dialog will be in small size, but if the mouse hovers then the size will be enlarged.
2) for the 2nd project, it is a custom button class, to give the XP effect they are catching WM_MOUSEMOVE messsage and redraw the button accordingly.
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
Parthi_Appu wrote: ...::OnMouseMove(...){
and just say
return;
That would enhance performance too by not creating objects. Isn't it?
|
|
|
|
|
One ASPX page is not loading !!!!!! Everything looks fine except this function written on page load by my dear colleague.
if(Request.Url.AbsoluteUri.StartsWith("http")
{
Response.Redirect(Request.Url.AbsoluteUri.Replace("http","https");
}
What a shame !!!!!!!!
|
|
|
|
|
ouch!
Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers! We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP Linkify!|Fold With Us!
|
|
|
|
|
i've made that mistake doing a search and replace before and ended up in a world of hurt
Russell
|
|
|
|