|
Test 1 was an 8 line dispose method, with 4 lines of xml comment at the start. Initially detected as text, when I selected code in the past it was tagged as xml not C#.
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
Test 2 is the same code, but without the xml comment. Detected as code and lang="cs" was set automagically as well.
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
Test 3 was a similar size xml comment and ~200 lines of "I didn't write and don't have time to refactor this method". (sorry no example since this is real code not autogenerated designer code). This was identified as code by default; but the lang attribute wasn't set at all.
Test 4 was the same code as test 3 but without the xml comment. Same results.
Neither 3 or 4 were de-indented.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
We're currently using Luc Pattyn's PRE tags galore: LPCodeRecognizer[^] code for the code sniffing. I've been looking at some other methods, including that used in the javascript SyntaxHighlight class to see if we can improve the accuracy somewhat. Unfortunately we're completely booked up with current projects for the next 4 weeks so it's not something I'll be able to tackle until then.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
|
I just ran into this spammer[^] is has hit six questions[^] so far.
0100000101101110011001000111001011101001
|
|
|
|
|
You can report this member on his homepage by moving your mouse over Report Member. Click the Spammer link.
|
|
|
|
|
|
Report member is on the right side of the screen underneath the summery of the members articles / messages / ...
Hover above it with the mouse and you'll get a menu with 2 links in it. Click on the' spammer' link.
|
|
|
|
|
André Kraak wrote: By the way all the answers posted have gone now.
I know. I deleted them.
André Kraak wrote: I am unable to find the Report Member option you mentioned.
Look at the bottom right - just above the big orange bar at the bottom. There's a red flag and beside that there's a Report Member option.
|
|
|
|
|
The only thing I see in the area you mention is Bookmark.
Do I perhaps need a certain reputation level to have this option?
0100000101101110011001000111001011101001
|
|
|
|
|
Possibly not then. I wasn't aware that you needed to be a particular rep level to use this. Oh well, sorry about that. Keep posting and I'm sure you'll soon rack up the necessary points.
|
|
|
|
|
Thank you for the effort anyway.
0100000101101110011001000111001011101001
|
|
|
|
|
I have been wondering what to do with articles that are not worthy of the name article (because lack of explanation of code), but that have a very well coded sample project provided. I usually rate them 'unclear/incomplete', but it hardly seems fair given that the author has spent a lot of time on the sample project.
Some people are great coders, but bad writers (we can't all be Sacha Barber ) or simply don't have the time or patience to write an article.
However, I am pretty sure the code may be useful to some (even if just look at it for practice).
A tip doesn't cut it either because it does not allow sample projects and it is really just not a tip.
Is there any platform for 'just' cool code?
It's an OO world.
|
|
|
|
|
|
A blog is some sort of journal (often about a specific subject).
Posting a sample project maybe once or twice is not a blog how I see it.
It's an OO world.
|
|
|
|
|
What constitutes a blobg is up to the blogger.
I have some small snippets on mine.
modified on Tuesday, August 30, 2011 5:19 PM
|
|
|
|
|
A tip is something short, direct and to the point and encompasses a single concept. Anything more than that and I'd consider it an article.
There's no minimum size on an article. Typically, an article is more of a walk-through, or a complete solution, or a discussion on a topic.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Yeah, but if there is no walk-through through the code these 'articles' often get downvoted or not accepted at all. And that is a shame for the good code that came with it.
It's an OO world.
|
|
|
|
|
Sorry if this has been suggested before:
Is it possible to add code indenting so that it would make editing code blocks a little easier?
Just along for the ride.
"the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
|
|
|
|
|
As in indent/outdent buttons?
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Chris Maunder wrote: As in indent/outdent buttons?
Yes.
Just along for the ride.
"the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
|
|
|
|
|
Can you also add code to convert tabs in pasted code to spaces?
Pretty please?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Pasted code (if detected as code) is already untabbed. I've added a manual untab button for the bits missed.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
That would be cool... it'd be very useful whenever people post large sections of code at a time... sure makes it easier to read with indentation.
|
|
|
|
|
Done.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|