Re: [Mono-list] Mono installer and Ubuntu AMD64
Hi :) You could get the tarball, compile it and install it yourself. It's not that hard. Consider this URL: http://www.mono-project.com/Compiling_Mono You will also need the ubuntu package "build-essential" i.e. following command: sudo apt-get install build-essential taken from Ubunutu Starter Guide (http://ubuntuguide.org/) Enjoy :) Daniel Lopez wrote: Hello The installer is a 32bit binary. Other people have experienced sucess running it on 64bit platforms, but I believe they also had installed 32bit support. As a workaround, I suggest installing on regular Linux distribution and then packing it, copy it to the 64 machine and unpack in the same directory. At Bitrock, we are currently looking at porting the installer to 64bit Linux (anybody from AMD/Intel wants to donate some hardware? wink, wink ;) It may take some weeks, as getting OSX out the door is our priority right now (which will happen before LinuxWorld, or else our bizdev person has promised us a very painful and slow death and you know these people, they have way too much free time ;) Chers Daniel On Mon, Aug 01, 2005 at 03:49:22PM +0200, Vincent Arnoux wrote: Hi all, I am running Ubuntu64. I downloaded mono-1.1.8.3_0-installer.bin, chmoded it, but when I try to execute I get the following error: [EMAIL PROTECTED]:~/Mono$ ./mono-1.1.8.3_0-installer.bin (main.tcl:11621): Gdk-WARNING **: locale not supported by Xlib (main.tcl:11621): Gdk-WARNING **: can not set locale modifiers (main.tcl:11621): Gdk-WARNING **: Error converting from UTF-8 to STRING: Conversion from character set 'UTF-8' to 'ISO-8859-1' is not supported (main.tcl:11621): Gdk-WARNING **: Error converting from UTF-8 to STRING: Conversion from character set 'UTF-8' to 'ISO-8859-1' is not supported ** (main.tcl:11621): WARNING **: /usr/lib/pango/1.4.0/modules/pango-basic-fc.so: cannot open shared object file: No such file or directory Failed to load Pango module for id: 'BasicScriptEngineFc' ** (main.tcl:11621): WARNING **: /usr/lib/pango/1.4.0/modules/pango-basic-fc.so: cannot open shared object file: No such file or directory Failed to load Pango module for id: 'BasicScriptEngineFc' ** (main.tcl:11621): WARNING **: /usr/lib/pango/1.4.0/modules/pango-basic-fc.so: cannot open shared object file: No such file or directory Failed to load Pango module for id: 'BasicScriptEngineFc' (main.tcl:11621): GLib-GObject-CRITICAL **: file gobject.c: line 1561 (g_object_ref): assertion `G_IS_OBJECT (object)' failed ** (main.tcl:11621): CRITICAL **: file pango-engine.c: line 68 (_pango_engine_shape_shape): assertion `PANGO_IS_FONT (font)' failed ** ERROR **: file shape.c: line 75 (pango_shape): assertion failed: (glyphs->num_glyphs > 0) aborting... Abandon Does anyone know how to solve this ? Vincent ___ 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 -- Emil R. Emilov --- mailto:[EMAIL PROTECTED] http://www.emilov.de ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Mono installer and Ubuntu AMD64
Oops, I must have pressed the wrong "reply" button ;) I meant to give Vincent a tip on how to get it working without an installer. Daniel Lopez wrote: Er... I was talking about porting the installer, not Mono :) On Mon, Aug 01, 2005 at 07:07:32PM +0200, Emil Emilov wrote: Hi :) You could get the tarball, compile it and install it yourself. It's not that hard. Consider this URL: http://www.mono-project.com/Compiling_Mono You will also need the ubuntu package "build-essential" i.e. following command: sudo apt-get install build-essential taken from Ubunutu Starter Guide (http://ubuntuguide.org/) Enjoy :) Daniel Lopez wrote: Hello The installer is a 32bit binary. Other people have experienced sucess running it on 64bit platforms, but I believe they also had installed 32bit support. As a workaround, I suggest installing on regular Linux distribution and then packing it, copy it to the 64 machine and unpack in the same directory. At Bitrock, we are currently looking at porting the installer to 64bit Linux (anybody from AMD/Intel wants to donate some hardware? wink, wink ;) It may take some weeks, as getting OSX out the door is our priority right now (which will happen before LinuxWorld, or else our bizdev person has promised us a very painful and slow death and you know these people, they have way too much free time ;) Chers Daniel On Mon, Aug 01, 2005 at 03:49:22PM +0200, Vincent Arnoux wrote: Hi all, I am running Ubuntu64. I downloaded mono-1.1.8.3_0-installer.bin, chmoded it, but when I try to execute I get the following error: [EMAIL PROTECTED]:~/Mono$ ./mono-1.1.8.3_0-installer.bin (main.tcl:11621): Gdk-WARNING **: locale not supported by Xlib (main.tcl:11621): Gdk-WARNING **: can not set locale modifiers (main.tcl:11621): Gdk-WARNING **: Error converting from UTF-8 to STRING: Conversion from character set 'UTF-8' to 'ISO-8859-1' is not supported (main.tcl:11621): Gdk-WARNING **: Error converting from UTF-8 to STRING: Conversion from character set 'UTF-8' to 'ISO-8859-1' is not supported ** (main.tcl:11621): WARNING **: /usr/lib/pango/1.4.0/modules/pango-basic-fc.so: cannot open shared object file: No such file or directory Failed to load Pango module for id: 'BasicScriptEngineFc' ** (main.tcl:11621): WARNING **: /usr/lib/pango/1.4.0/modules/pango-basic-fc.so: cannot open shared object file: No such file or directory Failed to load Pango module for id: 'BasicScriptEngineFc' ** (main.tcl:11621): WARNING **: /usr/lib/pango/1.4.0/modules/pango-basic-fc.so: cannot open shared object file: No such file or directory Failed to load Pango module for id: 'BasicScriptEngineFc' (main.tcl:11621): GLib-GObject-CRITICAL **: file gobject.c: line 1561 (g_object_ref): assertion `G_IS_OBJECT (object)' failed ** (main.tcl:11621): CRITICAL **: file pango-engine.c: line 68 (_pango_engine_shape_shape): assertion `PANGO_IS_FONT (font)' failed ** ERROR **: file shape.c: line 75 (pango_shape): assertion failed: (glyphs->num_glyphs > 0) aborting... Abandon Does anyone know how to solve this ? Vincent ___ 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 -- Emil R. Emilov --- mailto:[EMAIL PROTECTED] http://www.emilov.de -- Emil R. Emilov --- mailto:[EMAIL PROTECTED] http://www.emilov.de ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Npgsql error
Check the lines: string operatingsystem = (string) reader["operatingsystem"]; string nodeid = (string) reader["nodeid"]; What happens of the results are NULL? You should check for NULL first. Then, are you sure that operatingsystem and nodeid are varchars or some other type that translate into string? If not then you would get that exception. Cheers, Emil Fabian Salamanca Dominguez wrote: Hi I tried to compile a simple C# program and access a Postgresql DB but I got this error in runtime (it compiled with no errors) : [EMAIL PROTECTED] Mono]$ mcs dbaccess.cs -r:Npgsql.dll -r:System.Data.dll [EMAIL PROTECTED] Mono]$ mono dbaccess.exe Unhandled Exception: System.InvalidCastException: Cannot cast from source type to destination type. in <0x000e1> dbAccess:Main (System.String[] args) This is the code: using System; using System.Data; using Npgsql; public class dbAccess { public static void Main(string[] args) { string connectionString = "Server=localhost;" + "Database=opennms;" + "User ID=opennms;" + "Password=opennms;"; IDbConnection dbcon; dbcon = new NpgsqlConnection(connectionString); dbcon.Open(); IDbCommand dbcmd = dbcon.CreateCommand(); string sql = "SELECT operatingsystem, nodeid " + "FROM assets"; dbcmd.CommandText = sql; IDataReader reader = dbcmd.ExecuteReader(); while(reader.Read()) { string operatingsystem = (string) reader["operatingsystem"]; string nodeid = (string) reader["nodeid"]; Console.WriteLine("OS: " + operatingsystem + " " + nodeid); } // clean up reader.Close(); reader = null; dbcmd.Dispose(); dbcmd = null; dbcon.Close(); dbcon = null; } } What am I doing wrong? Thanks!!! -- Fabian ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list -- Emil R. Emilov --- mailto:[EMAIL PROTECTED] http://www.emilov.de ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Npgsql error
Also another tip: you don't need to explicitly set connection etc. to null. Cosider following improvement: IDbConnection dbcon; IDbCommand dbcmd; IDataReader reader; try { dbcon = new NpgsqlConnection(connectionString); dbcon.Open(); dbcmd = dbcon.CreateCommand(); string sql = "SELECT operatingsystem, nodeid " + "FROM assets"; dbcmd.CommandText = sql; reader = dbcmd.ExecuteReader(); while(reader.Read()) { string operatingsystem = (string) reader["operatingsystem"]; string nodeid = (string) reader["nodeid"]; Console.WriteLine("OS: " + operatingsystem + " " + nodeid); } } catch (Exception ex) { // do stuff, rollback transaction } finally { // cleanup, even if error occurs, closing the reader is important because while it is open no other reader can be opened if (reader!=null) reader.Close(); if (dbcmd!=null) dbcmd.Close(); if (dbcon!=null) dbcon.Close(); } Fabian Salamanca Dominguez wrote: Hi I tried to compile a simple C# program and access a Postgresql DB but I got this error in runtime (it compiled with no errors) : [EMAIL PROTECTED] Mono]$ mcs dbaccess.cs -r:Npgsql.dll -r:System.Data.dll [EMAIL PROTECTED] Mono]$ mono dbaccess.exe Unhandled Exception: System.InvalidCastException: Cannot cast from source type to destination type. in <0x000e1> dbAccess:Main (System.String[] args) This is the code: using System; using System.Data; using Npgsql; public class dbAccess { public static void Main(string[] args) { string connectionString = "Server=localhost;" + "Database=opennms;" + "User ID=opennms;" + "Password=opennms;"; IDbConnection dbcon; dbcon = new NpgsqlConnection(connectionString); dbcon.Open(); IDbCommand dbcmd = dbcon.CreateCommand(); string sql = "SELECT operatingsystem, nodeid " + "FROM assets"; dbcmd.CommandText = sql; IDataReader reader = dbcmd.ExecuteReader(); while(reader.Read()) { string operatingsystem = (string) reader["operatingsystem"]; string nodeid = (string) reader["nodeid"]; Console.WriteLine("OS: " + operatingsystem + " " + nodeid); } // clean up reader.Close(); reader = null; dbcmd.Dispose(); dbcmd = null; dbcon.Close(); dbcon = null; } } What am I doing wrong? Thanks!!! -- Fabian ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list -- Emil R. Emilov --- mailto:[EMAIL PROTECTED] http://www.emilov.de ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Npgsql error
Cool, a question on that: What happens if a exception occurs? I meand close() gets called at the end of the using block, but does it get also called when an exception occurs (sort of finally)? If yes, I'm changing my programming style :) Another question, how would it look like if you had to catch an exception (i.e. to rollback a transaction)? Thanx :) Jaroslaw Kowalski wrote: Hi Emil, Also another tip: you don't need to explicitly set connection etc. to null. Cosider following improvement: IDbConnection dbcon; IDbCommand dbcmd; IDataReader reader; try { ... } finally { // cleanup, even if error occurs, closing the reader is important because while it is open no other reader can be opened if (reader!=null) reader.Close(); if (dbcmd!=null) dbcmd.Close(); if (dbcon!=null) dbcon.Close(); } A small tip: Your example is very java-ish. You could reduce the amount of code by using C# using() statement which provides automatic cleanup for connection, command and reader. I believe that the following is much more readable and saves a lot of typing: = using (IDbConnection c = new NpgsqlConnection("connectionString")) { c.Open(); using (IDbCommand cmd = c.CreateCommand()) { cmd.CommandText = "..."; using (IDataReader reader = cmd.ExecuteReader(); { while (reader.Read()) { } } } == -- Emil R. Emilov --- mailto:[EMAIL PROTECTED] http://www.emilov.de ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Npgsql error
Ok, but how does an exception fit in? You need to know if there was an error to log it or do additional stuff (like MsgBox.Show etc.). Jaroslaw Kowalski wrote: Cool, a question on that: What happens if a exception occurs? I meand close() gets called at the end of the using block, but does it get also called when an exception occurs (sort of finally)? If yes, I'm changing my programming style :) Another question, how would it look like if you had to catch an exception (i.e. to rollback a transaction)? The following code: using (A a = new A()) { code }; Is equivalent to: === A a = null; try { a = new A(); /// code } finally { if (a != null) ((IDisposable)a).Dispose(); } === It's the C# compiler that translates every using() to something like the above code. The IDisposable.Dispose method on data providers automatically rolls back any open and uncommitted transactions so you don't need to do explicit rollbacks. BTW. I've seen many (MS and other) examples where they don't call Dispose the IDbCommand object, even though it implements IDisposable, I'm not sure whether it leads to potential resource leaks or not. -- Emil R. Emilov --- mailto:[EMAIL PROTECTED] http://www.emilov.de ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Npgsql error
thanx man, thats an elegant way to do it which I will use from now on :) Jaroslaw Kowalski wrote: Ok, but how does an exception fit in? You need to know if there was an error to log it or do additional stuff (like MsgBox.Show etc.). How about this: try { using (resource) { } } catch (Exception ex) { // resource already freed } or using (resource) { try { } catch (Exception ex) { // can still access resource here } } -- Emil R. Emilov --- mailto:[EMAIL PROTECTED] http://www.emilov.de ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list