|
Of course, but I think the autho of this article is no longer active.
|
|
|
|
|
i hardly use generic. so anyone can explain what is generic and when one should use it. i like to know in what kind of situation developer use generic? i like to request to give some sample code which explain the good usage of generic.
what is the meaning of the below line
public class User : DBObject<User>
{
}
what is the meaning of this line specially
DBObject<User>
tbhattacharjee
|
|
|
|
|
Read this for an introduction and you'll get the idea (I hope): An Introduction to C# Generics[^]
In a nutshell: Generics enable one to make very general type definitions where types of subcomponents/parameters can be changed without changing the code of the type that uses them.
Cheers!
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
thanks for the help
but u did not answer for this line
public class User : DBObject<User>
{
}
what is the meaning of this line specially
DBObject<User>
tbhattacharjee
|
|
|
|
|
The meaning of "DBObject<User>" is the collection of User types,and the declaration of the public class User is an inherited class of DBObject<User>.
public class User : DBObject<User>
{
}
"Indian Hacker"
Debabrata Panigrahi.
|
|
|
|
|
Hi Debabrata,
thanks for answer. still things is not very clear to me. u said collection....ok. i have one more request. can you please write small full sample code similar to my situation which would explain well the usage like
DBObject<User>
looking for your help. thanks
tbhattacharjee
|
|
|
|
|
Read the link that was provided in the first answer to your question. That answers it all. Better still, actually read a book on this stuff. There are free ones available that are excellent. Charles Petzold's .NET Book Zero[^] is a great resource to help you get started. Seriously, you have to start doing some of this for yourself. If you don't, your career is going to go nowhere because all you have learned is that other people know things and you don't.
|
|
|
|
|
He did answer it. You actually have to read the associated article and then think about it for a bit. You've been here and asked enough questions by now to know that we expect you to do some of the work yourself.
|
|
|
|
|
I am trying to telnet a HProCurve J9279A Switch but i am getting some unknown characters in the login prompt when i am writing the response in text file . Please let me know how to handle this and remove these junk characters from string . I can say these are some escape sequense which in not recognized by string .
Please register your products now at: www.ProCurve.com
[1;24r[1;1H[24;1HUsername: [?25h[24;1H[?25h[24;11H[24;11H[?25h[24;11H
Please help to remove thse unknown characters in above strings and command outputs. any help will be appreciated...
|
|
|
|
|
Ok, those are VT100 / VT220 terminal control sequences and then consist of ASCII characters:
ESC [ n ; n x Where:
ESC is Hex 1B
[ is [
n is a number, in ASCII digits: '0' (hex 30) to '9' (hex 39) repeated
; is ;
x is a command code which tells the terminal what to do Some parts are optional, and question marks can be included as well!
The command code is an ASCII character which (IIRC) will be upper or lower case 'a' to 'z'.
The command code tells the system what to do with the whole command: r is a "Set scrolling region" command, H is cursor positioning, and so forth.
(You can find out what they do here: http://epsfiles.intermec.com/eps_files/eps_man/977047037c.pdf[^] - section 8)
To remove them, you will have to parse the string yourself, and find the start and end of the sequence: it may be possible to do it with a regex, but I've never tried (And am not about to! )
You looking for sympathy?
You'll find it in the dictionary, between sympathomimetic and sympatric
(Page 1788, if it helps)
|
|
|
|
|
A quick thought (it's amazing what else you can think of when in a boring meeting) gives me this regex:
\x1B\[\??\d+(;\d+)?[a-zA-Z] That with a regex Replace operation replacing with a empty string should get rid of them. Probably.
You looking for sympathy?
You'll find it in the dictionary, between sympathomimetic and sympatric
(Page 1788, if it helps)
|
|
|
|
|
Thanks.... Its working
|
|
|
|
|
You're welcome!
You looking for sympathy?
You'll find it in the dictionary, between sympathomimetic and sympatric
(Page 1788, if it helps)
|
|
|
|
|
I run into the same problem and have figured out a workaround that works for as. It is not a perfect solution.
I use a regular expressions substituions between the TCP buffer and the Telnet protocol because the firmware sometimes use unknow esc sequnences that bother the telnet/terminal protocol.
I use Perl for switch automation but i try to translate it to C# (The orginal is a Perl module
Regexp::Common::ANSIescape ).
I use this expression
\x1BE/\n before the big one and this after
\[[0-9]+;[0-9]+H because the firmware use sometimes esc secuences that does not exist.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace ProcurevAnsiFilter {
class Program {
const string CHAR_STR = @"(.|\n)*?";
const string CSI_7BIT = @"\x1B\\\x5B";
const string CSI_8BIT = @"\x9B";
const string CSI_7OR8 = @"(?:" + CSI_7BIT + "|" + CSI_8BIT + ")";
const string C1_NST_8BIT = @"[\x80-\x8F\x91-\x97\x99\x9A\x9C]";
const string C1_NST_7BIT = @"\x1B[\x40-\x4F\x51-\x57\x59\x5A\\\x5C]";
const string C1_STR_7BIT = @"\x1B[\x5D\x50\x58\x5E\x5F]";
const string C1_STR_8BIT = @"[\x9D\x90\x98\x9E\x9F]";
const string C1_STR_7OR8 = @"(?:" + C1_STR_7BIT + "|" + C1_STR_8BIT + ")";
const string ST_7BIT = @"\x1B\\\\";
const string ST_8BIT = @"\x9C";
const string ST_7OR8 = @"(?:" + ST_7BIT + "|" + ST_8BIT + ")";
static void Main(string[] args) {
string[] tmp = new string[] {
@"(?:[\x30-\x3F]*)(?:[\x20-\x2F]*[\x40-\x7E])",
C1_NST_7BIT,
C1_NST_8BIT,
C1_STR_7OR8 + CHAR_STR + ST_7OR8
};
string regex = "(?:" + string.Join("|", tmp) + ")";
Regex reg = new Regex(regex);
}
}
}
|
|
|
|
|
Hi everyone,
i am using Visual Studio 2012 and Sql Server 2008 R2.
i am writing a program that is about inventory tracking.
All of my works is done.
it is working very well in Visual Studio.
And i have to create setup file.
i use installsheild 2013 LE.
I am constantly encountering errors in the setup file.
occurs difference with version of sql server which another computer and mine
and there are many errors about different case.
So let me know please, how i create setup file in this situation.
i want to automaticaly setup sql server,net frameworks and my project.
|
|
|
|
|
First, do NOT install SQL Server as part of your setup. Reason being is that MS doesn't license nor support doing that. SQL Server should be installed completely separately. This give admins the option of using their own SQL Server to host your app data instead of managing yet another instance of SQL Server.
|
|
|
|
|
Ok thanks. i handled net frameworks. i will install sql separately.
Do you know why occured difference between two computers sql versions?
my sql is sql server menagement studio 2008 R2 and other computer have Microsoft SQL Server 2008 Express SP1.
is that so?
|
|
|
|
|
You're not comparing the same thing. The first one is a tool used to manage SQL Server and can be used on multiple versions of SQL Server and the second is a database engine.
So, yes, it's possible to have both of those installed on the same machine.
|
|
|
|
|
i am creating a exe file using visual studio 2010, if i send it to my frnd who doesnt have visual studio, will it run over his system ??
|
|
|
|
|
Only if he has the .NET Framework version installed that your app targeted when you built it.
Open the Project Properties and look at the Application tab. In there you'll find a dropdown with the Target framework specified.
|
|
|
|
|
As you are using Visual Studio 2010, it's a simple matter for you to create an application installer - it's one of the project types. This will include the relevant .NET framework version as a prerequisite.
|
|
|
|
|
Shouldn't be any issue if you build the project using MSI Installer. You however need to create MSI Package Using a Visual Studio Setup Project and build/deploy from it. Include all the dependencies properly.
http://support.microsoft.com/kb/307353[^]
|
|
|
|
|
He needs the .Net framework which he can download and install for free.
make sure it is the correct version. (although I believe the latest ones will run the previous ones as well)
|
|
|
|
|
V. wrote: although I believe the latest ones will run the previous ones as well
Not so - the "complete backward compatibility" of .NET ended with V4.5, which won't run all earlier versions without changes: http://msdn.microsoft.com/en-us/library/ff602939(v=vs.110).aspx[^]
You looking for sympathy?
You'll find it in the dictionary, between sympathomimetic and sympatric
(Page 1788, if it helps)
|
|
|
|
|
You should only need a configuration file change, though:
Backward compatibility and the .NET Framework 4.5:
The .NET Framework 4.5 and its point releases are backward-compatible with apps that were built with earlier versions of the .NET Framework.
In other words, apps and components built with previous versions will work without modification on the .NET Framework 4.5.
However, by default, apps run on the version of the common language runtime for which they were developed, so you may have to provide a configuration file to enable your app to run on the .NET Framework 4.5.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|