Re: [Mono-dev] GBK support error

2005-11-16 Thread zhu shi song
Dear Sir,
(1) codepage = GB18030
String s = 12\u7f51\u9875;

Encoding e = Encoding.GetEncoding(GB18030);
byte[] bytebuf = e.GetBytes(s);

for ( int i =0; i bytebuf.Length ; i++) 
   Console.Write({0:X2},(byte)bytebuf[i]);
  The result is :
   31328230833582359131
  The correct should be:
   3132CDF8D2B3
(2)codepage = GBK
String s = 12\u7f51\u9875;

Encoding e = Encoding.GetEncoding(GBK);
byte[] bytebuf = e.GetBytes(s);

for ( int i =0; i bytebuf.Length ; i++) 
   Console.Write({0:X2},(byte)bytebuf[i]);
  The result is :
  00310032CDF8D2B3
  The correct should be:
   3132CDF8D2B3

  tks
  zhu

--- Atsushi Eno [EMAIL PROTECTED] wrote:

 Hi,
 
 zhu shi song wrote:
  Dear lists,
   I need to convert string aÓÐÍø to byte array.
 
 Can you please give the same string using escaped
 (\u)
 representation? It looks broken on mail messages.
 
   Encoding e = Encoding.GetEncoding(GBK);

   
   byte[] bytebuf = e.GetBytes(1ÓÐÍø);
  
   Under Windows, I got 31D3D0CDF8. But under
 Mono,
  the result is 0031D3D0CDF8.
  
  Who can help me?
  
 
 It would be nice if you file a bug on our bugzilla:
 http://www.mono-project.com/Bugs
 
 Thanks,
 Atsushi Eno
 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] mono string internal representation problem

2005-11-16 Thread zhu shi song
Dear sir,
  I found that string internal representation in mono
is different from in ms VS.Net.
  For example,
  In Mono:
---  ldstr  12\u795D\u798F 
  Mono uses ucs-2BE as default string internal
representation 
  In MS:
--- ldstr  12\u5D79\u8F79
  MS uses ucs-2LE as default string internal
representation
  I think the problem can cause System.Text.Encoding
doesn't work correctly. So 
How to handle the compatible problem?

  tks
  zhu



__ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] ./configure --enable-minimal=aot, profiler gives error.

2005-11-16 Thread conn intel

Hello Friends,

Once again thank you for your mail.

But i am again getting error even after renaming the directory. could you pls get me out from this...

Thank You in advance.

Regards,
Ankur.



/*Error Message*/

make[3]: Entering directory `/home/mono1.1.10/mono1.1.10/mcs'
make profile-do--default--all profile-do--net_2_0--all
make[4]: Entering directory `/home/mono1.1.10/mono1.1.10/mcs'
make PROFILE="" all
make[5]: Entering directory `/home/mono1.1.10/mono1.1.10/mcs'
/bin/sh: build/deps/basic-profile-check.cs: No such file or directory
make[6]: *** [build/deps/basic-profile-check.cs] Error 1
make[6]: Entering directory `/home/mono1.1.10/mono1.1.10/mcs'
*** The compiler 'mcs' doesn't appear to be usable.
*** Trying the 'monolite' directory.
/bin/sh: ./build/deps/use-monolite: No such file or directory
make[6]: *** [do-profile-check-monolite] Error 1
make[6]: Leaving directory `/home/mono1.1.10/mono1.1.10/mcs'
make[5]: *** [do-profile-check] Error 2
make[5]: Leaving directory `/home/mono1.1.10/mono1.1.10/mcs'
make[4]: *** [profile-do--basic--all] Error 2
make[4]: Leaving directory `/home/mono1.1.10/mono1.1.10/mcs'
make[3]: *** [profiles-do--all] Error 2
make[3]: Leaving directory `/home/mono1.1.10/mono1.1.10/mcs'
make[2]: *** [all-local] Error 2
make[2]: Leaving directory `/home/mono1.1.10/mono1.1.10/runtime'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mono1.1.10/mono1.1.10'
make: *** [all] Error 2

/***/
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] accessing file on a windows share

2005-11-16 Thread Buderya Roshan
Hi,

I am trying to access a file on a remote share (Windows share with full
access to everyone). On windows using .net I can access and read the
file as

StreamReader sr = new
StreamReader(@\\server_name\share_name\file_name);
string line = sr.ReadLine();

But when I compile  run the same under mono for windows, I get
System.IO.DirectoryNotFoundException.  How do I specify the filepath in
mono? Also when this is running from Linux (Samba client setup) do I
need to do something else?

Thanks,
Roshan
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] GBK support error

2005-11-16 Thread Atsushi Eno

Hello,

Both of the bugs were now fixed in svn.

Thanks,
Atsushi Eno

zhu shi song wrote:

Dear Sir,
(1) codepage = GB18030
String s = 12\u7f51\u9875;
	
Encoding e = Encoding.GetEncoding(GB18030);

byte[] bytebuf = e.GetBytes(s);
	   		
for ( int i =0; i bytebuf.Length ; i++) 
   Console.Write({0:X2},(byte)bytebuf[i]);

  The result is :
   31328230833582359131
  The correct should be:
   3132CDF8D2B3
(2)codepage = GBK
String s = 12\u7f51\u9875;
	
Encoding e = Encoding.GetEncoding(GBK);

byte[] bytebuf = e.GetBytes(s);
	   		
for ( int i =0; i bytebuf.Length ; i++) 
   Console.Write({0:X2},(byte)bytebuf[i]);

  The result is :
  00310032CDF8D2B3
  The correct should be:
   3132CDF8D2B3

  tks
  zhu

--- Atsushi Eno [EMAIL PROTECTED] wrote:


Hi,

zhu shi song wrote:

Dear lists,
 I need to convert string aÓÐÍø to byte array.

Can you please give the same string using escaped
(\u)
representation? It looks broken on mail messages.

 Encoding e = Encoding.GetEncoding(GBK);		  
   
 
 byte[] bytebuf = e.GetBytes(1ÓÐÍø);


 Under Windows, I got 31D3D0CDF8. But under

Mono,

the result is 0031D3D0CDF8.

Who can help me?


It would be nice if you file a bug on our bugzilla:
http://www.mono-project.com/Bugs

Thanks,
Atsushi Eno




__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___

Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] typemanager patch to get correct indexer signature

2005-11-16 Thread Marek Safar
Hello Eno,
 I have a patch for typemanager.cs to fix the signature of an indexer
 to report (i.e. GetSignatureForError()). Currently it does not
 differentiate things like this[int] and this[string]. Actually
 it did not detect indexer getter methods (since the existing code
 expects more than one parameter).

 This rarely matters but I have a testable testcase with related to
 /doc feature (actually reported in bug #76685).

 Anyone please review for this patch?
   
As soon as all tests pass, please commit.

Marek

 

 // cs0419-2.cs: Ambiguous reference in cref attribute `A.this'. Assuming 
 `Test.A.this[string]' but other overloads including `Test.A.this[int]' have 
 also matched
 // Line: 7
 // Compiler options: -doc:dummy.xml -warnaserror
 using System.Collections;

 /// summary
 ///   parasee cref=IDictionary.this[object] //para
 ///   parasee cref=A.this //para
 ///   parasee cref=B.this //para
 /// /summary
 public class Test
 {
   static void Main()
   {
   }

   private class A
   {
 public object this[int index] {
   get { return null; }
 }

 public object this[string index] {
   get { return null; }
 }
   }

   private class B
   {
 public object this[int index] {
   get { return null; }
 }
   }
 }

   
 

 Index: typemanager.cs
 ===
 --- typemanager.cs(revision 52958)
 +++ typemanager.cs(working copy)
 @@ -587,6 +587,14 @@
   /// /summary
   static public string GetFullNameSignature (MemberInfo mi)
   {
 + PropertyInfo pi = mi as PropertyInfo;
 + if (pi != null) {
 + MethodBase pmi = pi.GetGetMethod ();
 + if (pmi == null)
 + pmi = pi.GetSetMethod ();
 + if (GetParameterData (pmi).Count  0)
 + mi = pmi;
 + }
   return (mi is MethodBase)
   ? CSharpSignature (mi as MethodBase) 
   : CSharpName (mi.DeclaringType) + '.' + mi.Name;
 @@ -629,14 +637,17 @@
  
   // Is indexer
   if (mb.IsSpecialName  !mb.IsConstructor) {
 - if (iparams.Count  1) {
 + if (iparams.Count  (mb.Name.StartsWith (get_) ? 0 : 
 1)) {
   sig.Append (this[);
   if (show_accessor) {
   sig.Append (parameters.Substring (1, 
 parameters.Length - 2));
   }
   else {
   int before_ret_val = 
 parameters.LastIndexOf (',');
 - sig.Append (parameters.Substring (1, 
 before_ret_val - 1));
 + if (before_ret_val  0)
 + sig.Append 
 (parameters.Substring (1, parameters.Length - 2));
 + else
 + sig.Append 
 (parameters.Substring (1, before_ret_val - 1));
   }
   sig.Append (']');
   } else {
   
 

 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list
   

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] ANN: NUnit 2.2.3 Released

2005-11-16 Thread Charlie Poole
Hi All,

I just released NUnit 2.2.3. It has a few new features and a lot of bug
fixes. It's compatible with VS2005 and .NET 2.0, but is still built with
.NET 1.1 under VS2003. Only the msi file is available right now - others
will follow. You can download it at http://nunit.sf.net.

The release notes are available at
http://nunit.com/testweb/index.php?p=releaseNotesr=2.2.3.

Charlie


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] BINARY INCOMPATIBILITY

2005-11-16 Thread Hubert FONGARNAND




Since this morning, my mono r.53109. produces .exe that are not recognized by the MS.NET Framework 1.1
My code is :
// project created on 28/09/2005 at 10:43
using System;

class MainClass
{
 public static void Main(string[] args)
 {
 Console.WriteLine(Hello World);
 }
}
~
I do mcs test.cs
and # mono ./Main.exe
Hello World

(it works on Linux)

But on windows
c:\Main.exe
c:\

When i want to add a dll or an exe generated by mono as a reference in Visual Studio : It says that the assembly is not valid!



___Ce message et les éventuels documents joints peuvent contenir des informations confidentielles.Au cas où il ne vous serait pas destiné, nous vous remercions de bien vouloir le supprimer et en aviser immédiatement l'expéditeur. Toute utilisation de ce message non conforme à sa destination, toute diffusion ou publication, totale ou partielle et quel qu'en soit le moyen est formellement interdite.Les communications sur internet n'étant pas sécurisées, l'intégrité de ce message n'est pas assurée et la société émettrice ne peut être tenue pour responsable de son contenu.

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] BINARY INCOMPATIBILITY

2005-11-16 Thread Hubert FONGARNAND




I've opened a bugzilla entry : #76723
http://bugzilla.ximian.com/show_bug.cgi?id=76723

Le mercredi 16 novembre 2005  13:57 +0100, Hubert FONGARNAND a crit :

Since this morning, my mono r.53109. produces .exe that are not recognized by the MS.NET Framework 1.1
My code is :
// project created on 28/09/2005 at 10:43
using System;

class MainClass
{
 public static void Main(string[] args)
 {
 Console.WriteLine(Hello World);
 }
}
~
I do mcs test.cs
and # mono ./Main.exe
Hello World

(it works on Linux)

But on windows
c:\Main.exe
c:\

When i want to add a dll or an exe generated by mono as a reference in Visual Studio : It says that the assembly is not valid!



___
Ce message et les ventuels documents joints peuvent contenir des informations confidentielles.
Au cas o il ne vous serait pas destin, nous vous remercions de bien vouloir le supprimer et en aviser immdiatement l'expditeur. Toute utilisation de ce message non conforme  sa destination, toute diffusion ou publication, totale ou partielle et quel qu'en soit le moyen est formellement interdite.
Les communications sur internet n'tant pas scurises, l'intgrit de ce message n'est pas assure et la socit mettrice ne peut tre tenue pour responsable de son contenu.  

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


___Ce message et les éventuels documents joints peuvent contenir des informations confidentielles.Au cas où il ne vous serait pas destiné, nous vous remercions de bien vouloir le supprimer et en aviser immédiatement l'expéditeur. Toute utilisation de ce message non conforme à sa destination, toute diffusion ou publication, totale ou partielle et quel qu'en soit le moyen est formellement interdite.Les communications sur internet n'étant pas sécurisées, l'intégrité de ce message n'est pas assurée et la société émettrice ne peut être tenue pour responsable de son contenu.

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] OpenBSD?

2005-11-16 Thread pablosantosluac



Is there any port of mono for OpenBSD?

thanks
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


RE: [Mono-dev] COM Interop in Mono

2005-11-16 Thread Jonathan S. Chambers
Well, no one has responded yet, so here comes the next email ;-)

This work is coming along, so I'd like to get it in svn soon.

Would this go under the trunk, as in /trunk/cominterop or something like
that? If anyone has a better name, please suggest. Also, I think this
work will also be similar to work needed for XPCOM. Should both be in
the same lib? Or where can I put shared functionality?

Ok, more details. All calls to the RCW's are finding their way to the
correct methods on the COM objects. Currently, I find the interface that
the method belongs to. I then subtract interface-method.start from the
method-slot. This gives me the offset of the method in the interface. I
then compensate for whether the interface is IUnknown based or IDispatch
based (3 or 7 methods at beginning of vtable). I then call that offset
on the correct vtable.

Now, more about integrating into mono. To correctly support COM interop
in mono, the following functionality is needed. I'm trying to begin to
define what the API needs to support.

1. Object Creation
2. Method Calls
3. Object Destruction (will all component wrappers need a finalizer?)
4. Casting (more difficult for me, can be supported later as this
dynamically adds interfaces to an object)
5. Interface/COM object marshalling
6. BSTR marshalling (I think this should be in this library, so mono has
no dependencies on the Sys*String routines for BSTRS)

Some humble beginning like:

/* creates unmanaged object */
gpointer 
component_create(MonoObject* this); 

/* destroys unmanaged object */
void 
component_destroy(MonoObject * this); 

/* gets managed-unmanaged wrapper for method calls, called by
mono_marshal_get_native_wrapper? */
MonoMethod *
component_get_method (MonoMethod *method) 

Not sure about the marshalling yet...

Thanks,
Jonathan
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jonathan
S. Chambers
Sent: Monday, November 14, 2005 10:06 PM
Cc: mono-devel-list@lists.ximian.com
Subject: [Mono-dev] COM Interop in Mono

Hello all,
 Here is a brief overview of some work involving COM Interop support
in mono. I'm sure I'm wrong on multiple things below, so feel free to
suggest/correct.


COM Standard

Don't feel like saying alot. Lots of docs available.


MS COM Interop

Again, well documented. Especially via '.NET and COM: The Complete
Interoperability Guide' by Adam Nathan. COM interop is twofold.

1. Managed Client, COM Server - This allows for unmanaged com components
to be used in the managed runtime. This occurs via runtime callable
wrappers (RCW). The RCW is a managed wrapper that manages a single
unmanaged com object. The lifetime of the COM object is managed via the
RCW; the RCW's lifetime is managed like any other managed object. Also,
the interop can occur via early binding (using the Interop assembly and
vtables) or late binding via reflection.

2. COM Client, Managed Server - In this case, an managed object is
exposed to COM via a COM callable wrapper (CCW). The CCW behaves like a
normal COM object to the client. The CCW exposes interfaces
corresponding to the managed object's methods/properties, as well as
IUnknown, IDispatch, and other interfaces.

Another thing to note about COM interop is the runtime support for
casting. Normal managed objects fail upon a cast when an interface is
not implemented by that object. A RCW will try to cast the normal way,
via the metadata provided about the class. If the cast fails, the
runtime will then call QueryInterface on the underlying COM object for
the interface in question. If the QueryInterface succeeds, then the
runtime allows the cast to occur. 

I'm ignoring other semi-important (depending on your situation) aspects
of COM interop such as COM threading, connection points, etc.


Old Approach (all in C#, runtime agnostic; i.e. worked on MS. Net and
Mono)

I'm not going to spend much time on this. This work initially grew out
of looking at some code by Peter Bartok in Win32Dnd.cs in MWF. A COM
interface (really just a vtable) is essentially a structure of function
pointers. Function pointers can be marshalled as delegates (in 2.0) and
vice versa. So, for each COM interface a corresponding struct of
delegates was defined; except, the all the method signatures were
modified to take an IntPtr as the first argument, the 'this; pointer.
Once the COM object was created, it was QI'd for that interface. Then,
the returned pointer (which points to the vtable) was read via
Marshal.ReadIntPtr. This value is then marshalled as the struct
previously defined. The delegates can now be invoked.

In addition, custom marshallers were written for the marshalling of
interfaces and BSTRs. Tricks were played with pinning, GCHandles, etc
for lifetime management. Also, to get around the fact that there was no
runtime support for 'late' casting, Reflection.Rmit was used to build
dynamic wrappers.

This method proved useful, but ugly and inefficient to say the least.


Current Approach


[Mono-dev] XSP debugging

2005-11-16 Thread Carlos Solorzano
Whats the easiest way to do some debugging of XSP, is there a way to  
turn on logs for XSP?

Thanks,

--Carlos
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] COM Interop in Mono

2005-11-16 Thread Kornél Pál

Hi,

You are referencing something that you want to upload to SVN but did not
show it yet. What is it exactly?

Note that there were discussions about COM interop previously you should
look at them as well.

Some important things:

COM is Windows specific. If you want to use it you can use MS.NET instead of
Mono as relaying on COM interop is platform dependent. So there is no use to
implement COM interop only for use with Windows.

On the other hand COM interop could be implemented as a platform independent
object oriented P/Invoke-like layer that could be cool. But the problem is
that on Windows COM specifies a standard ABI (Application Binary Interface)
for representing COM objects that can be accessed by code compiled using
different compilers.

On other platforms (Linux for example) there is no standard ABI for objects,
only for classic C functions. This makes the things difficult. In addition
things like XPCOM assume that you use the same compiler on both sides of
interop so has no specific ABI, it depends on the C++ compiler you use.

Some people would like to implement COM interop as Bonobo interop in Mono
but these two layers are so much different that it cannot be done. Bonobo
interop has to be implemented separatedly as it requires different interop
attributes for example.

Kornél

- Original Message -
From: Jonathan S. Chambers [EMAIL PROTECTED]
To: Jonathan S. Chambers [EMAIL PROTECTED]
Cc: mono-devel-list@lists.ximian.com
Sent: Wednesday, November 16, 2005 5:50 PM
Subject: RE: [Mono-dev] COM Interop in Mono


Well, no one has responded yet, so here comes the next email ;-)

This work is coming along, so I'd like to get it in svn soon.

Would this go under the trunk, as in /trunk/cominterop or something like
that? If anyone has a better name, please suggest. Also, I think this
work will also be similar to work needed for XPCOM. Should both be in
the same lib? Or where can I put shared functionality?

Ok, more details. All calls to the RCW's are finding their way to the
correct methods on the COM objects. Currently, I find the interface that
the method belongs to. I then subtract interface-method.start from the
method-slot. This gives me the offset of the method in the interface. I
then compensate for whether the interface is IUnknown based or IDispatch
based (3 or 7 methods at beginning of vtable). I then call that offset
on the correct vtable.

Now, more about integrating into mono. To correctly support COM interop
in mono, the following functionality is needed. I'm trying to begin to
define what the API needs to support.

1. Object Creation
2. Method Calls
3. Object Destruction (will all component wrappers need a finalizer?)
4. Casting (more difficult for me, can be supported later as this
dynamically adds interfaces to an object)
5. Interface/COM object marshalling
6. BSTR marshalling (I think this should be in this library, so mono has
no dependencies on the Sys*String routines for BSTRS)

Some humble beginning like:

/* creates unmanaged object */
gpointer
component_create(MonoObject* this);

/* destroys unmanaged object */
void
component_destroy(MonoObject * this);

/* gets managed-unmanaged wrapper for method calls, called by
mono_marshal_get_native_wrapper? */
MonoMethod *
component_get_method (MonoMethod *method)

Not sure about the marshalling yet...

Thanks,
Jonathan


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jonathan
S. Chambers
Sent: Monday, November 14, 2005 10:06 PM
Cc: mono-devel-list@lists.ximian.com
Subject: [Mono-dev] COM Interop in Mono

Hello all,
Here is a brief overview of some work involving COM Interop support
in mono. I'm sure I'm wrong on multiple things below, so feel free to
suggest/correct.


COM Standard

Don't feel like saying alot. Lots of docs available.


MS COM Interop

Again, well documented. Especially via '.NET and COM: The Complete
Interoperability Guide' by Adam Nathan. COM interop is twofold.

1. Managed Client, COM Server - This allows for unmanaged com components
to be used in the managed runtime. This occurs via runtime callable
wrappers (RCW). The RCW is a managed wrapper that manages a single
unmanaged com object. The lifetime of the COM object is managed via the
RCW; the RCW's lifetime is managed like any other managed object. Also,
the interop can occur via early binding (using the Interop assembly and
vtables) or late binding via reflection.

2. COM Client, Managed Server - In this case, an managed object is
exposed to COM via a COM callable wrapper (CCW). The CCW behaves like a
normal COM object to the client. The CCW exposes interfaces
corresponding to the managed object's methods/properties, as well as
IUnknown, IDispatch, and other interfaces.

Another thing to note about COM interop is the runtime support for
casting. Normal managed objects fail upon a cast when an interface is
not implemented by that object. A RCW will try to cast the normal way,
via the metadata provided about 

Re: [Mono-dev] BINARY INCOMPATIBILITY

2005-11-16 Thread Miguel de Icaza
Hello,

 I've opened a bugzilla entry : #76723
 http://bugzilla.ximian.com/show_bug.cgi?id=76723

Thanks for filing the bug.

Zoltan has now fixed this.

Miguel
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


RE: [Mono-dev] COM Interop in Mono

2005-11-16 Thread Jonathan S. Chambers
Attached is a diff of some current progress. These changes are all in place 
right now, they would of course need moved to an external library.

Kornel, to answer your questions:

This is intended to be the beginning of a framework to leverage 
multiple component technologies. COM Interop is well defined so I'm starting 
there. 

COM is not necessarily Windows specific. It can be ported via tools 
(such as those provided by Mainsoft) or on one's own if you follow the COM ABI 
standard.

As for XPCOM, I know little about it. I've looked into it a little, and while 
it may not have as well defined an ABI, there may still be hope for it.

- Jonathan

-Original Message-
From: Kornél Pál [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 16, 2005 1:07 PM
To: Jonathan S. Chambers
Cc: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] COM Interop in Mono

Hi,

You are referencing something that you want to upload to SVN but did not
show it yet. What is it exactly?

Note that there were discussions about COM interop previously you should
look at them as well.

Some important things:

COM is Windows specific. If you want to use it you can use MS.NET instead of
Mono as relaying on COM interop is platform dependent. So there is no use to
implement COM interop only for use with Windows.

On the other hand COM interop could be implemented as a platform independent
object oriented P/Invoke-like layer that could be cool. But the problem is
that on Windows COM specifies a standard ABI (Application Binary Interface)
for representing COM objects that can be accessed by code compiled using
different compilers.

On other platforms (Linux for example) there is no standard ABI for objects,
only for classic C functions. This makes the things difficult. In addition
things like XPCOM assume that you use the same compiler on both sides of
interop so has no specific ABI, it depends on the C++ compiler you use.

Some people would like to implement COM interop as Bonobo interop in Mono
but these two layers are so much different that it cannot be done. Bonobo
interop has to be implemented separatedly as it requires different interop
attributes for example.

Kornél

- Original Message -
From: Jonathan S. Chambers [EMAIL PROTECTED]
To: Jonathan S. Chambers [EMAIL PROTECTED]
Cc: mono-devel-list@lists.ximian.com
Sent: Wednesday, November 16, 2005 5:50 PM
Subject: RE: [Mono-dev] COM Interop in Mono


Well, no one has responded yet, so here comes the next email ;-)

This work is coming along, so I'd like to get it in svn soon.

Would this go under the trunk, as in /trunk/cominterop or something like
that? If anyone has a better name, please suggest. Also, I think this
work will also be similar to work needed for XPCOM. Should both be in
the same lib? Or where can I put shared functionality?

Ok, more details. All calls to the RCW's are finding their way to the
correct methods on the COM objects. Currently, I find the interface that
the method belongs to. I then subtract interface-method.start from the
method-slot. This gives me the offset of the method in the interface. I
then compensate for whether the interface is IUnknown based or IDispatch
based (3 or 7 methods at beginning of vtable). I then call that offset
on the correct vtable.

Now, more about integrating into mono. To correctly support COM interop
in mono, the following functionality is needed. I'm trying to begin to
define what the API needs to support.

1. Object Creation
2. Method Calls
3. Object Destruction (will all component wrappers need a finalizer?)
4. Casting (more difficult for me, can be supported later as this
dynamically adds interfaces to an object)
5. Interface/COM object marshalling
6. BSTR marshalling (I think this should be in this library, so mono has
no dependencies on the Sys*String routines for BSTRS)

Some humble beginning like:

/* creates unmanaged object */
gpointer
component_create(MonoObject* this);

/* destroys unmanaged object */
void
component_destroy(MonoObject * this);

/* gets managed-unmanaged wrapper for method calls, called by
mono_marshal_get_native_wrapper? */
MonoMethod *
component_get_method (MonoMethod *method)

Not sure about the marshalling yet...

Thanks,
Jonathan


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jonathan
S. Chambers
Sent: Monday, November 14, 2005 10:06 PM
Cc: mono-devel-list@lists.ximian.com
Subject: [Mono-dev] COM Interop in Mono

Hello all,
 Here is a brief overview of some work involving COM Interop support
in mono. I'm sure I'm wrong on multiple things below, so feel free to
suggest/correct.


COM Standard

Don't feel like saying alot. Lots of docs available.


MS COM Interop

Again, well documented. Especially via '.NET and COM: The Complete
Interoperability Guide' by Adam Nathan. COM interop is twofold.

1. Managed Client, COM Server - This allows for unmanaged com components
to be used in the managed runtime. This occurs via 

Re: [Mono-dev] COM Interop in Mono

2005-11-16 Thread Kornél Pál

Hi,

The attached code looks promising.

I absolutely agree with you that any kind of ABI (including COM ABI) can be
implemented. The problem that I tried to point out is however that
implementing COM interop in Mono using an ABI that cannot be accessed by
compilers is useless. On Windows you can simply use COM ABI as a C++ object
because the compiler has support for that ABI. If you use the same ABI on
Linux for example without having a C++ compiler that supports the same ABI
you will not be able to use COM interop on that platform (unless you use
assembly code for example to produce the same calls).

So it's OK to implement COM ABI in Mono but do you have a compiler on the
other side of interop with support for the same ABI?

If you want to undersand MS.NET COM interop correctly you should look at
Mashal class. Methods and documentations as well. As I see all the
functionality suported by COM interop layer is available through Marshal
class as well that helps to understand it's infrastructure.

You mentioned in one of your previous messages that COM methods have HRESULT
return value. This is only optional. They can have any return type. When
using PreserveSigAttribute the original signature is used instead of using
HRESULT as return value and transofrming return value to parameter. This
means that there is no HRESULT - exception mapping done by the runtime.

You should have a look at
mcs/class/System.Drawing/System.Drawing/ComIStreamMarshaler.cs as well. This
is implemented in pure C# so Peter's work is somehow nearer to runtime level
but my work is more similar to MS.NET COM interop in it's behavior. There
are some differences like MS.NET uses the same QueryInterface, AddRef and
Release implementations and don't have to set out parameter when error is
returned in HRESULT but is very similar.

Also note that MS.NET COM interop has cross-AppDomain marshaling support
unlike delegate marshaling.

If you need help in undersanding COM interop infrastrucutre or a specific
functionality feel free to ask me.

Kornél

- Original Message -
From: Jonathan S. Chambers [EMAIL PROTECTED]
To: Kornél Pál [EMAIL PROTECTED]
Cc: mono-devel-list@lists.ximian.com
Sent: Wednesday, November 16, 2005 7:49 PM
Subject: RE: [Mono-dev] COM Interop in Mono


Attached is a diff of some current progress. These changes are all in place
right now, they would of course need moved to an external library.

Kornel, to answer your questions:

This is intended to be the beginning of a framework to leverage multiple
component technologies. COM Interop is well defined so I'm starting there.

COM is not necessarily Windows specific. It can be ported via tools (such as
those provided by Mainsoft) or on one's own if you follow the COM ABI
standard.

As for XPCOM, I know little about it. I've looked into it a little, and
while it may not have as well defined an ABI, there may still be hope for
it.

- Jonathan

-Original Message-
From: Kornél Pál [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 16, 2005 1:07 PM
To: Jonathan S. Chambers
Cc: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] COM Interop in Mono

Hi,

You are referencing something that you want to upload to SVN but did not
show it yet. What is it exactly?

Note that there were discussions about COM interop previously you should
look at them as well.

Some important things:

COM is Windows specific. If you want to use it you can use MS.NET instead of
Mono as relaying on COM interop is platform dependent. So there is no use to
implement COM interop only for use with Windows.

On the other hand COM interop could be implemented as a platform independent
object oriented P/Invoke-like layer that could be cool. But the problem is
that on Windows COM specifies a standard ABI (Application Binary Interface)
for representing COM objects that can be accessed by code compiled using
different compilers.

On other platforms (Linux for example) there is no standard ABI for objects,
only for classic C functions. This makes the things difficult. In addition
things like XPCOM assume that you use the same compiler on both sides of
interop so has no specific ABI, it depends on the C++ compiler you use.

Some people would like to implement COM interop as Bonobo interop in Mono
but these two layers are so much different that it cannot be done. Bonobo
interop has to be implemented separatedly as it requires different interop
attributes for example.

Kornél

- Original Message -
From: Jonathan S. Chambers [EMAIL PROTECTED]
To: Jonathan S. Chambers [EMAIL PROTECTED]
Cc: mono-devel-list@lists.ximian.com
Sent: Wednesday, November 16, 2005 5:50 PM
Subject: RE: [Mono-dev] COM Interop in Mono


Well, no one has responded yet, so here comes the next email ;-)

This work is coming along, so I'd like to get it in svn soon.

Would this go under the trunk, as in /trunk/cominterop or something like
that? If anyone has a better name, please suggest. Also, I think this
work will also be 

RE: [Mono-dev] COM Interop in Mono

2005-11-16 Thread Jonathan S. Chambers
Anyone have any advice about beginning to make this all an external library 
accessible to mono? Where does it go? How is mono aware of it/find it? How does 
mono load it/call methods, etc.

Thanks,
Jonathan

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jonathan S. 
Chambers
Sent: Wednesday, November 16, 2005 3:08 PM
To: Kornél Pál
Cc: mono-devel-list@lists.ximian.com
Subject: RE: [Mono-dev] COM Interop in Mono

Well, I am by no means an expert on ABIs of different compilers. But, I have 
built a small COM style object on linux using gcc, and have been able to use it 
from managed code with my own flavor of COM interop. Is that pure luck, I don't 
know? ;-)

I understand that much of the infrastructure of COM interop is exposed via the 
Marshal class. However, none of that functionality is currently implemented in 
mono. That is what I am trying to do.

COM methods don't have to return HRESULTS, but all that I am currently testing 
with does. I'll fix that assumption later.

As for the cross app domain marshalling and whatever wonderful features exist, 
I am not worried about that right now. If I can use a COM object in C# within a 
single threaded/app domain environment, I will be happy.

I have looked at your code in ComIStreamMarshaler (and Peter's in Win32Dnd). 
That was the source for what I did in previous attempts at COM Interop (see 
original email).

The code is ugly right now, but I would appreciate any help/advice as it moves 
forward.

Thanks,
Jonathan

-Original Message-
From: Kornél Pál [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 16, 2005 2:31 PM
To: Jonathan S. Chambers
Cc: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] COM Interop in Mono

Hi,

The attached code looks promising.

I absolutely agree with you that any kind of ABI (including COM ABI) can be
implemented. The problem that I tried to point out is however that
implementing COM interop in Mono using an ABI that cannot be accessed by
compilers is useless. On Windows you can simply use COM ABI as a C++ object
because the compiler has support for that ABI. If you use the same ABI on
Linux for example without having a C++ compiler that supports the same ABI
you will not be able to use COM interop on that platform (unless you use
assembly code for example to produce the same calls).

So it's OK to implement COM ABI in Mono but do you have a compiler on the
other side of interop with support for the same ABI?

If you want to undersand MS.NET COM interop correctly you should look at
Mashal class. Methods and documentations as well. As I see all the
functionality suported by COM interop layer is available through Marshal
class as well that helps to understand it's infrastructure.

You mentioned in one of your previous messages that COM methods have HRESULT
return value. This is only optional. They can have any return type. When
using PreserveSigAttribute the original signature is used instead of using
HRESULT as return value and transofrming return value to parameter. This
means that there is no HRESULT - exception mapping done by the runtime.

You should have a look at
mcs/class/System.Drawing/System.Drawing/ComIStreamMarshaler.cs as well. This
is implemented in pure C# so Peter's work is somehow nearer to runtime level
but my work is more similar to MS.NET COM interop in it's behavior. There
are some differences like MS.NET uses the same QueryInterface, AddRef and
Release implementations and don't have to set out parameter when error is
returned in HRESULT but is very similar.

Also note that MS.NET COM interop has cross-AppDomain marshaling support
unlike delegate marshaling.

If you need help in undersanding COM interop infrastrucutre or a specific
functionality feel free to ask me.

Kornél

- Original Message -
From: Jonathan S. Chambers [EMAIL PROTECTED]
To: Kornél Pál [EMAIL PROTECTED]
Cc: mono-devel-list@lists.ximian.com
Sent: Wednesday, November 16, 2005 7:49 PM
Subject: RE: [Mono-dev] COM Interop in Mono


Attached is a diff of some current progress. These changes are all in place
right now, they would of course need moved to an external library.

Kornel, to answer your questions:

This is intended to be the beginning of a framework to leverage multiple
component technologies. COM Interop is well defined so I'm starting there.

COM is not necessarily Windows specific. It can be ported via tools (such as
those provided by Mainsoft) or on one's own if you follow the COM ABI
standard.

As for XPCOM, I know little about it. I've looked into it a little, and
while it may not have as well defined an ABI, there may still be hope for
it.

- Jonathan

-Original Message-
From: Kornél Pál [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 16, 2005 1:07 PM
To: Jonathan S. Chambers
Cc: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] COM Interop in Mono

Hi,

You are referencing something that you want to upload to SVN but did not
show it yet. 

Re: [Mono-dev] XSP debugging

2005-11-16 Thread Marek Habersack
On Wed, Nov 16, 2005 at 11:00:05AM -0600, Carlos Solorzano scribbled:
 Whats the easiest way to do some debugging of XSP, is there a way to  
 turn on logs for XSP?
personally I use log4net (catches also Console.Write/WriteLine) with the
following config:

?xml version=1.0 encoding=utf-8 ?
log4net debug=false
appender name=LogFileAppender type=log4net.Appender.FileAppender 
file value=logs/app-log.txt /
appendToFile value=false /
layout type=log4net.Layout.PatternLayout
conversionPattern value=%date %-5level %logger - 
%message%newline /
/layout
/appender
appender name=HttpTraceAppender 
type=log4net.Appender.AspNetTraceAppender 
layout type=log4net.Layout.PatternLayout
conversionPattern value=%date %-5level %logger - 
%message%newline /
/layout
/appender
appender name=HttpTraceAppender 
type=log4net.Appender.AspNetTraceAppender 
layout type=log4net.Layout.PatternLayout
conversionPattern value=%date %-5level %logger - 
%message%newline /
/layout
/appender
root
level value=DEBUG /
appender-ref ref=ConsoleAppender /
appender-ref ref=LogFileAppender /
appender-ref ref=HttpTraceAppender /
/root
/log4net

And the following attribute somewhere in your main assembly:

[assembly: log4net.Config.XmlConfigurator(ConfigFileExtension=log4net, 
Watch=true)]

With this config, your log4net config file should be named 
YourMainAssembly.dll.log4net
and should be put in the root directory of your application.

You can get log4net from http://logging.apache.org/log4net/

hope that helps, regards

marek


signature.asc
Description: Digital signature
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] XSP Crash on binding empty dataview to MONO

2005-11-16 Thread Yogendra Thakur
Please see following bug.

http://bugzilla.ximian.com/show_bug.cgi?id=76732

If DataGrid control is binded with EmptyDataView and rebinded again it
crashes XSP.

See attached crash message and test page.

- Yogendra Thakur




TestGrid.aspx
Description: TestGrid.aspx
[EMAIL PROTECTED] test]# xsp
xsp
Listening on port: 8080 (non-secure)
Listening on address: 0.0.0.0
Root directory: /opt/test
Hit Return to stop the server.

=
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=

Stacktrace:

in 0x System.Web.UI.ControlCollection:Remove (System.Web.UI.Control)
in 0x26 System.Web.UI.ControlCollection:Remove (System.Web.UI.Control)
in 0x34 System.Web.UI.Control:AddedControl (System.Web.UI.Control,int)
in 0x91 System.Web.UI.ControlCollection:Add (System.Web.UI.Control)
in 0x229 System.Web.UI.WebControls.DataGrid:CreateControlHierarchy (bool)
in 0x95 System.Web.UI.WebControls.BaseDataList:DataBind ()
in 0x3f ASP.TestGrid_aspx:BindZeroRowData ()
in 0xa ASP.TestGrid_aspx:Button1_Click (object,System.EventArgs)
in 0x3591b6 (wrapper delegate-invoke) 
System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)
in 0x66 System.Web.UI.WebControls.Button:OnClick (System.EventArgs)
in 0x45 System.Web.UI.WebControls.Button:RaisePostBackEvent (string)
in 0xd 
System.Web.UI.WebControls.Button:System.Web.UI.IPostBackEventHandler.RaisePostBackEvent
 (string)
in 0x16 System.Web.UI.Page:RaisePostBackEvent 
(System.Web.UI.IPostBackEventHandler,string)
in 0x31 System.Web.UI.Page:RaisePostBackEvents ()
in 0x1ee System.Web.UI.Page:InternalProcessRequest ()
in 0xa1 System.Web.UI.Page:ProcessRequest (System.Web.HttpContext)
in 0x1068 Pipeline__1:MoveNext ()
in 0x1f System.Web.HttpApplication:Tick ()
in 0x3e System.Web.HttpApplication:Start (object)
in 0x68 
System.Web.HttpApplication:System.Web.IHttpAsyncHandler.BeginProcessRequest 
(System.Web.HttpContext,System.AsyncCallback,object)
in 0x1ab System.Web.HttpRuntime:RealProcessRequest (object)
in 0x2c System.Web.HttpRuntime:ProcessRequest (System.Web.HttpWorkerRequest)
in 0xa Mono.WebServer.MonoWorkerRequest:ProcessRequest ()
in 0x43 Mono.WebServer.BaseApplicationHost:ProcessRequest 
(Mono.WebServer.MonoWorkerRequest)
in 0x37f Mono.WebServer.XSPApplicationHost:ProcessRequest 
(int,long,int,long,int,string,string,string,string,byte[],string,intptr,Mono.WebServer.SslInformations)
in 0xfa6c (wrapper remoting-invoke-with-check) 
Mono.WebServer.XSPApplicationHost:ProcessRequest 
(int,long,int,long,int,string,string,string,string,byte[],string,intptr,Mono.WebServer.SslInformations)
in 0xfffee783 (wrapper xdomain-dispatch) 
Mono.WebServer.XSPApplicationHost:ProcessRequest 
(object,byte[],byte[],int,long,int,long,int,string,string,string,string,byte[],string)
in 0xfe85 (wrapper xdomain-invoke) 
Mono.WebServer.XSPApplicationHost:ProcessRequest 
(int,long,int,long,int,string,string,string,string,byte[],string,intptr,Mono.WebServer.SslInformations)
in 0x21976b (wrapper remoting-invoke-with-check) 
Mono.WebServer.XSPApplicationHost:ProcessRequest 
(int,long,int,long,int,string,string,string,string,byte[],string,intptr,Mono.WebServer.SslInformations)
in 0x563 Mono.WebServer.XSPWorker:InnerRun (object)
in 0x22 Mono.WebServer.XSPWorker:Run (object)
in 0xff95 (wrapper delegate-invoke) 
System.MulticastDelegate:invoke_void_object (object)
in 0x7ad806f (wrapper runtime-invoke) 
System.Object:runtime_invoke_void_object (object,intptr,intptr,intptr)

Native stacktrace:

/opt/mono-1.1.10/bin/mono(mono_handle_native_sigsegv+0xba) [0x81471da]
/opt/mono-1.1.10/bin/mono [0x81354cf]
/lib/tls/libpthread.so.0 [0x4068a0]
/lib/tls/libc.so.6(__libc_realloc+0xfb) [0x17970b]
/usr/lib/libglib-2.0.so.0(g_realloc+0x2a) [0xdb6c4c]
/opt/mono-1.1.10/bin/mono(mono_compile_create_var+0xcb) [0x8119d4b]
/opt/mono-1.1.10/bin/mono [0x8136b3d]
/opt/mono-1.1.10/bin/mono [0x811b9ed]
/opt/mono-1.1.10/bin/mono [0x8125517]
/opt/mono-1.1.10/bin/mono [0x81340ce]
/opt/mono-1.1.10/bin/mono [0x8134d7b]
/opt/mono-1.1.10/bin/mono [0x8135087]
/opt/mono-1.1.10/bin/mono [0x81350ba]
/opt/mono-1.1.10/bin/mono(mono_compile_method+0x3a) [0x80d2ada]
/opt/mono-1.1.10/bin/mono(mono_magic_trampoline+0x1a) [0x81484ca]
[0xf4e032]
[0x70b0dd]
[0x70af42]
[0x7b0dc2]
[0x7b0906]
[0x7d1718]
[0x7d16c3]
[0x47852a]
[0x7d169f]
[0x7d1366]
[0x7d1306]
[0x7d12ef]
[0x7d11da]
[0x70f657]
[0x70981a]
[0x477069]
[0x475040]
[0x46d44f]
[0x46d329]
[0x467864]
[0x467395]
[0x467353]
[0x4670bc]
[0x457658]
  

Re: [Mono-dev] XSP debugging

2005-11-16 Thread Carlos Solorzano
I use log4net as well in my code, however there are times when XSP  
quits taking in any new calls, I am guessing there is a bug in it but  
I can't even begin to file a bug report unless I figure out what  
causes it and when so I wanted to know if there is a way to turn on  
logs for XSP.

Thanks for the reply though,

--Carlos
On Nov 16, 2005, at 4:43 PM, Marek Habersack wrote:


On Wed, Nov 16, 2005 at 11:00:05AM -0600, Carlos Solorzano scribbled:

Whats the easiest way to do some debugging of XSP, is there a way to
turn on logs for XSP?
personally I use log4net (catches also Console.Write/WriteLine)  
with the

following config:

?xml version=1.0 encoding=utf-8 ?
log4net debug=false
appender name=LogFileAppender  
type=log4net.Appender.FileAppender 

file value=logs/app-log.txt /
appendToFile value=false /
layout type=log4net.Layout.PatternLayout
conversionPattern value=%date %-5level % 
logger - %message%newline /

/layout
/appender
appender name=HttpTraceAppender  
type=log4net.Appender.AspNetTraceAppender 

layout type=log4net.Layout.PatternLayout
conversionPattern value=%date %-5level % 
logger - %message%newline /

/layout
/appender
appender name=HttpTraceAppender  
type=log4net.Appender.AspNetTraceAppender 

layout type=log4net.Layout.PatternLayout
conversionPattern value=%date %-5level % 
logger - %message%newline /

/layout
/appender
root
level value=DEBUG /
appender-ref ref=ConsoleAppender /
appender-ref ref=LogFileAppender /
appender-ref ref=HttpTraceAppender /
/root
/log4net

And the following attribute somewhere in your main assembly:

[assembly: log4net.Config.XmlConfigurator 
(ConfigFileExtension=log4net, Watch=true)]


With this config, your log4net config file should be named  
YourMainAssembly.dll.log4net

and should be put in the root directory of your application.

You can get log4net from http://logging.apache.org/log4net/

hope that helps, regards

marek


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] how to improve mono performance

2005-11-16 Thread zhu shi song
Dear lists,
  I've got one test example and tested it using linux
mono and windows .NET on the same machine.  The
results showed that the performance of linux mono is
much bad than windows .NET. 
Linux Mono:
 ArrayList strings test.3311 ms
 StringBuilder test.4008 ms
 Integer  Floating ADD.15145 ms
 Exception test.621 ms
 Reflection and recursion...9421 ms
Windows .Net:
 ArrayList strings test.1109 ms
 StringBuilder test.1437 ms
 Integer  Floating ADD.2734 ms
 Exception test.4046 ms
 Reflection and recursion...5843 ms
Machine configuration:
 RAM: 512M DDR
 CPU: Intel C4 2.0G
OS:
 Windows 2003 Server .NET 1.1 Framework
 Fedora Core 4 with mono compiled from svn

Now I try to port my aspx web application to linux
mono from windows 2003 .net framework.  But regarding
of performance, I wonder whether it is deserved.
  Maybe I lack some tips to improve linux mono
performance.  If someone knows pls help me.
  tks
  zhu






__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.comusing System;
using System.Collections;
namespace TestNamespace
{
  public class TestClass
  {
static long ticks = 0;
public static void InitTicks()

{
  TestClass.ticks = DateTime.Now.Ticks;
}
public static void ShowTime(string str)
{
  long newTicks = DateTime.Now.Ticks;
  //milliseconds, not Microsoft :)
  double ms = (newTicks - TestClass.ticks) / TimeSpan.TicksPerMillisecond;
  Console.WriteLine({0}{1} ms, str.PadRight(35, '.'), ms);
  TestClass.ticks = DateTime.Now.Ticks;
}
public static void Test1()
{
  ArrayList a = new ArrayList();
  for(int i=0;i100;i++)
  {
string str = i.ToString();
a.Add(str);
  }
  ShowTime(ArrayList strings test);
  System.Text.StringBuilder strBuilder = new System.Text.StringBuilder();
  Random rnd = new Random();
  foreach(object strObj in a)
  {
strBuilder.Append(strObj as string);
strBuilder.Append(rnd.Next().ToString());
  }
  string s = strBuilder.ToString();
  if(s == Dsadasdasdsa)
  {
throw(new Exception(no way...));
  }
  ShowTime(StringBuilder test);
}
public static void Test2()
{
  int i = 0;
  double d = 0.0;
  for(i=0; i10; i++)
  {
d += i;
  }
  double d2 = d/2;
  ShowTime(Integer  Floating ADD);
}
public static void Test3()
{
  int i = 0;
  int sum = 0;
  for(i=0;i10;i++)
  {
try
{
  if(i is int)
  {
throw(new Exception(the i integer is an integer.. oh no...));
  }
}
catch(Exception ex)
{
  if(ex is NotImplementedException)
  {
Console.Write(who's responsable for this ?);
  }
}
  }
  int res = sum/2;
  if(res == -321)
throw(new Exception(this is odd));
  ShowTime(Exception test);
}
public static void Recursive(string str)
{
  string name = System.Reflection.MethodBase.GetCurrentMethod().Name;
  if(str.Substring(0, name.Length) == name)
  {
int i = Convert.ToInt32(str.Substring(name.Length));
if(i  1000)
{
  //  Console.Write(i.ToString()+\n);
  Recursive(name + (i+1).ToString());
}
  }
}
public static void Test4()
{
  for(int i=0;i1000;i++)
  {
Recursive(Recursive0);
  }
  ShowTime(Reflection and recursion);
}
public static void Main()
{
  InitTicks();
   

[Mono-dev] monodevelop with debugger can't start

2005-11-16 Thread zhu shi song
Dear lists,
I got monodevelop from svn and compiled it with
enable-debugger correctly.  But when I run it, there
are some errors:

2005-11-17 12:44:01,029 [-1208621376] ERROR
MonoDevelop.Core.ILoggingService [(null)] - Add-in
failed to load: SharpDevelop Core
2005-11-17 12:44:01,072 [-1208621376] ERROR
MonoDevelop.Core.ILoggingService [(null)] -
MonoDevelop.Core.AddIns.AddInLoadException: Missing id
attribute
in 0x00426 MonoDevelop.Core.AddIns.AddIn:Initialize
(System.String fileName)
in 0x00054
MonoDevelop.Core.AddIns.AddInTreeSingleton:InsertAddIn
(System.String addInFile)
2005-11-17 12:44:01,446 [-1208621376] ERROR
MonoDevelop.Core.ILoggingService [(null)] - Add-in
failed to load: MonoDevelop NUnit
2005-11-17 12:44:01,447 [-1208621376] ERROR
MonoDevelop.Core.ILoggingService [(null)] -
MonoDevelop.Core.AddIns.AddInLoadException: Missing id
attribute
in 0x00426 MonoDevelop.Core.AddIns.AddIn:Initialize
(System.String fileName)
in 0x00054
MonoDevelop.Core.AddIns.AddInTreeSingleton:InsertAddIn
(System.String addInFile)
2005-11-17 12:44:01,507 [-1208621376] ERROR
MonoDevelop.Core.ILoggingService [(null)] - Add-in
failed to load: New Editor
2005-11-17 12:44:01,508 [-1208621376] ERROR
MonoDevelop.Core.ILoggingService [(null)] -
MonoDevelop.Core.AddIns.AddInLoadException: Missing id
attribute
in 0x00426 MonoDevelop.Core.AddIns.AddIn:Initialize
(System.String fileName)
in 0x00054
MonoDevelop.Core.AddIns.AddInTreeSingleton:InsertAddIn
(System.String addInFile)
2005-11-17 12:44:01,802 [-1208621376] ERROR
MonoDevelop.Core.ILoggingService [(null)] - Add-in
failed to load: Java Language Binding
2005-11-17 12:44:01,802 [-1208621376] ERROR
MonoDevelop.Core.ILoggingService [(null)] -
MonoDevelop.Core.AddIns.AddInLoadException: Missing id
attribute
in 0x00426 MonoDevelop.Core.AddIns.AddIn:Initialize
(System.String fileName)
in 0x00054
MonoDevelop.Core.AddIns.AddInTreeSingleton:InsertAddIn
(System.String addInFile)
---
The error msgbox show details:
--
System.ArgumentException: The addin '' v is not
installed.
in 0x002f7
MonoDevelop.Core.AddIns.AddInService:ResolveLoadDependencies
(System.Collections.ArrayList addins,
System.Collections.Stack depCheck, System.String id,
System.String version)
in 0x0012d
MonoDevelop.Core.AddIns.AddInService:ResolveLoadDependencies
(System.Collections.ArrayList addins,
System.Collections.Stack depCheck, System.String id,
System.String version)
in 0x000a5
MonoDevelop.Core.AddIns.AddInService:PreloadAddin
(IProgressMonitor monitor, System.String id)
in 0x002b4
MonoDevelop.Core.AddIns.AddInService:PreloadAddins
(IProgressMonitor monitor, System.String[]
requestedExtensionPoints)
in 0x00680 MonoDevelop.Ide.Gui.IdeStartup:Run
(System.String[] args)
--

who know how to solve the problem? There is no
debugger I even can't program.

  tks
  zhu







__ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] how to improve mono performance

2005-11-16 Thread ted leslie



see mono options:

--aot  Compiles the assembly to native code

--optimize=OPT Turns on or off a specific optimization
   Use --list-opt to get a list of optimizations



MS might has similar so it might not mean much for comparisons, 
but can mean a lot just for your absolute runtimes on linux.

some of your times are very short, i.e. 1000ms
you might want to make them go longer (iterate) so as to eliminate what might
be an unfair startup requirement but i am guessing here. Maybe your timing is 
done
in the code and not just with a time mono .. off the shell.

I have done a couple of tests comparing optimized C# to optimized C (on linux)
and generally found C#/mono to be 33% slower then C which actually I 
was very happy to see it so close. Your tests are showing 300%!! average 
differences
to MS C#, so I am very surprized to see your results having such a difference :(
The integer/floating add test results  just blows me away, as i did a integer 
add comparison of
C# vs. C on linux and again that was only 33% difference. Its almost as if your 
floating point part was
done with out fpu (on linux) and done in the CPU fpu on Windows.

-tl


On Wed, 16 Nov 2005 20:30:23 -0800 (PST)
zhu shi song [EMAIL PROTECTED] wrote:

 Dear lists,
   I've got one test example and tested it using linux
 mono and windows .NET on the same machine.  The
 results showed that the performance of linux mono is
 much bad than windows .NET. 
 Linux Mono:
  ArrayList strings test.3311 ms
  StringBuilder test.4008 ms
  Integer  Floating ADD.15145 ms
  Exception test.621 ms
  Reflection and recursion...9421 ms
 Windows .Net:
  ArrayList strings test.1109 ms
  StringBuilder test.1437 ms
  Integer  Floating ADD.2734 ms
  Exception test.4046 ms
  Reflection and recursion...5843 ms
 Machine configuration:
  RAM: 512M DDR
  CPU: Intel C4 2.0G
 OS:
  Windows 2003 Server .NET 1.1 Framework
  Fedora Core 4 with mono compiled from svn
 
 Now I try to port my aspx web application to linux
 mono from windows 2003 .net framework.  But regarding
 of performance, I wonder whether it is deserved.
   Maybe I lack some tips to improve linux mono
 performance.  If someone knows pls help me.
   tks
   zhu
 
 
 
 
   
   
 __ 
 Yahoo! Mail - PC Magazine Editors' Choice 2005 
 http://mail.yahoo.com
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] how to improve mono performance

2005-11-16 Thread Christopher Bergström
On Wed, 16 Nov 2005 20:30:23 -0800 (PST)

zhu shi song [EMAIL PROTECTED] wrote:

  

Dear lists,
  I've got one test example and tested it using linux
mono and windows .NET on the same machine.  The
results showed that the performance of linux mono is
much bad than windows .NET. 


I'd like to try to reproduce this on one of my servers.  Can you make
the source available for download and or send to me offlist.  I'd like
to make sure this is reproducible before we make any final conclusions. 
I've traced and optimized my code and found that despite a few places
Mono is in _real_ time faster.  To this credit I add we do heavy caching
and so even IF, not sure how big that is, there is some upfront
difference between the two it can be worked around.

Cheers,

C.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] accessing file on a windows share

2005-11-16 Thread Buderya Roshan
 Buderya Roshan 11/17/05 12:25 PM 
 Buderya Roshan [EMAIL PROTECTED] 11/16/05 5:07 PM 
 Hi,
 
 I am trying to access a file on a remote share (Windows share with
full
 access to everyone). On windows using .net I can access and read the
 file as

 StreamReader sr = new
 StreamReader(@\\server_name\share_name\file_name);
 string line = sr.ReadLine();

 But when I compile  run the same under mono for windows, I get
 System.IO.DirectoryNotFoundException.  How do I specify the filepath
in
 mono? Also when this is running from Linux (Samba client setup) do I
 need to do something else?

Answering my own question, using mono on Linux, I figured (with some
help from the mono IRC channel) we need to use Gnome.Vfs library to
access remote shares. A URI of the form
smb://user:[EMAIL PROTECTED]/path_to_file/ should work.

Thanks,
Roshan
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list