473,769 Members | 6,473 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Generics limitation on .Net

I need to initialise a typed parameter depending of its type in a generic
class.
I have tried to use the C++ template form as follow, but it doesn't work.
It seems to be a limitation of generics vs C++ templates.
Does anyone knows a workaround to do this ? Thx :

public class C<T>
{
private T myValue;

private void InitializeValue (out Byte value) { value = Byte.MinValue; }
private void InitializeValue (out Char value) { value = Char.MinValue; }
private void InitializeValue (out Int16 value) { value = Int16.MinValue; }
// ... and so on...
private void InitializeValue (out String value) { value = "Initial value"; }
private void InitializeValue (out Object value) { value = this; }

public C()
{
InitializeValue (out myValue);
}

// ...
}
Dec 28 '05
23 2552
Good point! =)

You think that people would buy newsreaders with compilers built into
them? =)

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Jay B. Harlow [MVP - Outlook]" <Ja************ @tsbradley.net> wrote in
message news:OQ******** *******@TK2MSFT NGP15.phx.gbl.. .
Nicholas,
| valueType = (T) Char.MinValue;
Produces a compile error!

You need to cast to object first, as Char to T is not defined. Without a
constraint only object to/from T is defined.

| valueType = (T)(object)Char .MinValue;

Even then a runtime error could occur...

--
Hope this helps
Jay [MVP - Outlook]
.NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote
in
message news:eV******** ******@TK2MSFTN GP12.phx.gbl...
| Luc,
|
| You have to cast the result of the call of <type>.MinVal ue to T, like
| so:
|
| valueType = (T) Char.MinValue;
|
|
| --
| - Nicholas Paldino [.NET/C# MVP]
| - mv*@spam.guard. caspershouse.co m
|
| "Luc Vaillant" <Lu*********@di scussions.micro soft.com> wrote in message
| news:44******** *************** ***********@mic rosoft.com...
| >I have already tried that, but it didn't work (for the same reasons):
| >
| > public class C<T>
| > {
| > private T myValue;
| >
| > private void InitializeValue (out T value)
| > {
| > if (valeurType.Get Type() == typeof(Byte))
| > valeurType = Byte.MinValue;
| > else if (valeurType.Get Type() == typeof(Char))
| > valeurType = Char.MinValue;
| > else if (valeurType.Get Type() == typeof(Int16))
| > valeurType = Int16.MinValue;
| > // and so on...
| > else
| > valeurType = default(T);
| > }
| >
| > public C()
| > {
| > InitializeValue (out myValue);
| > }
| >
| > // ...
| > }
| >
| > Error messages are :
| > Error 1 Cannot implicitly convert type 'byte' to 'T'
| > Error 2 Cannot implicitly convert type 'char' to 'T'
| > Error 3 Cannot implicitly convert type 'short' to 'T'
| >
| > and so on...
| >
| >
| >
| > "Nicholas Paldino [.NET/C# MVP]" wrote:
| >
| >> Then you will have to do a type comparison on T and then set your
| >> value
| >> based on the type of T.
| >>
| >>
| >> --
| >> - Nicholas Paldino [.NET/C# MVP]
| >> - mv*@spam.guard. caspershouse.co m
| >>
| >> "Luc Vaillant" <Lu*********@di scussions.micro soft.com> wrote in
message
| >> news:DE******** *************** ***********@mic rosoft.com...
| >> > Yes, this is for the default value, but what if I want to
initialize
my
| >> > variable with a value that is not the default one ?
| >> >
| >> > "Joanna Carter [TeamB]" wrote:
| >> >
| >> >> "Luc Vaillant" <Lu*********@di scussions.micro soft.com> a écrit
dans
le
| >> >> message de news:
A6************* *************** **...icrosof t.com...
| >> >>
| >> >> |I need to initialise a typed parameter depending of its type in a
| >> >> generic
| >> >> | class.
| >> >> | I have tried to use the C++ template form as follow, but it
doesn't
| >> >> work.
| >> >> | It seems to be a limitation of generics vs C++ templates.
| >> >> | Does anyone knows a workaround to do this ? Thx :
| >> >> |
| >> >> | public class C<T>
| >> >> | {
| >> >> | private T myValue;
| >> >> |
| >> >> | private void InitializeValue (out Byte value) { value =
| >> >> Byte.MinValue; }
| >> >> | private void InitializeValue (out Char value) { value =
| >> >> Char.MinValue; }
| >> >> | private void InitializeValue (out Int16 value) { value =
| >> >> Int16.MinValue; }
| >> >> | // ... and so on...
| >> >> | private void InitializeValue (out String value) { value =
"Initial
| >> >> value"; }
| >> >> | private void InitializeValue (out Object value) { value =
this; }
| >> >> |
| >> >> | public C()
| >> >> | {
| >> >> | InitializeValue (out myValue);
| >> >> | }
| >> >> |
| >> >> | // ...
| >> >> | }
| >> >>
| >> >> You are not specifying the type that you wish to initialise, to
the
| >> >> constructor.
| >> >>
| >> >> In any case, you can use the 'default' keyword to initialise any
type
| >> >> passed
| >> >> as the parameter to the generic class :Then you don't even have to
| >> >> declare a
| >> >> constructor for this purpose.
| >> >>
| >> >> public class C<T>
| >> >> {
| >> >> private T myValue = default(T);
| >> >> }
| >> >>
| >> >> Joanna
| >> >>
| >> >> --
| >> >> Joanna Carter [TeamB]
| >> >> Consultant Software Engineer
| >> >>
| >> >>
| >> >>
| >>
| >>
| >>
|
|

Dec 28 '05 #11
| You think that people would buy newsreaders with compilers built into
| them? =)
They might! There's been days when I would find it helpful...

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:%2******** **********@TK2M SFTNGP09.phx.gb l...
| Good point! =)
|
| You think that people would buy newsreaders with compilers built into
| them? =)
|
| --
| - Nicholas Paldino [.NET/C# MVP]
| - mv*@spam.guard. caspershouse.co m
|
<<snip>>
Dec 28 '05 #12
Thanks a lot for your answer,

cast value->Object->T works fine.

I don't need the MinValue, it was just for the example.
But Reflexion is a good idea, I will keep it in mind

Thanks again
Luc
"Jay B. Harlow [MVP - Outlook]" wrote:
Luc,
One way might be to cast the value to an object, then cast it to T,
something like:

| if (valeurType.Get Type() == typeof(Byte))
| valeurType = (T)(object)Byte .MinValue;

If you know you want "MinValue" I would consider using Reflection to find
the "MinValue" field on the respective type, something like:

private void InitializeValue (out T value)
{
Type t = typeof(T);
System.Reflecti on.FieldInfo fi = t.GetField("Min Value");
if (fi == null)
{
value = default(T);
}
else
{
value = (T)fi.GetValue( null);
}
}

This helps ensure that C<T> supports "MinValue" on new types that may be
used with it, without modifying C<T> itself.

NOTE: The above routine assumes that MinValue is a static field...
Although I would define the class such that default(T) was acceptable or
used another field to indicate the special value...

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Luc Vaillant" <Lu*********@di scussions.micro soft.com> wrote in message
news:44******** *************** ***********@mic rosoft.com...
|I have already tried that, but it didn't work (for the same reasons):
|
| public class C<T>
| {
| private T myValue;
|
| private void InitializeValue (out T value)
| {
| if (valeurType.Get Type() == typeof(Byte))
| valeurType = Byte.MinValue;
| else if (valeurType.Get Type() == typeof(Char))
| valeurType = Char.MinValue;
| else if (valeurType.Get Type() == typeof(Int16))
| valeurType = Int16.MinValue;
| // and so on...
| else
| valeurType = default(T);
| }
|
| public C()
| {
| InitializeValue (out myValue);
| }
|
| // ...
| }
|
| Error messages are :
| Error 1 Cannot implicitly convert type 'byte' to 'T'
| Error 2 Cannot implicitly convert type 'char' to 'T'
| Error 3 Cannot implicitly convert type 'short' to 'T'
|
| and so on...
|
|
|
| "Nicholas Paldino [.NET/C# MVP]" wrote:
|
| > Then you will have to do a type comparison on T and then set your
value
| > based on the type of T.
| >
| >
| > --
| > - Nicholas Paldino [.NET/C# MVP]
| > - mv*@spam.guard. caspershouse.co m
| >
| > "Luc Vaillant" <Lu*********@di scussions.micro soft.com> wrote in message
| > news:DE******** *************** ***********@mic rosoft.com...
| > > Yes, this is for the default value, but what if I want to initialize
my
| > > variable with a value that is not the default one ?
| > >
| > > "Joanna Carter [TeamB]" wrote:
| > >
| > >> "Luc Vaillant" <Lu*********@di scussions.micro soft.com> a écrit dans
le
| > >> message de news:
A6************* *************** **...icrosof t.com...
| > >>
| > >> |I need to initialise a typed parameter depending of its type in a
| > >> generic
| > >> | class.
| > >> | I have tried to use the C++ template form as follow, but it doesn't
| > >> work.
| > >> | It seems to be a limitation of generics vs C++ templates.
| > >> | Does anyone knows a workaround to do this ? Thx :
| > >> |
| > >> | public class C<T>
| > >> | {
| > >> | private T myValue;
| > >> |
| > >> | private void InitializeValue (out Byte value) { value =
| > >> Byte.MinValue; }
| > >> | private void InitializeValue (out Char value) { value =
| > >> Char.MinValue; }
| > >> | private void InitializeValue (out Int16 value) { value =
| > >> Int16.MinValue; }
| > >> | // ... and so on...
| > >> | private void InitializeValue (out String value) { value = "Initial
| > >> value"; }
| > >> | private void InitializeValue (out Object value) { value = this; }
| > >> |
| > >> | public C()
| > >> | {
| > >> | InitializeValue (out myValue);
| > >> | }
| > >> |
| > >> | // ...
| > >> | }
| > >>
| > >> You are not specifying the type that you wish to initialise, to the
| > >> constructor.
| > >>
| > >> In any case, you can use the 'default' keyword to initialise any type
| > >> passed
| > >> as the parameter to the generic class :Then you don't even have to
| > >> declare a
| > >> constructor for this purpose.
| > >>
| > >> public class C<T>
| > >> {
| > >> private T myValue = default(T);
| > >> }
| > >>
| > >> Joanna
| > >>
| > >> --
| > >> Joanna Carter [TeamB]
| > >> Consultant Software Engineer
| > >>
| > >>
| > >>
| >
| >
| >

Dec 29 '05 #13
"Jay B. Harlow [MVP - Outlook]" <Ja************ @tsbradley.net> a écrit dans
le message de news: OQ************* **@TK2MSFTNGP15 .phx.gbl...

| You need to cast to object first, as Char to T is not defined. Without a
| constraint only object to/from T is defined.
|
|| valueType = (T)(object)Char .MinValue;

You can also use the Convert class :

T value = (T) Convert.ChangeT ype(Char.MinVal ue, typeof(T))

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Dec 29 '05 #14
> You can also use the Convert class :

T value = (T) Convert.ChangeT ype(Char.MinVal ue, typeof(T))
This will also box Char.MinValue into Object
"Joanna Carter [TeamB]" wrote:
"Jay B. Harlow [MVP - Outlook]" <Ja************ @tsbradley.net> a écrit dans
le message de news: OQ************* **@TK2MSFTNGP15 .phx.gbl...

| You need to cast to object first, as Char to T is not defined. Without a
| constraint only object to/from T is defined.
|
|| valueType = (T)(object)Char .MinValue;

You can also use the Convert class :

T value = (T) Convert.ChangeT ype(Char.MinVal ue, typeof(T))

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer

Dec 29 '05 #15
"Luc Vaillant" <Lu*********@di scussions.micro soft.com> a écrit dans le
message de news: 7F************* *************** **...icrosof t.com...

| This will also box Char.MinValue into Object

I won't deny that :-)

Tell me, what are you doing that requires such super-optimised code ? Most
business applications are only really as fast as the person typing at the
keyboard.

If speed is that much of an issue, then don't write code that invokes so
much boxing. The example that you give doesn't really seem to fit the
generic programming model due to the possible differences in behaviour
required by the different types that may be used. In which case, I would
tend to look elsewhere for a solution; generics are only really useful when
the behaviour for *all* anticipated types is *identical*.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Dec 29 '05 #16
Is that an answer ?

I'm not writing a keyboard typing application, and I DO CARE ABOUT SPEED.
If speed is that much of an issue, then don't write code that invokes so
much boxing
That's why I wanted to use Generics...
The example that you give doesn't really seem to fit the
generic programming model due to the possible differences in behaviour
required by the different types that may be used
The example I gave was just to demonstrate the initialization issue. It was
not a real use case...
Same remark about the 'Generics limitation' post I sent today. The example
is to desmonstrate the != operator issue with generics, and this is not my
real program...

Why don't you try to answer my questions instead of explaining me that most
programs don't need speed, and that my examples don't "really seem to fit the
generic programming model".

My questions are simple:

1) How do I initialize a T value without doing boxing/unboxing ?

The answer is:
Not possible, must use T value = (T)(Object)cons tant value
even if I know that the constant value if of type T

2) How do I compare two T values without boxing/unboxing ?

The answer is:
Not possible from the answers I got in this post
Regards
Luc
"Joanna Carter [TeamB]" wrote:
"Luc Vaillant" <Lu*********@di scussions.micro soft.com> a écrit dans le
message de news: 7F************* *************** **...icrosof t.com...

| This will also box Char.MinValue into Object

I won't deny that :-)

Tell me, what are you doing that requires such super-optimised code ? Most
business applications are only really as fast as the person typing at the
keyboard.

If speed is that much of an issue, then don't write code that invokes so
much boxing. The example that you give doesn't really seem to fit the
generic programming model due to the possible differences in behaviour
required by the different types that may be used. In which case, I would
tend to look elsewhere for a solution; generics are only really useful when
the behaviour for *all* anticipated types is *identical*.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer

Dec 29 '05 #17
"Luc Vaillant" <Lu*********@di scussions.micro soft.com> a écrit dans le
message de news: 33************* *************** **...icrosof t.com...

| Is that an answer ?

Sometimes answers need to include further questions :-)

Sometimes, a good argument can help to avoid following "les poissons rouges"

| I'm not writing a keyboard typing application, and I DO CARE ABOUT SPEED.

No need to shout, such things are not always apparent.

| That's why I wanted to use Generics...

What made you think that generics would necessarily be fast ?

| The example I gave was just to demonstrate the initialization issue. It
was
| not a real use case...
| Same remark about the 'Generics limitation' post I sent today. The example
| is to desmonstrate the != operator issue with generics, and this is not my
| real program...

As I said, your particular requirements may indicate that generics are not
necessarily the best direction. If you wanted to set T to its true default,
then that is what the default(...) function is there for.

| Why don't you try to answer my questions instead of explaining me that
most
| programs don't need speed, and that my examples don't "really seem to fit
the
| generic programming model".

Because, from years of experience in OO, I felt that you were going down a
direction simply because it seemed right but not necessarily wise. You are,
of course, welcome to accept or discard any advice given; it comes without
malice or antagonism.

| My questions are simple:
|
| 1) How do I initialize a T value without doing boxing/unboxing ?
|
| The answer is:
| Not possible, must use T value = (T)(Object)cons tant value
| even if I know that the constant value if of type T

The answer is to understand that generics provides a mechanism, default(T),
which you feel is not adequate, therefore, you may have to either accept the
shortcomings of the alternatives like boxing, or choose an alternative to
generics.

If the types you are going to use are within your control, then you could
always have them implement a common interface with a method like
Initialise().

| 2) How do I compare two T values without boxing/unboxing ?
|
| The answer is:
| Not possible from the answers I got in this post

The only other alternative I could think of was to add the IComparable<T>
constraint to the generic class, allowing you to use :

{
int result = CompareTo(T other);
}

That is, assuming that your T types support IComparable<T>.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Dec 29 '05 #18
Ok, I'm bored feeding the troll...
Because, from years of experience in OO, I felt that you were going down a
direction simply because it seemed right but not necessarily wise. You are,
of course, welcome to accept or discard any advice given; it comes without
malice or antagonism.
With your "years of experience in OO", you should felt that answer :

class MyComp : IComparer<short >, IComparer<int>, IComparer<long>
{
public int Compare(int x, int y) { return x - y; }
public int Compare(short x, short y) { return x - y; }
public int Compare(long x, long y) { return x - y; }
}

class GenClass<T, I> where I : IComparer<T>, new()
{
private IComparer<T> comparer = new I();

public GenClass(T value1, T value2)
{
// THIS IS AN EXAMPLE, NOT MY REAL PROGRAM !!!
// (I'M NOT SHOUTING..., IT'S JUST A WARNING...)
if (comparer.Compa re(value1, value2) == 0)
Console.WriteLi ne("value1 equals value2");
}
}

class Program
{
static void Main(string[] args)
{
// THIS IS AN EXAMPLE TOO, NOT MY REAL PROGRAM !!!
GenClass<short, MyComp> A = new GenClass<short, MyComp>(123, 123);
GenClass<int, MyComp> B = new GenClass<int, MyComp>(123, 123);
GenClass<long, MyComp> B = new GenClass<long, MyComp>(123, 123);
}
}
What made you think that generics would necessarily be fast ? Have you ever written or used generics ? Is Generics just a search/replace
tool for you ?

"In addition to type safety, generic collection types generally perform
better for storing and manipulating value types because there is no need to
box the value types." taken from
"ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio .v80.en/dv_fxfund/html/6b90f9c3-eee3-4cd1-98d6-82019c83a1df.ht m" :

Regards
Luc

"Joanna Carter [TeamB]" wrote:
"Luc Vaillant" <Lu*********@di scussions.micro soft.com> a écrit dans le
message de news: 33************* *************** **...icrosof t.com...

| Is that an answer ?

Sometimes answers need to include further questions :-)

Sometimes, a good argument can help to avoid following "les poissons rouges"

| I'm not writing a keyboard typing application, and I DO CARE ABOUT SPEED.

No need to shout, such things are not always apparent.

| That's why I wanted to use Generics...

What made you think that generics would necessarily be fast ?

| The example I gave was just to demonstrate the initialization issue. It
was
| not a real use case...
| Same remark about the 'Generics limitation' post I sent today. The example
| is to desmonstrate the != operator issue with generics, and this is not my
| real program...

As I said, your particular requirements may indicate that generics are not
necessarily the best direction. If you wanted to set T to its true default,
then that is what the default(...) function is there for.

| Why don't you try to answer my questions instead of explaining me that
most
| programs don't need speed, and that my examples don't "really seem to fit
the
| generic programming model".

Because, from years of experience in OO, I felt that you were going down a
direction simply because it seemed right but not necessarily wise. You are,
of course, welcome to accept or discard any advice given; it comes without
malice or antagonism.

| My questions are simple:
|
| 1) How do I initialize a T value without doing boxing/unboxing ?
|
| The answer is:
| Not possible, must use T value = (T)(Object)cons tant value
| even if I know that the constant value if of type T

The answer is to understand that generics provides a mechanism, default(T),
which you feel is not adequate, therefore, you may have to either accept the
shortcomings of the alternatives like boxing, or choose an alternative to
generics.

If the types you are going to use are within your control, then you could
always have them implement a common interface with a method like
Initialise().

| 2) How do I compare two T values without boxing/unboxing ?
|
| The answer is:
| Not possible from the answers I got in this post

The only other alternative I could think of was to add the IComparable<T>
constraint to the generic class, allowing you to use :

{
int result = CompareTo(T other);
}

That is, assuming that your T types support IComparable<T>.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer

Dec 30 '05 #19
"Luc Vaillant" <Lu*********@di scussions.micro soft.com> a écrit dans le
message de news: 81************* *************** **...icrosof t.com...

| Ok, I'm bored feeding the troll...

I'm sorry you feel that way. I have never "trolled" newsgroups; had I done
so, I doubt that I would have been appointed as a newsgroup mediator for
Borland. You obviously have a problem with people who don't give you advice
or don't have opinions with which you agree.

| With your "years of experience in OO", you should felt that answer :

Hey, I am officially on holiday for Christmas. Just because I don't come up
with the right answer first time, doesn't give you the right to denegrate my
experience. If I don't understand your question fully the first ime around,
it may be that I am working on more than just solving your problems; like
writing articles for people that do appreciate the time and effort that goes
into trying to help others understand some pretty complicated stuff.

| Have you ever written or used generics ? Is Generics just a search/replace
| tool for you ?
|
| "In addition to type safety, generic collection types generally perform
| better for storing and manipulating value types because there is no need
to
| box the value types." taken from
|
"ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio .v80.en/dv_fxfund/html/6b90f9c3-eee3-4cd1-98d6-82019c83a1df.ht m"
:

It seems it takes a troll to think they have found an other troll :-) I find
your attitude to be insulting.

So, does the IComparer solve your problem ?

Have a peaceful New Year.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Dec 30 '05 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5804
by: Hung Jung Lu | last post by:
Hi, I just downloaded rotor and gyro and am playing a bit with generics. I enclose a sample program. My question is, according to the language spec (http://msdn.microsoft.com/vcsharp/team/language/default.aspx, C# 2.0 Specification), a syntax like: public class MathEngine<T> where T: IHasX, IHasY { … }
8
1843
by: Leicester B. Ford Jr. | last post by:
I have come across a problem using generics. I want to create a Factory type that will build classes for me. Code snippet below... static public class Product<T> where T : new() { static public T New() { return new T(); } }
4
9206
by: Michael Sparks | last post by:
I started writing some code with the 2.0 beta compiler, and found out quickly that specialization is not supported with generics. For example, I want to do something like this: class number ... class integer : number ... class real : number ... class multiplier<_number> where _number : number ... class multiplier<_number> where _number : integer ...
3
1252
by: Tom Jastrzebski | last post by:
Hello everybody, Here is another problem with generics I come across. Let's say I want to implement a structure performing some operations on some numeric type. I can not than just return this expected type since the compiler is not sure what this type would be, and it does not know that the type I am trying to returned is the correct type, or either that the conversion is possible. Ok, I understand - it is just the limitation of...
3
1957
by: Marshal | last post by:
/////////////////////////////////////////////////////////////////////////////////////////////// /// CONSTRAINTS ON GENERICS //////////////////////////////////////////////////// public class Node<T> where T:IComparable<T> I don't like the syntax, and would prefer something that groups the constraint along with the type that it governs them, as depicted in this suggestion:
13
1697
by: Luc Vaillant | last post by:
I try to compare to values of generic value type T in a generic class as follow: public class C<T> where T : struct { private T value1; private T value2; C(T value1, T value2) {
8
2433
by: Kris Jennings | last post by:
Hi, I am trying to create a new generic class and am having trouble casting a generic type to a specific type. For example, public class MyClass<Twhere T : MyItemClass, new() { public MyClass() { } public void AppendItem()
8
2554
by: Gary Brown | last post by:
Hi, When I do the following public class IAmAGeneric<T> { ... public T AMember (T a, T b) { return a + b; }; }
2
138
by: =?Utf-8?B?QnJhdmVzQ2hhcm0=?= | last post by:
I am trying to convert a class I have to generics and I can't seem to find any possible why to implement it. I'm beginning to think I'm doing something I shouldn't or I hit generics limitation. Here is an example of the old way: static void Main(string args) { MonitorCenter monitor = new MonitorCenter(); monitor.SetMonitor(new ExceptionMonitor());
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5309
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.