Re: [Mono-list] Socket code.
On Sat, Feb 21, 2004 at 04:31:00PM -0800, George Farris wrote: I have some socket code that looks something like this: byte[] bytes = new byte[1448]; do { len = sock.Read(bytes, 0, (int)1448); s = Encoding.ASCII.GetString(bytes); buf.Append(s.Substring(0,len)); Shouldn't it be: s = Encoding.ASCII.GetString(bytes, 0, len); buf.Append(s); Passing some random junk (ergh.. does new byte[] clear memory?) to encodoer doesn't seem good idea. -- : Michal Moskal :: http://www.kernel.pl/~malekith :: GCS !tv h e+++ b++ : When in doubt, use brute force. -- Ken Thompson :: UL$ C++ E--- a? ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] IDE for mono/linux
El sáb, 21-02-2004 a las 14:55, Patrik Olterman escribió: If anyone is interested I have an IDE that is working ok called eZsharp its a simple editor with syntax highlighting and a compile and run fuction it can be downloaded with It doesn't work for me (I have installed the gtksourceview version of your svn): - ./eZsharp.exe ** (unknown:13301): WARNING **: Missing method Init in assembly ./eZsharp.exe typeref index 5 The application failed because: System.NullReferenceException: A null value was found where an object instance was required in (unmanaged) eZsharp.Hilite:.ctor () in 0x0002b eZsharp.App:Main (string[]) Unhandled Exception: System.NullReferenceException: A null value was found where an object instance was required in 0x00119 eZsharp.App:Main (string[]) - And I cannot compile (maybe the compilation needs something else): - mcs ezsharp.cs -r:System.Drawing -r:gdk-sharp -r:gtk-sharp -r:gtk-sharp -r:gtksourceview-sharp ezsharp.cs(86) error CS0103: The name `GtkSourceView.Init' could not be found in `eZsharp.Hilite' Compilation failed: 1 error(s), 0 warnings - Sergio. -- [aka Marble] Web Personalhttp://www.marblestation.com Registered LiNUX user #140941http://counter.li.org/ Socio #3274 de HispaLinuxhttp://www.hispalinux.es Miembro de GPL URVhttp://www.gplurv.org GnuPG key: 0x0ED2CF9Dhkp://pgp.escomposlinux.org signature.asc Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente
Re: [Mono-list] IDE for mono/linux
El sb, 21-02-2004 a las 15:33, Sergio Blanco Cuaresma escribi: El sb, 21-02-2004 a las 14:55, Patrik Olterman escribi: If anyone is interested I have an IDE that is working ok called eZsharp its a simple editor with syntax highlighting and a compile and run fuction it can be downloaded with It doesn't work for me (I have installed the gtksourceview version of your svn): Works fine for me. $ svn co http://www.olterman.se:8080/repos/mono $ cd mono/ezsharp $ ./ezsharp.exe you should run the ezsharp.exe (not eZ) -- Jonathan Hernndez aka jBilbo :: http://jhernandez.gplurv.org miembro del LUG GPLURV :: http://www.gplurv.org Linux User #280862 :: http://counter.li.org/ GnuPG key ID: 348EAC17 :: pgp.escomposlinux.org signature.asc Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente
[Mono-list] monodoc missing docs + Monodevelop question
Hi, I have mono, mcs, gtk-sharp and monodoc from CVS, all compile fine, and can be used. I still have two small problems: * monodoc: everything compiles fine, and monodoc works but the documentation for some assemblies is now missing, like the Gnome subtree in the docs. Normally, just compiling and installing was sufficient to get the complete reference. * Compiling MonoDevelop I get: ./Dock/Docker.cs(14) error CS0246: Cannot find type `GtkSharp.ExposeEventArgs' ./Tree/TreeView.cs(67) error CS0246: Cannot find type `GtkSharp.EditedArgs' ./Tree/TreeView.cs(249) error CS0246: Cannot find type `GtkSharp.TestExpandRowArgs' While I think GtkSharp.ExposedEventArgs, EditedArgs and TestExpandRowArgs code is included and public accessible from within gtk-sharp.dll. Kris -- Kris Luyten uiml.net: http://lumumba.luc.ac.be/kris/projects/uiml.net/ ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Socket code.
On Sun, 2004-02-22 at 01:17, Michal Moskal wrote: On Sat, Feb 21, 2004 at 04:31:00PM -0800, George Farris wrote: I have some socket code that looks something like this: byte[] bytes = new byte[1448]; do { len = sock.Read(bytes, 0, (int)1448); s = Encoding.ASCII.GetString(bytes); buf.Append(s.Substring(0,len)); Shouldn't it be: s = Encoding.ASCII.GetString(bytes, 0, len); buf.Append(s); Well the docs on GetString say it can be just a byte[]. The interesting thing is the length which only works as 1448 which is a number I found by printing out the len variable. If I set the byte[] to say 1, sock.read (which should really be named stream.read as it's a NetworkStream) always returns anywhere from 0 to 1448 bytes but never more. I also tried the example from the .NET docs and it doesn't work either. It reads up to 1448 bytes and the stops. The code is here: http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemnetsocketsnetworkstreamclassreadtopic.asp?frame=true -- George Farris [EMAIL PROTECTED] ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] Re: [Mono-devel-list] Regression: Attribute.GetCustomAttribute nolonger returns attributes from base classes
El dom, 22-02-2004 a las 19:28, Gert Driesen escribió: Its working fine again, thanks a lot !!! Is there a test in mono cvs that will detect this issue in the future, or do you want me to rewrite my test case to use NUNit ? Jackson told me that was the cause of some NUnit regressions. I'll check if there's a test exactly like this and add it if not present. Thanks. -Gonzalo ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Socket code.
Below... On Sun, 2004-02-22 at 13:06, George Farris wrote: snip/ Shouldn't it be: s = Encoding.ASCII.GetString(bytes, 0, len); buf.Append(s); Well the docs on GetString say it can be just a byte[]. Yes, GetString(byte[]) exists, but it's equivalent to this: string GetString (byte[] bytes) { return GetString (bytes, 0, bytes.Length); } So this is only valid if `bytes' is full. Otherwise (when you've read fewer than `bytes.Length' bytes) the end of your string will contain garbage data. The `GetString (bytes, 0, len)' fixes this, so GetString will only convert valid data. - Jon ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Socket code.
Right, I did go and read up on GetString and you are of course correct. On Sun, 2004-02-22 at 10:51, Jonathan Pryor wrote: Below... On Sun, 2004-02-22 at 13:06, George Farris wrote: snip/ Shouldn't it be: s = Encoding.ASCII.GetString(bytes, 0, len); buf.Append(s); Well the docs on GetString say it can be just a byte[]. Yes, GetString(byte[]) exists, but it's equivalent to this: string GetString (byte[] bytes) { return GetString (bytes, 0, bytes.Length); } So this is only valid if `bytes' is full. Otherwise (when you've read fewer than `bytes.Length' bytes) the end of your string will contain garbage data. The `GetString (bytes, 0, len)' fixes this, so GetString will only convert valid data. - Jon -- George Farris [EMAIL PROTECTED] ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Gdk: Text drawing on pixmap
Hello, I have an application that draws rectangles, lines, etc on a pixmap. The Gdk.Pixmap class is ideally suited for that purpose, as it has methods for drawing lines, rectangles, images on the pixmap. Now I also need to draw text on the image. Pixmap however does not have a method for drawing text, so is there possibly another way I can get text on the pixmap? Look at the mlist source code (on the Gtk# wiki), it shows how to do this. Or the list.cs widget in monodoc, that is another example. ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
RE: [Mono-list] Docs as plain HTML
Do you or anyone have a monodoc.dll for windows? I could try to create a SWF app. I say try because I've written more GTK# apps than SWF. Monodoc really does not have any strange dependencies, so it should work just fine on Gtk#/Windows. ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] To draw or not to draw that is the question :)
Hello, I've explored GTK and I saw that drawing in Gtk.DrawingArea involves using Gdk.Drawable which in turn requires learning some of Pango (?)... I guess Pango implements what I think it is the functionality of System.Drawing, no? Gdk implements the drawing primitives, it is fairly low-level. Pango is a text-setting facility that you can use to render. Now, I'am confused what library I should use to draw... Should I use System.Windows.Forms (with Mono-wine or something?) or should I use GTK and use that Pango thing? Gdk for now. I have a patch that lets you use Cairo (it was posted to the gtk-sharp-list) to draw, which is simpler to use than Gdk. In the future we will integrate System.Drawing and/or Cairo into Gtk# so it will be a familiar API. I dont know what is being made in this direction so I dont know what to do Another question is what should I use to do image manipulation (resize, chopping, do thumbnails, etc) in a server (in ASP.NET for example) without installing the whole X package ? Work is underway to have a complete System.Drawing implementation. CVS should let you do this. Miguel. ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Bug related to operator += and instance fields
On 02/21/04 Rodolfo Campero wrote: public void Test () { A a = new A (); // the following is the problematic line _intValue += a.Value + a.Value / 2; [...] The actual result is 50 but I think it should be 150. This is fixed in cvs. Thanks for the report. lupus -- - [EMAIL PROTECTED] debian/rules [EMAIL PROTECTED] Monkeys do it better ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] C# Hexadecimal Escape Char Anomalies???
I realize this is a C# issue but can one create binary strings in C# using string=\xff\x00\x00\xff used by C/Python? Why do my 0xff's get translated to 0x3f's??? Thanks - mdf = using System; class SimpleTest { public static void Main(String[] args) { String bobo = \xFF\xFF; System.Console.Write(bobo); } } bash-2.05a$ mono simple.exe | od -x 000 3f3f 002 bash-2.05a$ cat pypy test=\xff\xff\xff\xff print test bash-2.05a$ python pypy | od -h 000 000a 005 -- | Matthew Franz [EMAIL PROTECTED] | | http://www.io.com/~mdfranz | ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Bug related to operator += and instance fields
Hello, Bug is filed at http://bugzilla.ximian.com/show_bug.cgi?id=54742 Thanks -Ravindra Rodolfo Campero [EMAIL PROTECTED] 2/22/2004 2:51:34 AM Hello everybody, I've found a bug, but I'm not sure about how to report it (I mean I can't find a suitable subject and other info): The following source code compiles but its execution results in incorrect behavior: code using System; namespace Test { public class A { public static void Main () { A a = new A (); a.Test (); } public void Test () { A a = new A (); // the following is the problematic line _intValue += a.Value + a.Value / 2; Console.WriteLine (_intValue); } private int _intValue; public readonly int Value = 100; } } /code The actual result is 50 but I think it should be 150. I need someone to give me instructions about the affected product (Mono/Compilers or Mono/Runtime or ...) and a suitable subject if possible, or to tell me that this is not a bug and I'm plain wrong :-) If someone can file the bug report for me it's ok too. TIA, Rodolfo _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list