|
Well that is excally the problem.
I am just wondering as how one would create a normal Dashboard. there are not that many material on that.
even a widget would be fine at this point but there are not many sources for that nither on C#
|
|
|
|
|
What is a dashboard ?
Christian Graus - C++ MVP
|
|
|
|
|
I did some work for a client that used Dundas for the exact same thing.
|
|
|
|
|
Hi
Im working on socket connection.
client will send data to the server at some regular intervals.
how the client can identify if the ethernet cable is unplugged (client has to show some message "cable disconnected". if cable is plugged again. It should detect it automatically has to continue the task again.
Please give ur answers with some sample code/link
Thanks and Regards,
Srini
|
|
|
|
|
The recommended way to do this with V2.0 of the framework is to use the System.Net.NetworkInformation namespace.. This sample should get you started:
public class NetInfoTest<br />
<br />
{<br />
public static void Main()<br />
<br />
{<br />
try<br />
<br />
{<br />
DumpIPAddresses();<br />
<br />
NetworkChange.NetworkAvailabilityChanged += OnNetworkAvailabilityChanged;<br />
<br />
NetworkChange.NetworkAddressChanged += OnNetworkAddressChanged;<br />
<br />
Console.ReadLine();<br />
}<br />
<br />
catch (Exception e)<br />
<br />
{<br />
Console.WriteLine(e);<br />
}<br />
<br />
finally<br />
<br />
{<br />
Console.ForegroundColor = ConsoleColor.Green;<br />
<br />
Console.BackgroundColor = ConsoleColor.Black;<br />
}<br />
}<br />
<br />
<br />
public static void OnNetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)<br />
<br />
{<br />
if (e.IsAvailable)<br />
<br />
{<br />
Console.ForegroundColor = ConsoleColor.Green;<br />
<br />
Console.WriteLine("Network Available");<br />
}<br />
<br />
else<br />
<br />
{<br />
Console.ForegroundColor = ConsoleColor.Red;<br />
<br />
Console.WriteLine("Network *NOT* Available");<br />
}<br />
}<br />
<br />
public static void OnNetworkAddressChanged(object sender, EventArgs e)<br />
<br />
{<br />
Console.ForegroundColor = ConsoleColor.Red;<br />
<br />
Console.BackgroundColor = ConsoleColor.Yellow;<br />
<br />
Console.WriteLine("Address change event at {0}", DateTime.Now.ToString());<br />
<br />
Console.ForegroundColor = ConsoleColor.Green;<br />
<br />
Console.BackgroundColor = ConsoleColor.Black;<br />
<br />
DumpIPAddresses();<br />
}<br />
<br />
public static void DumpIPAddresses()<br />
<br />
{<br />
<br />
NetworkInterface[] NetworkInterfaces = NetworkInterface.GetAllNetworkInterfaces();<br />
<br />
<br />
foreach (NetworkInterface NI in NetworkInterfaces)<br />
<br />
{<br />
<br />
if (NI.NetworkInterfaceType == NetworkInterfaceType.Ethernet)<br />
<br />
{<br />
Console.WriteLine(Environment.NewLine);<br />
<br />
Console.WriteLine(Environment.NewLine);<br />
<br />
<br />
Console.WriteLine(NI.Name + " " + NI.Description);<br />
<br />
Console.WriteLine("-------------------------------------------------");<br />
<br />
<br />
IPInterfaceProperties IPProps = NI.GetIPProperties();<br />
<br />
<br />
UnicastIPAddressInformationCollection UnicastAddresses = IPProps.UnicastAddresses;<br />
<br />
foreach (UnicastIPAddressInformation uaddr in UnicastAddresses)<br />
<br />
{<br />
<br />
if (uaddr.Address.AddressFamily == AddressFamily.InterNetwork)<br />
<br />
Console.WriteLine("\t" + uaddr.Address.ToString());<br />
}<br />
}<br />
}<br />
}<br />
}<br />
Keep in mind availability here is based on the state of the network adapter. This does not tell you the reach of your connection (ie. connected to the internet, a managed network, etc)
You can use "NetworkAvailabilityChanged" and "NetworkAddressChanged" events, for reconnect operation.
Thanks Mike Flasko for code example;)
|
|
|
|
|
Hello everyone!
I have a C# project on a MS card, since hard drives suck...
But I don't have enough space for the big .PDB files, so where's the setting to change the path? Thanks!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Lord Kixdemp wrote: But I don't have enough space for the big .PDB files, so where's the setting to change the path?
There isn't one, I don't believe. You need to move the project to a drive that has enough space.
Perhaps you need to buy a portable hard drive...
Christian Graus - C++ MVP
|
|
|
|
|
Christian Graus wrote:
Perhaps you need to buy a portable hard drive...
They aren't that expensive now
|
|
|
|
|
LOL!!!
isCheap(8GB, $117.99) == false
Or were you talking about something else?
Windows Calculator told me I will die at 28.
|
|
|
|
|
|
You're probably a professional programmer and earn more than $10 bucks an hour, but I only get $5.75 and work only on Saturdays...
Windows Calculator told me I will die at 28.
|
|
|
|
|
Lord Kixdemp wrote: I don't have enough space for the big .PDB files, so where's the setting to change the path?
Clear out any temporary files you don't need or upgrade the hard drive. Like Christian said, a portable drive could be an option, too.
|
|
|
|
|
HI,
i would like to take the RGB value from a whole picture then convert it into HSI values. Please help me. Thanks in advance.
|
|
|
|
|
Tried Google?[^] Take a look at the first result.
|
|
|
|
|
One of my image processing articles converts to HSL, is HSI the same ( Luminance == Intensity ??? ). IF not, you can just change the algorithm used and reuse my code. Just search CP for Graus Image.
Christian Graus - C++ MVP
|
|
|
|
|
Christian Graus wrote: One of my image processing articles converts to HSL, is HSI the same ( Luminance == Intensity ??? ).
That's correct. There's HSI/HSL, and HSB/HSV. The most noticeable effective difference between the 2 is that HSI/HSL goes from white to black on the luminence scale, with the "pure" color in the center, and HSB/HSV has the highest brightness be the pure color (when saturated).
|
|
|
|
|
thanks for your help. but how to get RGB value of a whole picture that we input?
|
|
|
|
|
Is there any algo or example (code) of how to convert MIDI file to eg Guitar Tablature?
|
|
|
|
|
I wouldn't have said that's an algorithm, it's really a rendering detail. Nothing is changed, the note is just rendered as tab.
Christian Graus - C++ MVP
|
|
|
|
|
It is not totally a rendering detail since each note can be rendered in several places
|
|
|
|
|
No, you're wrong. MIDI has no concept of the same note living in more than one place, so it doesn't contain any info about how to play the note on guitar. No system that I have seen does a good job of choosing 'default' fingerings, you always end up having to edit them. Either way, whatever fingering is chosen, becomes part of the metadata of the new file format, but as MIDI doesn't support it, it becomes another rendering details specific to the new format. And, if it was in the MIDI file, then it would be a rendering detail of the MIDI file, instead of the new format being used.
Christian Graus - C++ MVP
|
|
|
|
|
Christian Graus wrote: No, you're wrong. MIDI has no concept of the same note living in more than one place, so it doesn't contain any info about how to play the note on guitar.
Why am I wrong, just because I say that coverting MIDI to TAB would not be entirely a rendering detail ? I was just pointing out that there are different rendering possibilities and that it is not as simple as that.
Christian Graus wrote: No system that I have seen does a good job of choosing 'default' fingerings, you always end up having to edit them.
I was talking about that algorithm.
Regards
|
|
|
|
|
ejuanpp wrote: Why am I wrong, just because I say that coverting MIDI to TAB would not be entirely a rendering detail
OK, there is one other bit of work involved, as the new format contains more information. I apologise, you are correct.
However, the only way to do this is to simply make sure that the note positions selected are physically playable. There's no way to write an algorithm that generates correct fingering, the info simply isn't there. I can tell by looking at a riff in tab that it's wrong, but no algorithm will replace an experienced guitarist looking at a pattern and 'knowing' it's wrong.
ejuanpp wrote: I was talking about that algorithm.
It doesn't exist. Best you can do is try to keep the notes within a position until it's impossible, then shift positions. You may then recurse to see which solution requires the least position shifts, but that doesn't mean it will be correct. You could add stuff for ever, and still not get it perfect, it's probably a waste of time expecting to get perfect results, you never will.
Christian Graus - C++ MVP
|
|
|
|
|
Wouldn't that "algo" be to ge the note, and also surrounding notes to find out the relative finger position to determine the overall finger/hand position.
|
|
|
|
|
I have a C# user control that I want to use in a VB 6.0 project.
The problem is :
When you open an instance of a Microsoft Windows Form from a COM client application, such as a Microsoft Visual Basic 6.0 application or a Microsoft Foundation Classes (MFC) application, the .NET Windows Form may behave unexpectedly. For example, when you press TAB, the focus does not change from one control to another control. Or when you press ENTER while a command button has focus, the button's Click event does not fire. You may also experience unexpected behavior for keystrokes or for mouse activity.
These symptoms occur because the earlier application does not implement the message loop support that a .NET Framework Windows Form must have to work correctly. ( better described here http://support.microsoft.com/kb/839076/ )
At this link they provide a solution for a Windows Form. I'm interested in a solution for a user control.
I think the problem resumes to : How do I create a message loop for a user control in C#?
Need help, please!
|
|
|
|