|
That I get all puffed up like a fugu-fish in mating display, awarding myself a succulent lagniappe of self-esteem-bloat: thinking I was clever to be first out the gate; and, lo, the bird of time was on the wing thirty-four minutes before me, yet my sluggard browser revealed not the shadows of your wings.
And, now, alack, alas, I whimper: back in the sewer again; hearing the madding crowd snicker as they say: "look: a me-too."
I can't understand this long delay in forum messages being posted when other parts of CP seem to be updated instantly.
“But I don't want to go among mad people,” Alice remarked.
“Oh, you can't help that,” said the Cat: “we're all mad here. I'm mad. You're mad.”
“How do you know I'm mad?” said Alice.
“You must be," said the Cat, or you wouldn't have come here.” Lewis Carroll
|
|
|
|
|
Don't fret about it: it happened to you this time, It'll happen to me next time!
It's good to know we were thinking on the same wavelength: that validates the whole idea in a way.
I think all the hamsters are in transit to Puppy Bowl[^] which does slow the site down.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
One solution would be to make Classes you want to use your extension inherit from a common Interface; Classes that don't inherit from that Interface will then throw a compile-time exception if you try and use the extension with them. Consider:
public interface UseAAAAAAA {}
public static class ExtensionTest
{
public static String AAAAAAA<T>(this T x) where T : UseAAAAAAA
{
return "Extension Method Test Class: " + typeof(T).Name;
}
}
public class Test1 : UseAAAAAAA {}
public class Test2 : UseAAAAAAA {}
public class Test3 {} Test:
Test1 test1 = new Test1();
Test2 test2 = new Test2();
Test3 test3 = new Test3();
Console.WriteLine(test1.AAAAAAA());
Console.WriteLine(test2.AAAAAAA());
“But I don't want to go among mad people,” Alice remarked.
“Oh, you can't help that,” said the Cat: “we're all mad here. I'm mad. You're mad.”
“How do you know I'm mad?” said Alice.
“You must be," said the Cat, or you wouldn't have come here.” Lewis Carroll
|
|
|
|
|
BillWoodruff wrote: inherit from a common Interface
A minor correction: you implement an interface, you don't inherit from it.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi Richard, I fall-on-my-face in abject shame, righteously corrected, good Sir ! You gotta admit, though, that using an empty Interface in this way is kind of ... kinky.
“But I don't want to go among mad people,” Alice remarked.
“Oh, you can't help that,” said the Cat: “we're all mad here. I'm mad. You're mad.”
“How do you know I'm mad?” said Alice.
“You must be," said the Cat, or you wouldn't have come here.” Lewis Carroll
|
|
|
|
|
The trick is not to be "writing" mulitple extension methods but to utilize operator overloading which still shares all of the common code.
private static void HelpFooBar<T>(T t) where T :baseclass
public static void FooBar(this RealObject o){
HelpFooBar(o);
}
public static void FooBar(this AnotehrObject o){
HelpFooBar(o);
}
Also, as previously mentioned. Class inheritance is the best way.
Even further if you "own" the classes just create a common interface.
|
|
|
|
|
hello
Console Application c# & use shape & color
|
|
|
|
|
If you really want to use shapes and colours, then a Console application is not the best solution: it is possible to draw shapes and so forth with a console app, but it's generally a lot more trouble than it's worth, since the console does not support and graphics methods directly and ASCII art is a PITA! Seriously, I'd look at a WinForms application as a minimum for anything more complex that basic text input / output (and even then, I'd probably want almost zero input with that.
Colours you can do: http://www.dotnetperls.com/console-color[^]
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Your question is nota question. We really have no context information at all and no description of what you're really trying to do.
The other answer you got is about the best you can hope for given the complete lack of detail in your question. Keep this in mind when you ask questions in the future.
|
|
|
|
|
I am sorry brother, dint understand your question. It looked more like a puzzle.
|
|
|
|
|
Given the lack of clarity in your question, the closest answer I can give you is this - a console output to draw a rectangle in a different colour using standard text characters.
public void PrintRectangle()
{
Console.BackgroundColor = ConsoleColor.Green;
Console.ForegroundColor = ConsoleColor.DarkGreen;
Console.WriteLine("+----+");
Console.WriteLine("| |");
Console.WriteLine("| |");
Console.WriteLine("| |");
Console.WriteLine("| |");
Console.WriteLine("+----+");
Console.ResetColor();
}
|
|
|
|
|
I'm new to C#,am using form application, how i can store image into database and retrieve the image from database .
|
|
|
|
|
That's only been documented about 2,000,000 times on the web. All it takes is a little searching[^].
modified 30-Jan-14 15:57pm.
|
|
|
|
|
Hello friend,
It is the approach that matters: I agree to What ever Sir,Dave Kreskowiak just said. Now you want to ask "can i insert an image inside an SQL table?".
For that you need to think:
Step1: What is the datatype that you need to assign in the SQL table which can store images?
Or
Can i store images in an SQL table?.
Step2: When you get that data type, you need to find out, which querry can i use to do that?
Step3: HOw do i integrate it with c#?
Or
How can i create an "SQL Querry in C#"?
For that you need to think, write down your doubts and start searching. This is applicable even to me. When ever we get some task we write it down in our notepad.
Think about the prerequisites. Formulate a code.
After writting that code. If we are stuck somewhere we try to do brainstorming with our freinds. If none of them are able to solve the problem, then we come to code project and seek expert guidance.
The main thing is to start off. You havent taken any efforts to do so.
Thanks.
|
|
|
|
|
Nice approach to help beginners. +5. If you teach them how to think for themselves they will learn much quicker.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Yes Sir, thats true.
But they also need to start learning and reading. Every one wants short cuts. Well, thanks for supporting me.
When ever i say something like this people make fun, but eventually they follow the same path.
People ask: How to convert a datetime to string? and they get the answer by google searching.
But they dont think : why can i use ToString() on all the types, why can i not use ToByte()? is that type even present?
Self assessment is lacking these days Sir. I believe one must always carry a pen and a notebook. Comes handy while learning things.
When ever you get an exception write it down and search for it. There are many things .
I hope we speak again so that you enlighten me with your knowledge.
Thanks for supporting.
|
|
|
|
|
|
I want to develop a .net windows application with c# code behind to check the problems of a video file. If i give a video file as input to the tool, it should detect the problems of the video (like audio clarity, picture clarity, video struck etc.,).
Please help me.
|
|
|
|
|
This is not a trivial project; you will need to do some research into the subject, and how to identify and fix such issues.
Veni, vidi, abiit domum
|
|
|
|
|
So just how are you going to check the "audio quality" or the "video quality"?? are you checking the metadata properties of the video for certain values or are you actually trying to get the code to "listen" or "look at" the audio and video? If it's the later, good luck! You're going to need it because that is FAR from a simple thing to do.
|
|
|
|
|
|
Quote: Please help me.
Ok, what research have you done so far?
What about reading something related to Signal Processing, Sampling etc?
Did you start with:
1> Playing a video file(any file) in a form application on a button click(this may or may not be a correct approach, but something to start off with).
at least start with something. No task is impossible. I know it is tough. If one way fails there are multiple ways. At least start something.
|
|
|
|
|
Rahul VB wrote: No task is impossible
Really? I want to see you push a dead elephant to the top of Mount Everest, only yourself, with no lifting equipment.
Get started. I'll wait here.
|
|
|
|
|
Respected Sir, you are misunderstanding me. People give up without trying. I understand that it is an impossible task. But i just wanted him to put some efforts and say
"Hey people i have tried out so many things but couldn't succeed", then its ok. I agree with you.
See, the point what i am trying to make here is atleast try even if it is an impossible task. If you cant figure out any chance of completing it, then you come on code project and consult people.
If someone gives you an impossible task knowingly(for example), you dont know that it is impossible, you think that the task is doable. Only the person who gave you probably knows it.
Without even starting off if you say "I am sorry Sir cant complete it", this means that you dint even try to do it.
If he would have started the task, he would have referred few books, written some lines of code. His knowledge and coding would have increased.
I apologize to you if i said something wrong. My aim here is not to challenge you or anyone. It is just for beginners to start thinking and analyzing things .
I cant even possibly ever try to challenge you. My knowledge and ability is no where near yours. I just want to again apologize if i said something wrong.
And lastly, its my dream to become an MVP for at least one year and you have been winning this title for the past 10 years. How can i even dare to challenge you.
And i was laughing at the statement : Quote: FAR from a simple thing to do. , because it is was just the way you wrote it nothing else. My aim was not to make fun.
You just sounded humorous and witty at that time. My laughter was due to your witty statement.
Thanks and regards,
|
|
|
|
|
Thank you Rahul for the reply.
I have made lot of searches and read a document on video quality analysis. The document explains about the noise and frames/sec. So I thought let me first get frames of a video file so that I can verify whether the frames are in order or in the correct speed like x frames/sec that shows video better otherwise it implies the video is stuck or anything else.
I used DirectShow.dll to get details of a video file. But I was not able to use interface "Iqualprop". "Iqualprop" gives me details of a file.
I used Shell32 to get details of video file and I could get frames/sec details.
But these are static details. I want to stream the video file and get details so that I can check its quality.
Please help me if you have any other suggestions and how to use "Iqualprop".
|
|
|
|