Re: [Mono-dev] [PATCH] Mono DTrace provider
Hi, Am 29.05.2008 um 03:48 schrieb Joachim Ante: What is this patch capable of at the moment. Can I do managed code performance profiling with it by using Apple's Instruments tools? Or does this require adding specific probes for performance profiling. At the moment, this patch adds some very basic probes to the runtime itself. It aims at tracing runtime performance for one thing, and at tracing GC occurrences for another (if I understood the code correctly). Next on my list would be tracing JIT method compilation. It does not tackle managed code tracing yet. That would be possible but most likely requires changes to the JIT itself, I assume by emitting a call to an unmanaged helper function with appropriate arguments. I've never used Instruments (or Chime or the NetBeans plug-in), but I assume that providing it the .d file you should be able to profile the runtime performance as far as probes have been added. Regards, Andreas ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] [PATCH] Mono DTrace provider
Am 29.05.2008 um 03:48 schrieb Joachim Ante: On my TODO list still is testing this on Solaris 10 i86/amd64. Solaris 10 will likely have an older version of DTrace, and in the worst case it doesn't support generating a header file. I checked that Solaris 10 5/08 has DTrace 1.3 and does support the feature (not yet fully tested). According to their (not up-to-date) Change Log [1], it would not be present in Solaris 10 7/05 though and possibly not in 6/06. From my previous attempt I believe 8/07 does have it. Can we assume that Solaris users will have a reasonably updated system? That would greatly simplify matters. Update: I've prepared a dtrace-prelink.sh.in shell script yesterday that appeared to do the right thing for pedump in a dry run on OSX (which does not need it for lack of dtrace -G). To be updated to use $ {AR} and to be tested for an actual (Open)Solaris build. Andreas [1] http://opensolaris.org/os/community/dtrace/ChangeLog/ ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] ResourceReader patch
For full no-allocation behaviour :-) the IList passed to LoadResourceValues needs to be typed as its real Generic type, otherwise ResourceCacheItem is boxed on store.Add. Don't know how often that operation occurs... Andy e.g. [[ Index: ResourceReader.cs === --- ResourceReader.cs (revision 104379) +++ ResourceReader.cs (working copy) @@ -409,7 +409,11 @@ return obj; } +#if NET_2_0 + void LoadResourceValues (IListResourceCacheItem store) +#else void LoadResourceValues (IList store) +#endif { ResourceInfo ri; ResourceCacheItem rci; ]] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marek Habersack Sent: 28 May 2008 22:36 To: mono-devel-list@lists.ximian.com Subject: Re: [Mono-dev] ResourceReader patch -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, 28 May 2008 10:21:19 +0200 Andreas Nahr [EMAIL PROTECTED] wrote: Is there any reason for not using structs? No sense in needlessly torturing the GC ;) Makes sense - applied in r104334, thanks! marek -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.4-svn0 (GNU/Linux) iD8DBQFIPdA1q3909GIf5uoRAlsvAJ98jcbhTtuNUudBHybCR4xBCD3k1QCfYngI Qougwstb8DzXROt6uTn7aHc= =Gris -END PGP SIGNATURE- ___ 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] [Patch] Fix for leak in List`1, optimization for ArrayList
Hello, Attached you'll find two patches: * a fix for a memory leak in List`1 * a tiny optimization for ArrayList (inspired by code in List`1) ChangeLog entries are included and all corlib unit tests pass. Please review. - Juraj Index: ChangeLog === --- ChangeLog (revision 104226) +++ ChangeLog (working copy) @@ -1,3 +1,7 @@ +2008-05-29 Juraj Skripsky [EMAIL PROTECTED] + + * ArrayList.cs: Create the empty array only once and reuse it. + 2008-05-23 Miguel de Icaza [EMAIL PROTECTED] * Hashtable.cs: Implement a faster clone that does not use an Index: ArrayList.cs === --- ArrayList.cs (revision 104226) +++ ArrayList.cs (working copy) @@ -2515,6 +2515,8 @@ /// Total number of state changes. /// /summary private int _version; + + private static readonly object [] EmptyArray = new object [0]; #endregion @@ -2527,7 +2529,7 @@ public ArrayList() { #if NET_2_0 - _items = new object[0]; + _items = EmptyArray; #else _items = new object[DefaultInitialCapacity]; #endif Index: List.cs === --- List.cs (revision 104226) +++ List.cs (working copy) @@ -405,6 +405,9 @@ Array.Copy (_items, start, _items, start + delta, _size - start); _size += delta; + + if (delta 0) +Array.Clear (_items, _size, -delta); } void CheckIndex (int index) @@ -519,6 +522,7 @@ if (!match(_items[j])) _items[i++] = _items[j]; } + Array.Clear (_items, i, j - i); _size = i; return (j - i); Index: ChangeLog === --- ChangeLog (revision 104226) +++ ChangeLog (working copy) @@ -1,3 +1,8 @@ +2008-05-29 Juraj Skripsky [EMAIL PROTECTED] + + * List.cs (RemoveAll, Shift): Fix leak by clearing empty array + items. + 2008-04-29 Juraj Skripsky [EMAIL PROTECTED] * Dictionary.cs (Clear, Remove): Clear empty slots in keySlots ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] [Patch] Fix for leak in List`1, optimization for ArrayList
Hi, This looks ok to check in. Although I would add a if (j -i 0) before the Array.Clear () call RemoveAll (). Zoltan 2008/5/29 Juraj Skripsky [EMAIL PROTECTED]: Hello, Attached you'll find two patches: * a fix for a memory leak in List`1 * a tiny optimization for ArrayList (inspired by code in List`1) ChangeLog entries are included and all corlib unit tests pass. Please review. - Juraj ___ 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] gstreamer-sharp Question
Aaron, Did you build this binding manually, or did you use gapi2? Mike, Is there any reason why gapi2 wouldn't work on gstreamer? [EMAIL PROTECTED]:/usr/src/tar/gstreamer-0.10.19$ grep -l GObject gst/*.h gst/gstinfo.h gst/gstobject.h gst/gstpluginfeature.h gst/gstregistry.h gst/gstutils.h Cheers, C.J. On Wed, 2008-05-07 at 15:05 +0300, StApostol wrote: I found that yesterday, tucked away under branches/[Aaron's last name]/gstreamer-sharp or somesuch. Sadly, it targets gstreamer 0.8 and it's way too incomplete to be in any useful state. The code in Banshee looks like an evolved version of this branch, and is much more interesting. It would be especially nice if it was available as a standalone library, and I'm thinking to make an effort when I can find some time. On 5/7/08, Miguel de Icaza [EMAIL PROTECTED] wrote: hello, Aaron has a branch somewhere that has *some* code for GStreamer# worked on, but he has never published it as it is far from complete. It is somewhere on SVN, but I can no longer remember where its tucked in. On Mon, 2008-05-05 at 21:58 -0500, Jonathan Thomas wrote: I am very interested in using the gstreamer bindings in a mono project, but I could really use some advice. I can't seem to find the gstreamer-sharp assembly anywhere. The only luck I've had so far is some development notes back in 2006. Do any mono up-to-date bindings exist for the gstreamer framework? Is there a better multi-media framework I should use? Ultimately, I would like to create a non-linear video editing application using C# and the mono framework. I have been told that gstreamer is the most powerful media framework in linux (at least that's what I was told). Thanks in advance! -Jonathan ___ 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-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list signature.asc Description: This is a digitally signed message part ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] ValueTypes and mono_runtime_invoke
I have wrapped a function which returns a DateTime and call it using mono_runtime_invoke. This is a static method, so I don't pass in NULL for the object and parameters, and get a MonoObject* back. My understanding is that this MonoObject* should be a boxed DateTime. When I attempt to use this DateTime (e.g. by calling ToString() on it) it appears to be a clean MonoObject, but it contains a value very close to the default value for DateTime, namely 1/1/0001 12:00:04 AM. This suggests it has been lost somewhere between the underlying function call and the result of mono_runtime_invoke. In cases of functions which return primitive ValueTypes, there is no problem, e.g. int marshaled_ret_val = *reinterpret_castint*(mono_object_unbox(ret_val)); I am happy to carry around a boxed version of the ValueType (DateTime) as I have to box it to call functions on it anyway through the embedding API. Any ideas? Many thanks Sebastian Good ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] ValueTypes and mono_runtime_invoke
Sebastian Good wrote: I have wrapped a function which returns a DateTime and call it using mono_runtime_invoke. This is a static method, so I don't pass in NULL for the object and parameters, and get a MonoObject* back. My understanding is I don't pass in NULL the object and parameters does not make sense as you must pass NULL in this case. that this MonoObject* should be a boxed DateTime. When I attempt to use this DateTime (e.g. by calling ToString() on it) it appears to be a clean MonoObject, but it contains a value very close to the default value for DateTime, namely 1/1/0001 12:00:04 AM. This suggests it has been lost somewhere between the underlying function call and the result of mono_runtime_invoke. In cases of functions which return primitive ValueTypes, there is no problem, e.g. int marshaled_ret_val = *reinterpret_castint*(mono_object_unbox(ret_val)); I am happy to carry around a boxed version of the ValueType (DateTime) as I have to box it to call functions on it anyway through the embedding API. Any ideas? Returning boxed valuetypes is usually working as expected. Please show some code (C++ and C#). Robert ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-list] SignedXML: Where does the digest come from
Hy! I am creating a signed xml document using: XmlDocument objdoc=new XmlDocument(); objdoc.Load(test.xhtml); DataObject dObj=new DataObject(); dObj.Id=xmldsig-dataobj; dObj.Data=objdoc.ChildNodes; Reference dRef=new Reference(#xmldsig-dataobj); SignedXml xmlsig=new SignedXml(); xmlsig.AddObject(dObj); xmlsig.AddReference(dRef); RSA rsa=new RSASignatureCard(SigCard); KeyInfo keyinfo=new KeyInfo(); keyinfo.AddClause(new RSAKeyValue(rsa)); xmlsig.KeyInfo=keyinfo; xmlsig.SigningKey=rsa; xmlsig.ComputeSignature(); (RSASignatureCard is a self-written class derived from RSA which uses a smartcard) This works fine, the signature can be calculated and is also verified correctly. But if I look at the data that has actually been signed via rsa.EncryptValue(xmlsig.Signature.SignatureValue); the digest that can be found there is different from the one residing in sigref=xmlsig.Signature.SignedInfo.References[0] as Reference; sigref.DigestValue; Weird, isn't it? cheers Mathias ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] SignedXML: Where does the digest come from
Hello Mathias, On Thu, 2008-05-29 at 11:16 +0200, Mathias Tausig wrote: Hy! I am creating a signed xml document using: XmlDocument objdoc=new XmlDocument(); objdoc.Load(test.xhtml); DataObject dObj=new DataObject(); dObj.Id=xmldsig-dataobj; dObj.Data=objdoc.ChildNodes; Reference dRef=new Reference(#xmldsig-dataobj); SignedXml xmlsig=new SignedXml(); xmlsig.AddObject(dObj); xmlsig.AddReference(dRef); RSA rsa=new RSASignatureCard(SigCard); KeyInfo keyinfo=new KeyInfo(); keyinfo.AddClause(new RSAKeyValue(rsa)); xmlsig.KeyInfo=keyinfo; xmlsig.SigningKey=rsa; xmlsig.ComputeSignature(); (RSASignatureCard is a self-written class derived from RSA which uses a smartcard) Pretty cool :-) The model always allowed this (expect that fx 1.x made it harder with some bugs) but still it's pretty rare to find someone using it. This works fine, the signature can be calculated and is also verified correctly. But if I look at the data that has actually been signed via rsa.EncryptValue(xmlsig.Signature.SignatureValue); the digest that can be found there is different from the one residing in sigref=xmlsig.Signature.SignedInfo.References[0] as Reference; sigref.DigestValue; Weird, isn't it? It's been years since I looked into xmldsig (and I've been trying, hard, to reclaim those neurons for other duties ;-) but IIRC each reference is digested then the header, including all the references digest, is digested too. Only the later, not part of the XML itself, is signed. Of course the perfect answer is in the specification itself... Sebastien cheers Mathias ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] Mono Success Story!
I just wanted to write Miguel et. al and thank everyone for the amazing product that is Mono! My company, Obtuse Software, recently rolled out their online store which is 100% powered by Mono (you can see the Mono badge proudly displayed at the bottom of every page). Some key points about the site and its Mono utilization: o PostgreSQL database backend connected by Npgsql. o Webforms authentication with various Web.config locations. o Logging via log4net. o Google Checkout integration using the Google Checkout .Net API. o The purchased software is built on-the-fly by kicking off an external NAnt build process. NAnt builds both a license assembly and the NSIS Windows installer. The whole system is all Linux (CentOS) / all awesomeness. This is my first production use of Mono and it has been a great joy. Mono's ASP.NET has been greatly improved since my last failing attempt at a Mono site (somewhere back around Mono 1.1.x). Mono sensing updates to assemblies, .aspx files, and the Web.config is a big help. Now, of course, the entire experience wasn't w/o problems: o log4net's config doesn't work when embedded into the Web.config file. I had to use a separate config file and use log4net's XmlConfigurator.Configure(FileInfo pathToConfig) o It's difficult to predict the root directory of the webapp. I'm using Mono's ASP.NET auto-configuration so I *think* what happens is Mono configures the ~ path (as in, Server.MapPath(~)) relative to the first .aspx page that's loaded. But I probably can just fix this by specifically configuring the webapp in the Apache config file. o We're using https for our site and have found that Mono cannot handle loading the same webpage using both http:// and https:// For example, if I load http://www.mysite.com/default.aspx, and then later https://www.mysite.com/default.aspx , it barfs. It looks like it stays configured to whatever was first loaded (if http first, then only http works / if https first, then only https works). Now this is also not a big deal since I just need to stratify the webapp into separate http and https pieces and use Apache to setup different VirtualHosts. o Mono doesn't let you change around the .aspx page on-the-fly like MS ASP.NET does. For example, if you have a button with an OnClick method like: asp:Button id=fooButton OnClick=FooClick runat=server / you cannot remove the OnClick attribute w/o recompiling on Mono, MS you can. o Had to use the deprecated ServicePointManager.CertificatePolicy method for SSL communication with Google. Mono does not yet implement the newer method using ServerCertificateValidationCallback. Other than these few small hindrances, Mono worked great. Thank you, again, for such a quality product! -Abe PS - If you're interested in what Obtuse Software does, you can checkout the press release here: http://www.obtusesoft.com/pr.html zigGIS (Obtuse Software's inaugural product) is an Open Source GIS extension to ESRI ArcMap. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] SignedXML: Where does the digest come from
Don't know whether this MSDN Magazine article is of any help http://msdn.microsoft.com/en-us/magazine/cc185723.aspx Andy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sebastien Pouliot Sent: 29 May 2008 12:56 To: Mathias Tausig Cc: Mono-list@lists.ximian.com Subject: Re: [Mono-list] SignedXML: Where does the digest come from Hello Mathias, On Thu, 2008-05-29 at 11:16 +0200, Mathias Tausig wrote: Hy! I am creating a signed xml document using: XmlDocument objdoc=new XmlDocument(); objdoc.Load(test.xhtml); DataObject dObj=new DataObject(); dObj.Id=xmldsig-dataobj; dObj.Data=objdoc.ChildNodes; Reference dRef=new Reference(#xmldsig-dataobj); SignedXml xmlsig=new SignedXml(); xmlsig.AddObject(dObj); xmlsig.AddReference(dRef); RSA rsa=new RSASignatureCard(SigCard); KeyInfo keyinfo=new KeyInfo(); keyinfo.AddClause(new RSAKeyValue(rsa)); xmlsig.KeyInfo=keyinfo; xmlsig.SigningKey=rsa; xmlsig.ComputeSignature(); (RSASignatureCard is a self-written class derived from RSA which uses a smartcard) Pretty cool :-) The model always allowed this (expect that fx 1.x made it harder with some bugs) but still it's pretty rare to find someone using it. This works fine, the signature can be calculated and is also verified correctly. But if I look at the data that has actually been signed via rsa.EncryptValue(xmlsig.Signature.SignatureValue); the digest that can be found there is different from the one residing in sigref=xmlsig.Signature.SignedInfo.References[0] as Reference; sigref.DigestValue; Weird, isn't it? It's been years since I looked into xmldsig (and I've been trying, hard, to reclaim those neurons for other duties ;-) but IIRC each reference is digested then the header, including all the references digest, is digested too. Only the later, not part of the XML itself, is signed. Of course the perfect answer is in the specification itself... Sebastien cheers Mathias ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] n00b question C# on osx
On Wed, May 21, 2008 at 1:30 PM, crash893 [EMAIL PROTECTED] wrote: 2)i installed shart developer and compiled the apps again agenst the mono 1.0 and mono 2.0 librarys. Still not working Best. Typo. Ever. -- Chris Howie http://www.chrishowie.com http://en.wikipedia.org/wiki/User:Crazycomputers ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] FontSize on PdfSurface
Ok but, if your goal is to produce a pdf file, you could still use GtkPrint. It also have the advantage of being available on the Windows port of gtk-sharp where PdfSurface is not (I don't known if this is still true, but it was a couple months ago). To produce a PDF with GtkPrint, simply do something like : PrintOperation print = new PrintOperation(); print.BeginPrint += BeginPrint; print.DrawPage += DrawPage; print.ExportFilename = /path_to_your_file.pdf; print.Run(PrintOperationAction.Export, null); I have tried to directly use a PdfSurface but i change my mind when I was unable to run my applications on Windows. Your initial question was about font size problem. I think that using the Cairo.Context provided by GtkPrint is probably better because the context object is probably properly initialized (I'm guessing here...) and I have no font size problem with that. One more advantage of GtkPrint : You will be able send your drawing directly to a printer with very little modification if you have to. David Le mercredi 28 mai 2008 à 10:41 +0200, Elmar Haneke a écrit : I personally use something like this : [...] Pango.Layout layout = printContext.CreatePangoLayout(); layout.FontDescription = Pango.FontDescription.FromString(Times New Roman 10); I'm not using Gtk Printing. See sample attached. In the resulting PDF the fontsize is not correct. Elmar ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] Linux Shell Commands in C#
Hello guys, I am wondering if there is a way to do system calls in Unix using Mono C#. I am trying to use *System.Diagnostics.Process.Start(/home/tester/myscript.sh)*; but it seems not to work. I hope you can help me. Thanks Regards, Hybrid ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list