|
Firefox. But you didn't paste into pre tags
<div>Nope</div>
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
Hi Chris,
any progress in the automatic code recognition you ordered and I provided here[^]?
I haven't heared from you on this subject since this[^] rather off-topic message.
|
|
|
|
|
Nice hijack.
I was actually halfway through a reply to your previous message but illness and now travel have thrown me completely off schedule. I'm trying to work through a bunch of emails today.
Quick Answer: your excellent code is server, not client side, so will require an Ajax call if we're going to use it to automatically wrap pasted code in PRE tags.
There is an alternative: We could use a Markdown-type-thing whereby any text that is indented 4 spaces is considered code and gets wrapped in PRE tags on the server side. This would mean never even needing to see a PRE tag because they would be added behind the scenes, and your language sniffer could then add the lang= part.
I was also thinking we should just ditch PRE tags in favour of CODE tags. Much more intuitive.
(Sorry for the scattered reply - juggling lots in the brain today)
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
1.
No sir. If you were to play with the test bench for a couple of minutes, you would be sold to the idea and accept a little server action to support it.
Have you ever tried to copy a few dozen lines of code from Visual Studio to the CP editor? it goes wrong easily and in many ways: HTML encoding check box forgotten, language not specified, too many tabs, ... Try again in the test bench, it is all automatic. I copied all kinds of text snippets and code snippets, without worrying a bit, and it all came out the way I intended. So that is what we should have in all CP editors, if you ask me, and the people who voted for my article.
BTW: are the "hyperlink become two links and possibly an article title" tricks not server side? and you did ask for a C# solution!
2.
The markdown idea does not solve the main problems; it may be a nice additional feature, but it does not touch the heart of the matter: a lot of people just pasting without worrying about anything, AND to be operational it requires people to learn yet another language or behavior, and pay attention. So IMO markdown is NOT an alternative, it is another feature, not really a solution.
3.
Chris Maunder wrote: ditch PRE tags in favour of CODE tags
with my stuff, the user does not enter PRE tags, he gets them for free.
And at the moment, at least in forums, PRE tags change the background color and offer useful syntax coloring with improved readability, whereas CODE tags don't change the background color making syntax coloring horribly unreadable lacking contrast (that is why I have been asking all the time to select lang='text' by default for CODE tags and not for PRE tags).
I wish you'd only spend a few minutes with the test bench...
|
|
|
|
|
Luc Pattyn wrote: you would be sold to the idea and accept a little server action to support it
It's not me who needs to be sold. It's the poor sops with slow connections that may get cranky. I've used the test rig and it's very nice.
Luc Pattyn wrote: And at the moment, at least in forums, PRE tags change the background color and offer useful syntax coloring
What I was suggesting (though not clearly) was making the CODE tag behave as the PRE tag does currently. There would still be nice formatting and colourisation. It would just mean that members would wrap code in CODE tags (when they need to, of course )
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
Well, if CODE starts doing what PRE does, and not the other way around, then I don't really care. But then, how does one deal with a less-than-a-line snippet like this one , which also comes handy?
For the slow connections, why not do something special; I mean if you keep concentrating on narrow screens and slow connections, a lot of people (software developers that have been willing to pay for powerful hardware) don't get what they could get; why not focus on the average user having a wide monitor and a high-speed connection, and then provide one or two switches to make the site less demanding when hardware dictates.
So you could assume a screen width >= 1280 unless "keep below 1024" is checked in personal settings;
and you could avoid postbacks/AJAX when "slow connection" is checked.
Then slow connection would imply no automatic pasting, back to what it is now; and narrow screen could e.g. cause a smaller rep graph (actually all large images being reduced by a fixed factor, say 2/3, something very predictable).
I'm in favor of automating things than can be automated (and providing an override if that could be useful, e.g. when automation could go wrong); but I also prefer getting more out of a non-minimal set-up rvrn if that means fiddling with some switches. If they are easy to understand, that should not cause too much trouble overall. IMO it is similar to the bunch of Windows Display settings such as "suppress window move animation", "disable form shadows", etc: the features are on by default, people having performance issues will soon figure it out and disable some.
Well, that's my 2 eurocents anyway.
|
|
|
|
|
I find your points intriguing and wish to suscribe to your newsletter.
If you weren't an MVP already this suggestion should make you one.
It is an excellent idea to allow the user's personal settings to customize the site in order to deal with anything they may need as a special case and make the site better for everyone in general.
Heck, when someone makes their account for the first time it could simply ask them a few questions and adjust settings according to their answers.
What resolution does the monitor you view CP on use?
(radio buttons with 3 common settings and "other")
What sort of connection do you use?
(again, radio buttons with common types)
|
|
|
|
|
Thanks.
I would carry that a little further, and maybe provide "configurations", so I have one setting at home on a large machine and DSL, and maybe another on the road, with a netbook that, depending on where I am, has low to medium Internet bandwidth.
|
|
|
|
|
I like the idea of having the user select what options they would like when they sign up, but there may be obstacles to overcome. One would be that many users just sign up to get at an article download real quick, and forcing them to go through more overhead may reduce adoption rates. It would be neat to reserve a section of each page (e.g., the section that is currently reserved for ads) to present the user with those questions, so they could answer them whenever they happened to notice them. And once they've answered those questions (e.g., "would you like to disable programming language detection when you paste"), then that section of the page could be again given back to whatever it is temporarily replacing (or could be shown only half of the time, if replacing a section of the page is not desirable).
|
|
|
|
|
Luc Pattyn wrote: you could avoid postbacks/AJAX when "slow connection" is checked.
I'm not sure what exactly you're suggesting here, but I read recently that ajax has generally improved performance for the poor saps on dialup because they didn't have to reload the entire page any longer.
3x12=36
2x12=24
1x12=12
0x12=18
|
|
|
|
|
yes, but what we were discussing is adding new functionality ("smart pasting") that will increase traffic:
the Internet connection permitting, we would apply server-side logic on every paste you perform in a CP message/article/whatever editor, whereas right now pasting is a client-side matter only, unless it looks like a hyperlink.
|
|
|
|
|
Yup, it's hiring time[^] for the home based workers again.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Thank you.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
When posting an alternate Tip/Trick shouldn't it rather be in the users Tip/Tricks section rather than the Quick Questions Answered?
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
Yes sir. I'll add it to the bug list.
|
|
|
|
|
It seems we need to address voting abuse in the Tips/Tricks, as well as Quick Answers...
Further, voting on tips/tricks should NOT affect your average article score BECAUSE THEY'RE NOT THE SAME THING.
.45 ACP - because shooting twice is just silly ----- "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 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
I think we should just make the votes be displayed publicly for all technical forums and publications (articles, quick question answers, tips/tricks, etc.,).
We should also be able to remove spurious votes (of course, "spurious" should be something that the community would agree with). I don't know how can this be done, but the cowardly low votes can be irritating, no matter if it's on an article, answer on a technical forum or quick answer system, etc., It can discourage a potential contributor from participating.
Thins like the lounge, soapbox, etc., can maintain privacy anonymity of votes so the cowards can rejoice. On the other hand, I also think that some posts on the leisurely discussion forums like lounge begs for one votes (and to be removed), so in which cases we can't expect people to come and explain why they voted 1. It could be bleeding obvious. But it isn't the same with contributions to the community in any way and so low votes on contributions should be justified.
“Follow your bliss.” – Joseph Campbell
modified on Wednesday, January 13, 2010 1:57 PM
|
|
|
|
|
1's and 2's are indicated via the "My Vote of x" message that it forces you to leave (unless you know how to vote that way without leaving a message).
.45 ACP - because shooting twice is just silly ----- "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 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
IMO all votes for articles, tips/tricks, quick questions, should require a message; I see little value in anonymous or unexplained votes, whether high or low.
in fact I would make the vote buttons available only on the reply editor page (the article/TT/QA page should say "you can vote on the reply editor page"); and I would set a low treshold for "vote to remove this message" to become effective.
OTOH I don't mind (and probably prefer) forum voting to remain as it is, anonymous, no message required, for programming and non-programming forums.
|
|
|
|
|
At least the article votes should contain a comment. If i get 11 votes of 5 and a single vote of 1 on an article i would at least like to know the reason. This kind of article bashing is quite demotivating. I would also like to be able to review my own votes by having a list of articles i voted on and how. This way i could correct my own votes in case articles improve.
modified on Thursday, January 14, 2010 5:23 PM
|
|
|
|
|
I got voted one for what I think was no reason. I thought it was a nice little tip / trick.
But then that was my opinion and not someone else's.
There are only 10 types of people in this world — those who understand binary, and those who don't. |
|
|
|
|
|
We need to put in place the "add a comment" thing for the tips, and we'll separate the average ratings for the different types of articles.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
What is the total number of messages in all forums in CP?
|
|
|
|
|
Cpianism wrote: What is the total number of messages in all forums in CP?
Why did you post this drivel here? How exactly is this a suggestion for the betterment of this community?!
Just please get lost forever.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
|