|
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid..
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
I have been trying to answers "Email Validation" and "Domain Validation" kind of questions with a perspective of Internationalized Domain Names with relevant answers. I wonder why all the answers which I post, despite following community guidelines get flagged as spam??
|
|
|
|
|
This is the wrong place to ask this, but I'll answer it anyway.
Your posts were legit - or at least mostly legit - but when you get a new member posting the same links to multiple questions and those are nearly all over ten years old it looks very dodgy.
I moderated the posts when the automated system brought them to my attention, and decided that on balance they were not sufficiently legit to let through, and on balance were probably the start of what we call "rep point hunting": posting to old questions for rep points in the hope they wouldn't get seen - a form of site abuse.
But ... I wasn't sure that you were abusing the system, so I added you to my "watch list" to see what you did instead of throwing you off the site immediately.
Unfortunately there was no way to contact you without letting your posts through, so when this message came up I let it through and wrote this reply.
While I applaud your urge to help people, it's a good idea to stick to new questions, rather than 10+ year old ones - and avoid "link heavy" replies, particularly to questions with good replies already. After that amount of time, it's unlikely that the original poster is at all interested in the problem any more!
Answering old questions can be seen as rep-point hunting, which is a form of site abuse. The more trigger happy amongst us will start the process of banning you from the site if you aren't careful. Stick to new questions, post less link heavy solutions, and you'll be fine.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Thank you for the reply OriginalGriff. I have already been through one account banning. Thank you for not banning this account of mine outrightly. My endeavor behind answering 10 year old questions is for the new developers who might have similar questions, from taking that old approach which is not correct. I sincerely do not care about bounty points. What I do care about is the overall user awareness. These kind of Old and highly visible questions, when one searches with relevant tags, keep on coming at the top of the search and end up misguiding the naïve implementers.
Your suggestion to "Ask a new question" though valid, can cause a new issue, as I imagine. I would be again flagged as spammer for "Asking the same question". Won't I?
It is indeed unfortunate that we cannot connect directly through profile in DMs. I would have loved to do that to thrash out this detail.
I am not trying deliberately to be "link-heavy". But to avoid that, answers would needlessly get heavy.
Please guide.
modified yesterday.
|
|
|
|
|
I didn't suggest that you "ask a new question" - I suggested that you stick to "answering new questions": Quote: While I applaud your urge to help people, it's a good idea to stick to new questions, rather than 10+ year old ones My apologies if that wasn't clear.
Certainly if you post a question just so you can answer it you will get kicked off very quickly!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I have been caught once or twice by the 'ten year old question' trap. If you see a new question (on the home page) that you think you might be able to answer, and go to it but someone else has already given a good answer (or, more commonly in my case, you realise that you cannot answer the question), your eyes gravitate to the 'similar questions' list on the right-hand side. If you follow ones from there, you can sometimes find ones that you might be able to answer; so you compose an answer. If you are lucky, you spot that it is a 'ten year old question' before posting; if less lucky, you only spot it after posting.
Perhaps we should / could raise a 'bugs and suggs' to have the age of the question more prominently displayed.
|
|
|
|
|
It's been raised in B&S before. The conclusion is that adding new answers to old questions is perfectly fine, so long as you're adding something new to the discussion.
The problem here is that this is a new member, posting answers which have multiple links to a relatively-unknown site that looks like a blog. As Griff said, this is typical behaviour for a site-driving spammer or rep-point hunter, which is why the solutions are being deleted as "spam".
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I was updating domain and e-mail validation questions with new approaches that need to be taken due to advent of the Internationalized Domain Names. With answers specific to the programming language mentioned in the question and the specific APIs they can use for the IDN compliant implementation. If that is not "adding something new to the discussion", what is?
|
|
|
|
|
You've been here 4 months, and you were resurrecting multiple old questions with multiple links to a blog. If that's not indicative of a site-driving spammer or a rep-point hunter, then what is?
You probably were adding something new to the discussion. But the way you went about it meant that you looked like a spammer / rep-point hunter, which is why your solutions were removed.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Bear in mind that this is nothing personal: it's about what your actions look like to others.
If you walk around your town wearing a hockey mask and carrying a big axe, nobody is going to assume "he was playing ice hockey when his mother range and told him she was out of kindling, I expect". Nope, they are going to assume "Eeek! A crazy axe murderer! Run!" aren't they? And the chances are the police will shoot you rather than try to arrest you ...
We don't get told your motivations: we just see your actions, and make an assessment based on that. And as someone who has "already been through one account banning" you should be aware of that. What did we kick you off for last time? Lets see ... 22 March we kicked you for site driving ... which is what your posts this time looked like ...
See what we mean now?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
This message has been flagged as potential spam and is awaiting moderation
|
|
|
|
|
hi all,
can anybody help me to draw a thick border around round png.
Bitmap bmp = new Bitmap(@"C:\Users\Ali\Desktop\1.png");
int w = bmp.Width;
int h = bmp.Height;
Lst_Data lastpointcolor = new Lst_Data() ;
for (int y = 0; y < h; y++)
{
for (int x = 0; x < w; x++)
{
Color c = bmp.GetPixel(x, y);
if (c.A != Color.Transparent.A)
{
if (lastpointcolor.color.A == Color.Transparent.A)
{
bmp.SetPixel(lastpointcolor.point.X, lastpointcolor.point.Y, Color.Red);
}
}
lastpointcolor = new Lst_Data() { point = new Point(x, y), color = bmp.GetPixel(x, y) };
}
}
for (int y = h-1; y > 0; y--)
{
for (int x = w-1; x > 0; x--)
{
Color c = bmp.GetPixel(x, y);
if (c.A != Color.Transparent.A)
{
if (lastpointcolor.color.A == Color.Transparent.A)
{
bmp.SetPixel(lastpointcolor.point.X, lastpointcolor.point.Y, Color.Red);
}
}
lastpointcolor = new Lst_Data() { point = new Point(x, y), color = bmp.GetPixel(x, y) };
}
}
pictureBox1.Image = bmp;
}
public struct Lst_Data
{
public Point point;
public Color color;
}
thanks in advance.
modified 3 days ago.
|
|
|
|
|
What technology are you using? WinForms? WPF? Other?
|
|
|
|
|
|
Le@rner wrote: i m taking help from this article Then you should ask the person who wrote the article. As it stands you have not provided any useful information for people to help you.
|
|
|
|
|
Bitmap bmp = new Bitmap(@"C:\Users\Ali\Desktop\1.png");
int w = bmp.Width;
int h = bmp.Height;
Lst_Data lastpointcolor = new Lst_Data() ;
for (int y = 0; y < h; y++)
{
for (int x = 0; x < w; x++)
{
Color c = bmp.GetPixel(x, y);
if (c.A != Color.Transparent.A)
{
if (lastpointcolor.color.A == Color.Transparent.A)
{
bmp.SetPixel(lastpointcolor.point.X, lastpointcolor.point.Y, Color.Red);
}
}
lastpointcolor = new Lst_Data() { point = new Point(x, y), color = bmp.GetPixel(x, y) };
}
}
for (int y = h-1; y > 0; y--)
{
for (int x = w-1; x > 0; x--)
{
Color c = bmp.GetPixel(x, y);
if (c.A != Color.Transparent.A)
{
if (lastpointcolor.color.A == Color.Transparent.A)
{
bmp.SetPixel(lastpointcolor.point.X, lastpointcolor.point.Y, Color.Red);
}
}
lastpointcolor = new Lst_Data() { point = new Point(x, y), color = bmp.GetPixel(x, y) };
}
}
pictureBox1.Image = bmp;
}
public struct Lst_Data
{
public Point point;
public Color color;
}
can anybody help to draw more thick border around the image
|
|
|
|
|
You should have added that to your original question, and add an explanation of what is wrong.
|
|
|
|
|
You draw an ellipse and place it "over" the image where the border would be. (Images aren't "round"; they're rectangles with transparent backgrounds that simulate a particular shape).
Graphics.DrawEllipse Method (System.Drawing) | Microsoft Docs
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
how to create dynamic card view in c# and .NET6.
|
|
|
|
|
1) Write down a precise description of what you want, how you want it to work, and what you want it to look like.
2) Write some code to implement the view.
3) Test it. Does it work? Great. If not, go back to step 2 and fix your code.
Seriously, nobody can help you based on such a vague description. You either need to put a lot more thought into what you want, or go back to whoever gave you the task and ask for a lot more detail.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
That depends on what you actually want to achieve, and what you expect the UI to look and work like.
At the moment, this is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with - we get no other context for your project.
Imagine this: you go for a drive in the country, but you have a problem with the car. You call the garage, say "it broke" and turn off your phone. How long will you be waiting before the garage arrives with the right bits and tools to fix the car given they don't know what make or model it is, who you are, what happened when it all went wrong, or even where you are?
That's what you've done here. So stop typing as little as possible and try explaining things to people who have no way to access your project!
I'd suggest that most likely you want to start with some kind of UserControl, or perhaps a TabControl but with your minimalist description we can't help you much, if at all!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I'm reporting your "name" as a spam link.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
I have some CSV files encoded in GBK, aka codepage 936, and need to load them as strings (or something sufficiently string-like, whatever) for further processing. In the old days, I could call some function such as File.ReadAllText (or read the file line by line etc) and specify CP936 as the encoding. But in .NET 6, I can't. The only valid options are ASCII, Latin 1, and a couple of flavours of UTF.
That sounds unlikely, right? But here is the documentation for the Encoding class, and in the big table halfway down the page, you can see that almost everything is gone. Almost as if the thinking is now "people should just use UTF-8 or UTF-16 nowadays". If it were up to me, those file would be encoded in UTF-8, but they're just not.
So, right now what I do is this, assuming that I've read the file into an array byte[] raw and int size bytes were successfully read into it:
char[] buffer = new char[size];
int numberOfChars;
fixed (char* bufferptr = buffer)
fixed (byte* rawptr = raw)
numberOfChars = MultiByteToWideChar(936, 0, rawptr, readSize, bufferptr, buffer.Length);
Calling MultiByteToWideChar via a dllimport. Then afterwards I can use numberOfChars to create a Span<char> of the appropriate length.
That works, but it seems like a serious step backwards compared to .NET 4. Also there seems to be no way (no reasonable way anyway) to read/convert chunks of the file this way, as MultiByteToWideChar does not report the leftover bytes at the end of the chunk.
Are there any better options?
|
|
|
|
|
|