|
Do some research into GROUP BY and the MIN operator
Select Item, min(value) from table
Group By Item
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
Hello All,
I'm looking for a way to connect to a Cisco Router via SSH and then interpret the output to perform different operations based on the output, i.e. username/password incorrect, enable mode, etc ...
I have already been able to achieve this using TELNET, but now I need to migrate to SSH.
Best Regards,
Sikas.
|
|
|
|
|
|
I already searched, but didn't find anything useful!
Best Regards,
Sikas.
|
|
|
|
|
There were lots of links in the search I did. And given that your question lacks any real detail it is impossible to offer anything more.
Veni, vidi, abiit domum
|
|
|
|
|
|
I am writing a program which will connect to a I2C to USB controller. I am using WPF.
I decided to create a Device class to contain the hardware description and all its attributes so I can use them to display properties and have the end user modify the settings of the hardware.
I have most of the above working, except 2 attributes.
Most attributes are strings or int or byte, etc... so they are easy to work with, like the example below:
private string _name;
[Category("General")]
[ReadOnly(false)]
[DisplayName("Module Name")]
[Description("Enter descriptive string ")]
public string Name { get { return _name; } set { _name = value; OnPropertyChanged("Module Name"); } }
The 2 attributes I am having a hard time with need to have a list to populate.
So I read the hardware setting, and it returns that it supports I2C, SPI, and UART.
Now I want to be able to pass those to the "CommunicationType" attribute, and have it display as a list in the properties window.
To see if my program is working, I created the following class:
public class CommunicationType : IItemsSource
{
public ItemCollection GetValues()
{
ItemCollection sizes = new ItemCollection();
sizes.Add((int)PP_COM_Wrapper.enumInterfaces.I2C, "I2C");
sizes.Add((int)PP_COM_Wrapper.enumInterfaces.ISSP, "ISSP");
sizes.Add((int)PP_COM_Wrapper.enumInterfaces.JTAG, "JTAG");
sizes.Add((int)PP_COM_Wrapper.enumInterfaces.SPI, "SPI");
sizes.Add((int)PP_COM_Wrapper.enumInterfaces.SWD, "SWD");
sizes.Add((int)PP_COM_Wrapper.enumInterfaces.SWD_SWV, "SWD SWV");
return sizes;
}
}
Then in the attribute, I have the following:
private int _comtype;
[Category("Settings")]
[ReadOnly(false)]
[ItemsSource(typeof(CommunicationType))]
[DisplayName("Communication Type")]
public int CommunicationType { get { return _comtype; } set { _comtype = value; OnPropertyChanged("Communication Type"); } }
So when I run it, it gives the user the possibility to select from a drop down, one of the communication types.
Now the question is, how do I populate it programmatically. Some of the hardware only supports I2C and SPI, so I only want to populate the list with 2 items based on the hardware.
Any guidance or examples are greatly appreciated.
Thanks,
H-
modified 8-Feb-14 2:56am.
|
|
|
|
|
Hi all,
Can any one help me how to use Abstract class and Interface class in developing web application using c# language.
Thanks
|
|
|
|
|
|
Hi,
I have a strange problem when calling one of my C++ dll functions from within C# code. Even though I have a work around but it is not making sense to me what caused the problem in the first place and would like to understand why.
I am writing below a very simple code that produces the problem:
Basically, My dll function returns a pointer to a null terminate string (const char *) that I would like to import it as a string in c# code.
The c++ DLL function :
const char* ReturnSomeString()
{
static string result="The string";
return result.c_str();
}
The C# code:
[DllImport(@"thedll.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
[return:MarshalAs(UnmanagedType.LPStr)]
public extern static string ReturnSomeString();
public void function()
{
string result = ReturnSomeString();
}
When I run the c# code, sometimes it works, sometimes the result is garbage and most of the times it crashes with with exception message :
An unhandled exception of type 'System.AccessViolationException' occurred in theapplication.exe
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
As I mentioned, I have some couple work arounds but still want to understand why the above methodology does not work.
Work around 1:
---------------------
change the C++ code to not to use string class and just use the standard ansi char[] keeping the C# code unchanged.
Work around 2:
-----------------------
Keep the C++ code as is (using string class) but modify C# code:
[DllImport(@"thedll.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public extern static IntPtr ReturnSomeString();
public void function()
{
string result = Marshal.PtrToStringAnsi(ReturnSomeString());
}
Please help me explaining what is wrong with the first method.
Thanks for taking the time looking into this.
|
|
|
|
|
It's possible that the string being returned is not properly null-terminated.
Or it's possible that the C++ function is returning a locally declared variable, in which case it goes out of scope at the end of the C++ function.
Post the code of the C++ function.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Thanks Richard for your reply.
This is what I thought initially so I made sure that the local string will never go out of scope by declaring it as "static". According to C++ documentations the string::c_str() supposed to return a pointer to null terminated string:
http://www.cplusplus.com/reference/string/string/c_str/[^]
I agree with you, it sound like something happens to the buffer that it becomes no longer valid but I am not sure what happens exactly!.
|
|
|
|
|
Member 4211040 wrote: I agree with you, it sound like something happens to the buffer that it becomes no longer valid but I am not sure what happens exactly!.
Whatever the problem is, I'm sure it is more likely to be on the C++ side than the C# side.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Dear Expertise, I want to implement Voice Recognition in Our Traditional Product. we are using the technology is Visual Studio 2012 (v4.5) with C# web application and SQL server 2012.
Is it possible to impelement Voice Recognition in My Product?
I searched some link like our Code Project and Microsoft sites .. But Max of application using windows based application.
I want to implement using Voice Recognition to open our menu (pages) like Google Voice Recognition
If it is possible means, write suggessted Links for implement it..
Thanks in Advance
Palani Kumar.A
Sundaram Infotech Solutions
Chennai-14
Apkumaar
|
|
|
|
|
The big problem with speech APIs is that there is no one standard mechanism for it. Firefox has its own implementation[^] while Google has a different implementation[^].
|
|
|
|
|
|
This certainly won't work if you try to use it in a web app.
Clean-up crew needed, grammar spill... - Nagy Vilmos
|
|
|
|
|
Ya but it may give him the idea about the approach..
|
|
|
|
|
Clean-up crew needed, grammar spill... - Nagy Vilmos
|
|
|
|
|
[Removed - total nonsense.]
modified 7-Feb-14 6:03am.
|
|
|
|
|
That's a desktop technology, not a web based one. Speech recognition on the web is at a very early stage right now.
|
|
|
|
|
|
how ı write software ofusb dongle software for c#
|
|
|
|
|
If you want to write a Driver for an USB dongle, bad news for you: This would probably be hard to achieve in C# because you'd need to write a driver.
Drivers are usually in a somewhat native code written:
Example 1[^]
Example 2[^]
Clean-up crew needed, grammar spill... - Nagy Vilmos
|
|
|
|