I don't see code here, why is it being detected as such? Here is the post, all in a code box:

There are a few things to tidy up, but first, some advice: there are a lot of items under MSCONFIG Startup and Services which have been disallowed (prevented from starting) - MSCONFIG is fine to use for debugging/troubleshooting, but thereafter entries should not be left unchecked. The offending items/programs should be uninstalled or otherwise removed. If items are unchecked in MSCONFIG and an uninstallation is attempted then it will not complete -manual removal from registry is then required.
For example, if you no longer use Intellipoint mouse, the program should be uninstalled, but only after rechecking the startup item in MSCONFIG. If you do use it, then your mouse will be running on default windows mouse software with attendant reduced properties/capabilities. But before you deal with MSCONFIG do these things in order:
I don't know what this is... something to so with Avast? If not known, delete C:\1081a87273cf5e78fa
Delete these two:
c:\program files\DefaultTab
c:\documents and settings\A Boze\Application Data\DefaultTab

Now to MSCONFIG. You should recheck all those startup items, I doubt if they are causing problems.
Same goes for Services. There are several entries for Symantec, entries for Mcafee, Acronis, some services you do need, and even a couple for the malware.
Once again, I suggest you enable them all, and then....          

Remove this service:
DefaultTabSearch;DefaultTabSearch;c:\program files\DefaultTab\DefaultTabSearch.exe [5/18/2012 5:00 AM 563200]
==Go Start, run, type services.msc   -and press Enter. Maximise the window and at foot select Extended tab, scroll to the specific service, rclick it, select properties. Write down the exact Service Name. Press Stop if it is highlighted [you may have to set the service Startup type to Disable first]. Close Services, now type this line into the run text box and press Enter:
sc delete "exact Service Name"  - don't be silly now, I think the required name will be DefaultTabSearch.

Now rerun the removal tools for Symantec, McAfee.              

Post those OTL and AswMBR logs along with your observations.

SSSSSSS Oh, and another little observation, I think the Insert Code Snippet button is confusing posters, so how about a "Use Ctrl-V to paste into this window" message? I think they press the Inser Code button to attempt to paste their code. Sometimes. Some people.

Recommended Answers

All 14 Replies

I don't see code here, why is it being detected as such?

The detection algorithm presently looks for four spaces, a tab, or curly braces anywhere in the post.

It was much simpler and safer to just use CODE tags. That way your algorithm wouldn't have to guess about what is or is not code, and sometimes it guesses wrong.

It was much simpler and safer to just use CODE tags.

The detection algorithm is intended to alleviate the problem of posting code without code tags. That problem exists whether the tags are implemented as BBCode or Markdown, and it's not a trivial problem due to the myriad programming languages that Daniweb supports.

and sometimes it guesses wrong.

To be honest, I'm not a huge fan of the algorithm either (I didn't write it, and the way it works is not how I would have written it). At one point I tightened it up a bit by ignoring 4+ spaces and tabs as long as they weren't at the start of a line, but that was rolled back for reasons that I've since forgotten.

Ah, a tab or 4+ spaces. Now I understand why a couple of members no longer post. If you have set "speeches" on particular topics/advices and edit them from time to time it is highly likely that spaces [those hard-to-see lil widgets] will concatenate. Bam. Code detection. Tabs and space strings are so useful for formatting text. It's war, texters vs coders.
And using your advice, Deceptikon, and dragging out 2 groups of untoward spaces in the post above I can post it normally. They hide.... but not from Ctrl-A.
They'll be back with cloaking one day.

It was much simpler and safer to just use CODE tags.

AD, as Deceptikon pointed out, BBCode vs Markdown has nothing to do with this error message. It's simply our attempt at getting people to correctly format code so moderators don't have so much work to do, which is unrelated to which parser we are using.

I wasn't really suggesting you go back to BBCode, but simulating their code tags. [code][/code] can never be confused with 4 spaces in normal text. If you parser sees "[code]" then it should know it's code, but when it sees 4 spaces your parser doesn't know whether its normal text or code.

I wasn't really suggesting you go back to BBCode, but simulating their code tags.

I didn't think you were suggesting BBCode, no worries. We do have an extended Markdown library that implements fenced code tags, but it proved finicky after release and was disabled.

If you parser sees "[code]" then it should know it's code, but when it sees 4 spaces your parser doesn't know whether its normal text or code.

I think you're confusing the code detector with actual code block parsing. The former is for enforcing code tags when they're absent while the latter is for highlighting text within valid code tags. The code highlighting part is working, but detecting likely code in untagged text is a harder task that's practically guaranteed to have false positives. This thread is about those false positives, so adding fenced code tags is a non-solution as it doesn't address the problem at hand.

when it sees 4 spaces your parser doesn't know whether its normal text or code.

The rules for code tags are

  1. The line begins with four spaces or a tab.
  2. The previous line is a code line, a blank line, or the editor boundary.

The highlighter gets this right, as far as I'm aware. I spent a lot of time tweaking it to suit Daniweb's needs.

It makes sense that if a line begins with four spaces or a tab, but the previous line isn't valid, we should raise the code detection error. That's an easy case, but the current detection algorithm takes it too far and looks for four spaces or a tab anywhere in the line, not just the beginning.

Also, since a large portion of our supported languages use curly braces as tokens, the detection algorithm also searches for those anywhere in the line.

That's all the detection algorithm does. It's most certainly not a parser as I would describe one, and it performs only superficial introspection, which increases the likelihood of false positives. And you're correct that when it sees 4 spaces or a tab it doesn't know whether the line is code or not, but not for the reason you think. ;) The real reason is that the detection algorithm doesn't match the Markdown rules exactly.

But! Even if the detection algorithm did match Markdown's rules, there would still be false positives and false negatives. One thing I've noticed is people formatting their posts like a written letter, which totally messes up code detection and highlighting because those posts try to indent the first sentence of a paragraph.

Adding fenced code tags and removing the indentation rule entirely for code would fix those issues, but we'd still be at square one in terms of detecting untagged code. It's a tricky problem, detecting possible code in any programming language. ;)

Member Avatar for diafol

On indent, the text turns green. Surely an indicator that something has happened? Seems OK to me - mind you, simpler things have confused me.

"The detection algorithm presently looks for four spaces, a tab, or curly braces anywhere in the post."
And so you trap any reference to a CLSID....

And so you trap any reference to a CLSID....

Sadly, yes.

OK, this is getting really annoying!

I spent 7 minutes trying to add a reply earlier and this CODE Detection would not let me add the post. It detected code. The post in the preview looked exactly the way I wanted it. But the code detection would not let me continue. If code is erroneously detected, we have to fix the post but there's no indication what needs to be corrected.

We need either
A) an indication of the problem (like from a compiler)
B) an override that lets the post get posted. This override could be a 'hidden' feature that those in the know are privy to (like a lot of the advanced editing features) so noobs can't override tagless code.

Oh, you nice people, the curlies range free again. And on wide open spaces, too. ;)

This is better [for me and a few others]. I hope coders obey the new regimen. I put 4 spaces in the top line to check... there is detection, but the post gets through. Good slogan, that.

OK I'll work on it this week/weekend.

Heck, go skiing or something, Dani.
I wasn't complaining, it was a thank-you. What was important was that even with space detection the post went through.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.