Re: [Mono-list] Cast a char(1) to a boolean

2004-10-23 Thread Iain McCoy
On Sat, 2004-10-23 at 07:22 +0200, Sijmen Mulder wrote:
> Hi,
> 
> > I was told to use a char(1) in a MySQL database since it doesn't have a
> > boolean type.  I retrieve a char(1) field but I can't seem to cast it to
> > be a boolean.  How is this done?
> 
> try:
> 
> bool thebool = (int)thechar==0 ? false : true;
> 
Ow, ow. It hurts.

Okay, I'm exaggerating. It's not really that bad, but that code is, as
far as I can see, needlessly complicated. All you need to do is this:
bool thebool = (thechar == 'T');
That's assuming you define an uppercase T to represent true, and
everything else to be a false. 

This might be a better definition:
bool thebool = (thechar != '\0');

Basically, just pick some character to be either true or false, and test
for that. Assign the result of a test to a boolean.

I'm fairly sure that that's the sanest approach to take.
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Enum problem

2004-10-17 Thread Iain McCoy
On Sat, 2004-10-16 at 10:53 -0700, gennady wexler wrote:
> On 10/16/04 4:33 AM, "Iain McCoy" <[EMAIL PROTECTED]> wrote:
> 
> > On Sat, 2004-10-16 at 13:17 +0200, Francis Brosnan Blázquez wrote:
> >> Hi.
> >> 
> >> Working with enumerations I've found an strange behaviour. If you
> >> compile the following source code and run it:
> >> 
> >> --
> >> using System;
> >> 
> >> public class EnumTest {
> >> 
> >> public enum TipoCarga {
> >> Positivo = 1/3,
> >> Negativo = 1 + (1/3),
> >> Neutro   = 1,
> >> }
> 
> > suspect what you're seeing is the compiler automatically coercing all of
> > your enum values to ints. This means that 1/3 = 0, so 1 + 1/3 = 0 and
> 
> if 1/3 is 0 then how would 1 + 1/3 be 0 too?
blargh, sorry, not thinking straight. What I meant was 1 + 1/3 = 1. I
believe I was right on the big-picture stuff, I just stuffed up a number
in the example.

Sorry,
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Enum problem

2004-10-16 Thread Iain McCoy
On Sat, 2004-10-16 at 13:17 +0200, Francis Brosnan Blázquez wrote:
> Hi.
> 
> Working with enumerations I've found an strange behaviour. If you
> compile the following source code and run it:
> 
> --
> using System;
> 
> public class EnumTest {
>   
>   public enum TipoCarga {
>   Positivo = 1/3,
>   Negativo = 1 + (1/3),
>   Neutro   = 1,
>   }
> 
>   public static void Main () {
>   TipoCarga carga;
> 
>   carga = TipoCarga.Positivo;
>   Console.WriteLine ("carga value is: {0}", carga);
> 
>   carga = TipoCarga.Neutro;
>   Console.WriteLine ("carga value is: {0}", carga);
> 
>   carga = TipoCarga.Negativo;
>   Console.WriteLine ("carga value is: {0}", carga);
>   }
> }
> --
> 
> 
> You get the following output:
> carga value is: Positivo
> carga value is: Neutro
> carga value is: Neutro
> 
> That is, on every assignment which uses TipoCarga.Negativo doesn't work.
> I've been reading about how enumerations works and seens to be that you
> can only use values from byte, sbyte, short, ushort, int, uint, long, or
> ulong types but not float or double types which can hold values as 1/3
> and 1 + (1/3). 
> 
> The odd thing is that assignment for Positivo = 1/3 works perfectly. 
> 
> Maybe mcs mustn't allow someone to compile the previous source code?

I haven't got a windows machine to run csc on to double check, but I
suspect what you're seeing is the compiler automatically coercing all of
your enum values to ints. This means that 1/3 = 0, so 1 + 1/3 = 0 and
therefore TipoCarga.Neutro == TipoCarga.Negativo. Whether this is what
css does or not I have no idea, but according to the spec it seems to be
correct (section 14.3 of the C# language specification 1.2):
"If the declaration of the enum member has a constant-expression
initializer, the value of that constant expression, implicitly converted
to the underlying type of the enum, is the associated value of the enum
member"

-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] glade signal connections

2004-08-31 Thread Iain McCoy
On Tue, 2004-08-31 at 18:38, Rob Brown-Bayliss wrote:
> On Tue, 2004-08-31 at 16:51, Peter Williams wrote:
> > Do you just mean that you want to manually connect to a signal? Gtk#
> > wraps signals as events and you can treat them pretty much as you
would
> > any other event:
> > 
> > Gtk.Window window = whatever ();
> > window.DestroyEvent += new DestroyEventHandler (myfunction);
> 
> If I do this:
> 
> tree_view.RowActivated += new EventHandler (row_activated);
This is almost what you want.
> 
> I get this error:
> 
> Operator + cannot be applied to operands of type
> `Gtk.RowActivatedHandler' and `System.EventHandler'(CS0019)
> 
This is telling you that you can only add delegates of type
Gtk.RowActivatedHandler to this event. Try this:
tree_view.RowActivated += new RowActivatedHandler (row_activated);

I think this will force you to change the prototype of row_activated to
match the RowActivatedHandler prototype. If you can't/won't run monodoc,
the monop tool is often handy:
$ monop -r:$MONO_PREFIX/lib/mono/gtk-sharp/gtk-sharp.dll
Gtk.RowActivatedHandler
[Serializable]
public delegate void RowActivatedHandler (object o, Gtk.RowActivatedArgs
args);
$ exit

I think my mailer's going to word wrap there, but [Serializable] is the
first line of output. Everything before that is the monop invocation.
$MONO_PREFIX is probably either /usr or /usr/local, depending on how you
installed.


-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Re: [Mono-devel-list] How hard is it to install Mono?

2004-08-25 Thread Iain McCoy
On Wed, 2004-08-25 at 04:48, Stacey Abshire wrote:
> Hello Duncan...
> 
> It is interesting that you bring this up...  I have been following the progress
> of mono for some time now, and I am getting ready to setup a box for doing
> development with it.  I am planning on using RedHat 9, and so I downloaded the
> mono-all.zip...  hoping in it would be a script to install the packages...  no
> luck.  So I guess when I sit down and do this, I am going to have to go through
> all of the packages by hand, or install Red Carpet (which i care very little
> for) and use it.  
Stacey, rpm -Uvh *.rpm is the incantation you want. Run it in a folder
which you have unzipped mono-all.zip into.

Duncan, this particular piece of advice has been given an awful lot of
times. Perhaps it should be prominently displayed alongside the
mono-all.zip link?
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


RE: [Mono-list] Syslog Access

2004-08-16 Thread Iain McCoy
On Tue, 2004-08-17 at 14:35, Craig Dayton wrote:
> Perhaps exploring the possibility of using PerlNet a product marketed by
> ActiveState might be a cost effective solution.
> 
> With PerlNet, one can define an Interface to any module on CPAN and compile
> it as a library or executable.  So from a developer's prospective, a
> programmer can leverage modules in CPAN and the .NET community all within a
> single executable.  Thanks to Mono this capability is now extended to the
> Unix world. No sense in reinventing the wheel is there?  
Is it extended to the unix world? My understanding of PerlNet was that
it worked by interfacing between the regular win32 perl interpreter and
the MS CLR - not by compiling perl code to normal managed code. The MS
CLR interfaces that it would use are not replicated by mono, so I
suspect it doesn't work on a unix.
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Re: Bootstrapping

2004-07-07 Thread Iain McCoy
On Thu, 2004-07-08 at 14:22, Brandon Knitter wrote:
> This is a chicken and the egg thing.  I just want to build the thing from
> scratch and am confused (and concerned) how this is possible.
The components written in c# were initially compiled on windows using
csc. If you look back in the history of the mono project, you'll find a
few announcements from when they got the c# components to be
self-hosting.

If you want to do a full bootstrap from scratch, I think you can still
use microsoft's implementation to do so. It may be possible to use the
pnet c# compiler as well, but I haven't heard of anyone doing so.
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] New to Mono: Strange things with official Mono install

2004-07-05 Thread Iain McCoy
I suspect you have bits of an old, pre-gac mono installation lying
around. You should probably either run "make uninstall" in the mono
source directory if you've still got it or run "rm /usr/lib/System.*.dll
/usr/lib/*-sharp.dll /usr/lib/Mono.*.dll" to clean them up. The only
mono dll file that should be in $prefix/lib is corlib.dll. If your old
mono install was in /usr/local, then change all instances of /usr/lib in
that command to /usr/local/lib.

If you don't have bits of an old pre-gac mono installation lieing
around, hopefully someone else can help you out.

On Tue, 2004-07-06 at 03:49, Igor Anikeev wrote:
> Hi all,
> 
> I have installed using YUM Mono 1.0 fromtheir official repository.  
> Neither monodoc nor monodevelop work.
> 
> [EMAIL PROTECTED] TestGlade]$ monodoc
>  
> Unhandled Exception: System.DllNotFoundException: libgtk-win32-2.0-0.dll
> in <0x00053> (wrapper managed-to-native) Gtk.Application:gtk_init 
> (int&,intptr&)in <0x00038> Gtk.Application:Init ()
> in [0x00120] (at 
> /home/duncan/conf/mono-conf/monodoc/BUILD/monodoc-1.0/browser/browser.cs:83) 
> Monodoc.Driver:Main (string[])
> 
> or:
> 
> [EMAIL PROTECTED] insider]$ monodevelop
>  
> Unhandled Exception: System.DllNotFoundException: libgobject-2.0-0.dll
> in <0x00053> (wrapper managed-to-native) Gnome.Program:g_type_init ()
> in <0x000f8> Gnome.Program:.ctor 
> (string,string,Gnome.ModuleInfo,string[],object[])
> in [0x000d5] (at 
> /home/duncan/conf/mono-conf/monodevelop/BUILD/monodevelop-0.5/src/Main/StartUp/MonoDevelopMain.cs:80)
>  
> MonoDevelop.SharpDevelopMain:Main (string[])
> 
> What would it mean?
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


RE: [Mono-list] Using Exceptions with external Plugins

2004-06-28 Thread Iain McCoy
On Tue, 2004-06-29 at 11:14, Pablo Fischer wrote:
> Cool! Thanks!
> 
> Now, how can I get sure that the InnerException is a
> XmlRpcFaultException or a XmlRpcMissedSomething?, I'm trying with this:
> 
> } catch(TargetInvocationException e) {
>if(e.InnerException.GetType().ToString() ==   
> "CookComputing.XmlRpc.XmlRpcFaultException") {
>Console.WriteLine("yes");
else 
> }
> 
> But I don't think it's the correct way/code, any suggestions?
You might try this:
if(e.InnerException is CookComputing.XmlRpc.XmlRpcFaultException)

You should also do something sensible with exceptions that fail all your
if statements. That might be rethrowing or some sort of generic error
message.
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] mono installation

2004-06-21 Thread Iain McCoy
On Tue, 2004-06-22 at 12:57, geoff rainey wrote:
> What is the correct prefix for mono to be installed - /usr or
> /usr/local?
There's not really any correct answer; however, things are much, much
better tested and therefore more likely to work when all the mono
components are in the same prefix.

> On Mon, 2004-06-21 at 23:19, Jonathan Stowe wrote:
> > On Mon, 2004-06-21 at 10:08, geoff rainey wrote:
> > > Hello,
> > > 
> > > I have installed the following:
> > > 
> > > platform - whitebox linux
> > > mono 0.31
> > > xsp 0.12
> > > mod_mono 0.10
> > > 
> > > all installed from source. I am receiving the following error when 
> > > viewing index.aspx and other errors with other aspx files, any idea
> > why?
> > > 
> > > 
> > 
> > That's not an error - that's the source of the .aspx file.  This is
> > down
> > to your Apache configuration.  Check out the INSTALL file in the
> > mod_mono source.
> > 
> > /J\
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] porting java to C#

2004-06-20 Thread Iain McCoy
On Sun, 2004-06-20 at 22:44, Tracy Barlow wrote:
> Unfortunately the issue is not necessarily about running Java on the 
> Mono runtime, it's about running it on .NET on Microsoft.
> 
ikvm runs there, too.
> 
> Iain McCoy wrote:
> 
> >On Sun, 2004-06-20 at 21:32, Tracy Barlow wrote:
> >  
> >
> >>Is there anyone who is interested in porting jPOS financial transaction 
> >>library/framework http://www.jpos.org/download.html to C#? or has this 
> >>been done?
> >>
> >>
> >You don't need to. You should be able to apply ikvm to the thing and
> >have it run on mono's runtime - ikvm is all about getting compiled java
> >stuff running on the .net runtime
> >  
> >
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] A quick question : what does "feature C# 1.0 complete" actually mean ...

2004-06-18 Thread Iain McCoy
On Fri, 2004-06-18 at 08:11, Bill Richards wrote:
> The reason I ask this is because the Mono site states quite
> categorically ... 
>  
> The Mono C# compiler is considered feature C# 1.0 complete at
> this point and mature. MCS is able to
> compile itself and many more C# programs (there is a test
> suite included that you can use). It is routinely
> used to compile Mono, roughly 1.7 million lines of C# code. 
> 
> Mono includes a compiler for the C# language, a Common
> Language Runtime (CLR) for the Common
> Language Infrastructure (CLI) and a set of class libraries.
>  
> ... but when we look at the class-status pages, they clearly show that
> there are still a lot of features to be implemented. In my mind, the
> two items do not marry. Could you please explain this to me? 

MCS refers only to the C# compiler, which has the sole purpose of taking
C# source files as input and spitting out MSIL code as output. The class
status pages refer only to the class libraries, which exist to support 
code that runs on the runtime, and are distinct from the compiler.
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] nighltly build

2004-06-15 Thread Iain McCoy
On Tue, 2004-06-15 at 18:14, KiOrKY wrote:
> but ok for the bootstrap, i do only make ! then but why when i use the lastest 
> nightly build i cant commpile nant? because when i use mcs-095 it works
> regards

Please allow me to reiterate: declaring "It doesn't work!" with no more
information does not help anybody to help you. How exactly does it not
work?

Are you sure your installation of the daily is basically functional? Can
you compile and run a simple "hello world" program with it?
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Mono Project question

2004-06-15 Thread Iain McCoy
On Tue, 2004-06-15 at 04:13, Juan Trujillo wrote:
> I really want to now if the Mono Project supports pages in ASP  &
> Vbscript or only supports pages ins ASP.net
Mono is an implementation of the .net framework. Classic ASP is not part
of the .net framework, so it falls outside the scope of the mono project
- or at least, I think that's why mono doesn't support classic ASP.
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] nighltly build

2004-06-15 Thread Iain McCoy
On Tue, 2004-06-15 at 17:24, KiOrKY wrote:
> OK, so im happy to listen that i have done fine for a long moment.
> however when i compile nant with last nightly build (of mono and nant)  i got 
> compilation errorsbut when i do make install in mcs095(release) directory after 
> installation of the nighly build , all is going fine ! so its why i was thinking 
> that classic make wxas not suffisant. What is the "fullbuild" rule ? because when i 
> use it i get an corlib error (got 21 need 22)
> why ?
> regards
> 
Sorry, are you asking about mono or nant?

I think fullbuild is obsoleted now (replaced by bootstrap), but in any
case it was (and bootstrap is) only ever useful for people who are using
mono from cvs, not from snapshots or releases.

> Iain McCoy <[EMAIL PROTECTED]> a écrit :
> 
> > On Tue, 2004-06-15 at 16:51, KiOrKY wrote:
> > > can someone gives me stes to compile nightly builds bnecause im thinking
> > that i do it wrong 
> > > 
> > > i cant access cvs because enterprise 's firewall... so i can just download
> > packages in "dayly" part of the web site
> > > 
> > > i want to refresh all the apps (mono but mcs too !)
> > > regards
> > 
> > Download a mono snapshot from the website, http://www.go-mono.com/daily
> > . You do *not* want a monocharge or a monolite; you want the mono
> > package. At the moment, that's mono-0.96.20040614.tar.gz
> > 
> > Use either tar with the zxvf switches or an application like file-roller
> > to extract the tarball
> > 
> > open a terminal; cd into the directory you extracted the tarball to
> > 
> > run ./configure, or ./autogen.sh if there's no configure. Make sure all
> > the dependencies you need are satisfied.
> > 
> > run make
> > 
> > run make install
> > 
> > You should now have a mono install in /usr/local. You may need to set
> > environment variables so it takes precedence over one installed from a
> > package; the relevant variables are PATH and LD_LIBRARY_PATH, IIRC.
> > -- 
> > Iain McCoy <[EMAIL PROTECTED]>
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] nighltly build

2004-06-15 Thread Iain McCoy
On Tue, 2004-06-15 at 16:51, KiOrKY wrote:
> can someone gives me stes to compile nightly builds bnecause im thinking that i do 
> it wrong 
> 
> i cant access cvs because enterprise 's firewall... so i can just download packages 
> in "dayly" part of the web site
> 
> i want to refresh all the apps (mono but mcs too !)
> regards

Download a mono snapshot from the website, http://www.go-mono.com/daily
. You do *not* want a monocharge or a monolite; you want the mono
package. At the moment, that's mono-0.96.20040614.tar.gz

Use either tar with the zxvf switches or an application like file-roller
to extract the tarball

open a terminal; cd into the directory you extracted the tarball to

run ./configure, or ./autogen.sh if there's no configure. Make sure all
the dependencies you need are satisfied.

run make

run make install

You should now have a mono install in /usr/local. You may need to set
environment variables so it takes precedence over one installed from a
package; the relevant variables are PATH and LD_LIBRARY_PATH, IIRC.
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


RE: [Mono-list] Re: [Mono-devel-list] ASP.NET Web Services in MONO

2004-06-14 Thread Iain McCoy
On Tue, 2004-06-15 at 06:04, Mahen Perera wrote:
> Hi Lluis
> 
> Thanx for the reply. Ok if it uses reflection what are the
> mechanisms used in MONO ASP.NET to overcome the performance overheads
> in using reflection.
I would suggest that the best way to understand what mono's asp.net
implementation does is to read it's code. Is there some reason why that
option is not available to you?

I suspect that if the implementation does not already do stuff to
mitigate the cost of reflection, it's because those costs are not a
problem. If they become a problem, some way of mitigating the costs will
be found and implemented.
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Portably getting the keyboard state in Windows.Forms?

2004-06-11 Thread Iain McCoy
On Fri, 2004-06-11 at 22:25, Stuart Ballard wrote:
> I'm writing a simple WinForms based game, and obviously using normal 
> keydown/keyup/keypress listeners has some limitations in that scenario 
> (because you want to be able to be aware that several non-modifier keys 
> are pressed at once, eg both "up" *and* "left").
> 
> An article at http://www.syncfusion.com/FAQ/WinForms/FAQ_c46c.asp
> appears to answer this question partially, but the answer is to use 
> P/Invoke of the GetKeyState function which is obviously not portable to 
> Mono (from reading around a little bit, it sounds like I might want 
> GetAsyncKeyState instead, but the same problem applies, of course).
> 
> Is there a way to do this on Mono's WinForms at all? If so, is it 
> portable to the MS .NET framework too?
Don't quote me on this, but if I understand the way winforms is being
done at all you should be able to p/invoke out to win32 functions and
have the wine implementation of said functions kick in, so it should all
Just Work if wine implements the functions you need.
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


RE: [Mono-list] Wanted: libgobject-2.0-0.dll

2004-06-11 Thread Iain McCoy
I think you can't find it because it doesn't exist. Here's what should
be happening:

1. gtk-sharp loads a library, addressing it by it's win32 library name
2. mono's runtime mappings mechanism goes "aha! I know that dll, you
really want this .so file"
3. mono loads the .so file, instead of the dll

What appears to be happening is that the mappings stuff isn't kicking
in. One way this could happen is if you still have pre-gac gtk-sharp
assemblies installed on your system somewhere, because the mappings
mechanism changed when the gac was introduced but old gtk-sharp
assemblies depend on that change not having happened. You're sure you
don't have any such assemblies sitting around? A popular way of
acquiring them was to fail to uninstall 0.31 before installing beta1.

If you haven't got any old gtk-sharp libraries installed, it's not
something I know of an easy fix for (but maybe someone else does). What
I would suggest is that you generally poke around. You'll find the
gtk-sharp mappings in
$prefix/lib/mono/gac/gtk-sharp/1.0.0.0__35e10195dab3c99f/gtk-sharp.dll.config; is 
there a gobject mapping there? Can you reasonably expect the runtime to find the .so 
file? Is the .so file present?

Good luck.

On Fri, 2004-06-11 at 20:35, Fabricio Santos wrote:
> I believe my problem is slightly different as I'm trying to run monodevelop
> and not my own developed application.
> 
> Besides I can't find the library anywhere... :-(
> 
> -fs
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Peter Boos
> Sent: Friday, June 11, 2004 10:47
> To: [EMAIL PROTECTED]
> Subject: [Mono-list] Wanted: libgobject-2.0-0.dll
> 
> Hi,
> 
> I ran into similar problems after installing the beta2 version of gtk-sharp.
> I 
> found out that the sample application in the gtk-sharp tarball working fine,
> 
> but my application starts with missing dlls exception.
> I referenced (via mcs -r:... ) the gtk-sharp.dll directly from the tarball
> and 
> my app worked fine then. That's enough for me, but generally I think make 
> install is broken in some way.
> 
> Regards,
> 
>   Peter
> ___
> 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
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Wanted: libgobject-2.0-0.dll

2004-06-11 Thread Iain McCoy
On Fri, 2004-06-11 at 10:31, Fabrício Santos wrote:
> ==
> [EMAIL PROTECTED] RPMs]# monodevelop
> 
> Unhandled Exception: System.DllNotFoundException: libgobject-2.0-0.dll
> in <0x00053> (wrapper managed-to-native) Gnome.Program:g_type_init ()
> in <0x0010b> Gnome.Program:.ctor
> (string,string,Gnome.ModuleInfo,string[],object[])
> in [0x000d5] (at
> /home/duncan/conf/mono-conf/monodevelop/BUILD/monodevelop-0.4/src/Main/Start
> Up/MonoDevelopMain.cs:80) Mo
> noDevelop.SharpDevelopMain:Main (string[])
> ==
> 
> I can't find this libgobject-2.0-0.dll file anywhere. In which package
> should this file be found? I can't find it anywhere. Even rpmfind.net has no
> clue about it...
> 
> To install mono on my Fedora Core 1 system I just unzipped the Beta 2
> mono_all.zip and ran "rpm -i *rpm" and it seems all packages installed ok.

Have you had any previous versions of mono installed? If so, how did you
install them?

Things can get weird if you have both an old and a new version of mono
installed, or bits of an old version still sitting around.
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] winforms on debian / wine / segmentation fault => sorry bug in sent

2004-06-08 Thread Iain McCoy
On Tue, 2004-06-08 at 19:55, KiOrKY wrote:
> i dont want to hurt somebody, so sorry!
> im just borried with winforms ;)
> i have installed wine from packages of debian.org and i have a new error:
> could not exec wineserver oO !
> regards
Disregard my email of two minutes ago, then.

Try running "/usr/lib/wine/wineserver", then try again with your
application.
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] winforms on debian / wine / segmentation fault

2004-06-08 Thread Iain McCoy
On Tue, 2004-06-08 at 19:06, KiOrKY wrote:
> are winforms running on debian
Your example works on debian sid here.
> 
> which libs dependencies have mono to run these fucking winforms ?
> (execpt glib2 ...)
What makes you think swearing will get someone to help you?
> 
> is necessary to glib2 to be compiled from source or the package from debian.org is 
> perfect?
The package from the debian archives works.
> debian sid
> kernel  2.4.26
> mcs 095
> mono 20040607
> gecko-sharp-0.4 gtksourceview-sharp-0.3 winelib-0.3
> gtk-sharp-0.93  libgdiplus-0.8  wine20040505
I think the only substantial difference between my system and yours is
that I have kernel 2.6.5 installed. Can you try installing that (it's
easy with the debian package; the command "apt-cache search kernel-image
2.6" will list packages, one of which will probably be optimized for
your computer's CPU), and use it to try again?

Whether it will help or not I don't know, but it's the only thing I can
see that might make a difference.
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Difference between mono and mint ?

2004-06-07 Thread Iain McCoy
On Mon, 2004-06-07 at 19:12, HannibAl Bundie wrote:
> Hi,
> 
> I'm sorry, but I don't understand the difference between the runtimes mono 
> and mint. The web page about the Mono runtime on www.go-mono.com doesn't 
> satisfy me.
> 
> Could anyone explain this point or give a link about this subject please ?
> 
> Thanks in advance
The mono binary is a JIT, while mint is an interpreter. As I understand
it, the JIT is faster but mint is easier to get running on a new
platform.
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] intro

2004-05-31 Thread Iain McCoy
That packaging effort has been defunct for a while now. You can get
packages of a recent mono version from the people with the website at
http://pkg-mono.alioth.debian.org/

They also have mod_mono packages.

On Mon, 2004-05-31 at 03:57, Jerry Windrel wrote:
> So far I have installed mono using the stable (woody) debian package at
> http://www.debianplanet.org/mono and succussfully compiled and run a "hello
> world" console program (yay!).  However, I have not yet figured out how to
> install the apache module "mod-mono" for "woody".   (It does not seem to be
> available at debianplanet).
> 
> I'd appreciate any assistance on installing mod-mono, as well as any general
> comments and suggestions regarding my plans, including links to introductory
> resources such as Howtos and tutorials.
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] We need Linux.NET Stub

2004-05-26 Thread Iain McCoy
On Wed, 2004-05-26 at 18:21, Martin Olsson wrote:
> This is the same thing that's given in the FAQ but I dont need this. I 
> cannot possibly rely on this at the end-user, what if their kernel does 
> not have support for it? Should I recompile their kernel in the 
> installation program? Seems insane. Also the problems with Wine.
> 
> As I said below, what I would like to use it a pure native Linux stub 
> instead. Would not that be rather easy to create? Anyone tried?
> 
> 
> Regards,
> /m
> 
I'm sure this has been discussed before.

The standard solution when you don't have binfmt in your kernel is to
use a shell script - have a look at your $prefix/bin/mcs file to see
that approach.
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] C# coding standard?

2004-05-24 Thread Iain McCoy

On Mon, 2004-05-24 at 16:57, Emiel van de Laar wrote:
> I've been looking for a C# coding standard to use while coding, but have 
> yet been able to find one.
> Does Mono/Ximian provide one? What is being used for the standard library?
> 
The mono guidelines can be found in the mcs/class/README file. You could
view the current latest version of that file at:
http://cvs.hispalinux.es/cgi-bin/cvsweb/mcs/class/README?rev=1.14&content-type=text/x-cvsweb-markup&cvsroot=mono

(wordwrapping of that url may cause grief)
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] re: NEED HELP / Mono / Wine /

2004-05-19 Thread Iain McCoy
You've been misinformed, it's not ximian that produces the .deb
packages. The group that does make them has a page at
http://pkg-mono.alioth.debian.org/

On Wed, 2004-05-19 at 17:13, Mathieu PASQUET wrote:
> Where are the .deb on ximian, dont find them !!!
> 
> Sorry for flood i dont know how to answer to my own message, hope that some body 
> tell ùme how one day ;)
> ___
> Mono-list maillist  -  [EMAIL PROTECTED]
> http://lists.ximian.com/mailman/listinfo/mono-list
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] The handle daemon didnt start up properly

2004-05-16 Thread Iain McCoy
This seems to come up fairly often. Would a patch like the attached be
worth applying?

On Mon, 2004-05-17 at 00:00, bender wrote:
> Hi!
> 
> All of a sudden i get these warnings whenever i try to start a mono
> application:
> 
> ** (test.exe:14610): WARNING **: The handle daemon didnt start up
> properly
>  
> ** (test.exe:14610): WARNING **: Failed to attach shared memory! Falling
> back to non-shared handles
> 
> Everything seems to work, but much slower than expected. Anyone that
> knows how to fix this?
> 
> BR
> .b
> 
> ___
> Mono-list maillist  -  [EMAIL PROTECTED]
> http://lists.ximian.com/mailman/listinfo/mono-list
-- 
Iain McCoy <[EMAIL PROTECTED]>
? mono-0.30.99
? mono-0.31
? mono-0.91
Index: mono/io-layer/handles.c
===
RCS file: /mono/mono/mono/io-layer/handles.c,v
retrieving revision 1.43
diff -u -r1.43 handles.c
--- mono/io-layer/handles.c	22 Apr 2004 14:37:44 -	1.43
+++ mono/io-layer/handles.c	16 May 2004 14:27:53 -
@@ -105,7 +105,8 @@
 	 &_wapi_shared_scratch);
 		if(shared==FALSE) {
 			g_warning ("Failed to attach shared memory! "
-   "Falling back to non-shared handles");
+   "Falling back to non-shared handles\n" 
+   "Try deleting your ~/.wapi folder to fix this issue.");
 		}
 #endif /* DISABLE_SHARED_HANDLES */
 	}


Re: [Mono-list] Might this be a bug?

2004-05-12 Thread Iain McCoy
I get this error too, but for me it goes away once I add a mapping to go
from gdiplus.dll to libgdiplus.dll.so. Should such a mapping be created?

On Wed, 2004-05-12 at 02:58, Peter Dennis Bartok wrote:
> It's not a bug. It's a problem loading winelib. We fixed a build issue,
> but I'm not sure whether or not the package you are using already has the
> fix. I'll find out.
> 
> Peter
> 
> -Original Message-
> From: "Ellis, Edward" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Date: 11 May, 2004 10:31
> Subject: [Mono-list] Might this be a bug?
> 
> 
> Is this a bug or should I do further troubleshooting?  I could start
> small and work up, but I thought, "Why not go for the gusto?"  This
> looks like it might be an installation problem, but as a newbie, I am
> not sure.
> 
> I ran a simple WindowForms VB application written in VB.NET and got the
> following exception:
> 
> Unhandled Exception: System.TypeInitializationException: An exception
> was thrown by the type initializer for System.Drawing.GDIPlus --->
> System.DllNotFoundException: gdiplus.dll
> in <0x00053> (wrapper managed-to-native)
> System.Drawing.GDIPlus:GdiplusStartup
> (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartu
> pOutput&)
> in <0x00068> System.Drawing.GDIPlus:.cctor ()
> --- End of inner exception stack trace ---
> 
> in (unmanaged) System.Drawing.GDIPlus:GdipCreateFontFromHfont
> (intptr,intptr&,System.Drawing.LOGFONTA&)
> in <0x000c7> System.Drawing.Font:FromHfont (intptr)
> in <0x00018> System.Windows.Forms.Control:get_DefaultFont ()
> in <0x001c1> System.Windows.Forms.Control:.ctor ()
> in <0xe> System.Windows.Forms.ScrollableControl:.ctor ()
> in <0xa> System.Windows.Forms.ContainerControl:.ctor ()
> in <0x00016> System.Windows.Forms.Form:.ctor ()
> in <0xa> Namer.Form1:.ctor ()
> in <0x0004f> (wrapper remoting-invoke-with-check) Namer.Form1:.ctor ()
> in <0x0001b> Namer.Form1:Main ()
> 
> I have the following RPMs installed:
> cairo-0.1.22-0.ximian.6.2.i386.rpm
> gal-0.23-1.ximian.6.6.i386.rpm
> gtk-sharp-0.91.1-0.ximian.6.0.i386.rpm
> icu-2.6.1-1.ximian.6.5.i386.rpm
> libgal2.0_6-1.99.11-0.ximian.6.1.i386.rpm
> libgdiplus-0.3-0.ximian.6.1.i386.rpm
> libgtkhtml3.0_4-3.0.10-0.ximian.6.1.i386.rpm
> libicu26-2.6.1-1.ximian.6.5.i386.rpm
> libicu-devel-2.6.1-1.ximian.6.5.i386.rpm
> libpixman-0.1.1-0.ximian.6.0.i386.rpm
> mono-basic-0.91-0.ximian.6.3.i386.rpm
> mono-core-0.91-0.ximian.6.3.i386.rpm
> mono-data-0.91-0.ximian.6.3.i386.rpm
> monodoc-0.15-0.ximian.6.1.i386.rpm
> mono-drawing-0.91-0.ximian.6.3.i386.rpm
> mono-ms-enterprise-0.91-0.ximian.6.3.i386.rpm
> mono-ms-extras-0.91-0.ximian.6.3.i386.rpm
> mono-posix-0.91-0.ximian.6.3.i386.rpm
> mono-preview-0.91-0.ximian.6.3.i386.rpm
> mono-remoting-0.91-0.ximian.6.3.i386.rpm
> mono-web-forms-0.91-0.ximian.6.3.i386.rpm
> mono-web-services-0.91-0.ximian.6.3.i386.rpm
> mono-window-forms-0.91-0.ximian.6.3.i386.rpm
> mono-ziplib-0.91-0.ximian.6.3.i386.rpm
> wine-20040408-1rh9winehq.i386.rpm
> winelib-0.2-0.ximian.6.2.i386.rpm
> 
> J. Edward Ellis
> Battelle, Pacific Northwest National Laboratory
> (509) 375-3627 office
> (509) 521-6361 cell
> (509) 372-4725 FAX
> mailto:[EMAIL PROTECTED]
> 
> 
> ___
> 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
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Monodoc

2004-05-11 Thread Iain McCoy
On Tue, 2004-05-11 at 22:19, Shawn Vose wrote:
> I just grabbed the latest betas for mono and I am having a bit of a
> problem getting monodoc to run. It installed without a hitch; however,
> it is complaining with the following:
> 
> Unhandled Exception: System.DllNotFoundException: libgtk-win32-2.0-0.dll
> in <0x00053> (wrapper managed-to-native) Gtk.Application:gtk_init
> (int&,intptr&)
> in <0x00038> Gtk.Application:Init ()
> in [0x0011b] (at /temp/mono/latest/monodoc-0.15/browser/browser.cs:80)
Chances are that you have old gtk-sharp.dll and friends sitting around
in $prefix/lib. You need to clean them out so that mono sees the current
assemblies in the GAC.
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


RE: [Mono-list] Simple code - differences in output between mono & .Net

2004-03-04 Thread Iain McCoy
On Thu, 2004-03-04 at 03:13, Jonathan Stowe wrote:
>   StreamReader mtab = new StreamReader("/etc/mtab");
> 
>   ArrayList stuff = new ArrayList();
>   string[] fields;
>   while ( (line = mtab.ReadLine()) != null )
>   {
>  fields = line.Split(new char[]{' '});
>  if (fields[0] != "none")
>  {
> stuff.Add(fields[1]);
>  }
>   }
What happens to /proc and /proc/bus/usb with this system?
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Socket code.

2004-02-23 Thread Iain McCoy
On Mon, 2004-02-23 at 19:37, Michal Moskal wrote:
> This ain't C -- for errors you should get exception, not -1.
Not so. According to microsoft's guidelines, it depends on the error -
if it's an error that you expect to get often, there should be a return
code to indicate it. This is because of the performance cost of
exceptions.

There are various examples of this, such as Hashtable returning null if
you ask for a non-existent key and string.IndexOf() returning -1 if the
thing you are searching for is not found.
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Environment.TickCount not as documented by MS (was: A mono bug)?

2004-02-18 Thread Iain McCoy
On Thu, 2004-02-19 at 02:16, Lawrence Oluyede wrote:
> I've written a simple script to compute the uptime of the machine.
> It works well on MS.NET on Win2k (i tried to compare the output with 
> some other similar utilities) but on Mono 0.29 on my Gentoo box it fails 
> (the procps uptime tells me another time instead of the one that i get 
> with my uptime). Maybe I'm wrong or maybe Mono is wrong... anyway I 
> can't install Mono 0.30 cause it doesn't compile on Gentoo and on 
> Windows it doesn't run :(
> 
It seems that for Environment.TickCount mono returns basically the same
thing as it returns for DateTime.Ticks.

Environment.TickCount's icall looks like this:
res = (gint32) gettimeofday (&tv, &tz);

if (res != -1)
res = (gint32) ((tv.tv_sec & 0xF) * 1000 +
(tv.tv_usec / 1000));
return res;

while the DateTime_GetNow icall does this:
if (gettimeofday (&tv, NULL) == 0) {
res = (((gint64)tv.tv_sec + EPOCH_ADJUST)* 100 +
tv.tv_usec)*10;
return res;
}


These are rather more similar than makes sense, in any case.

Anyway, Environment.TickCount is documented by MS (at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemEnvironmentClassTickCountTopic.asp)
 as "containing the amount of time in milliseconds that has passed since the last time 
the computer was started". I think mono's implementation should probably do something 
similar, although I'm not yet sure what the correct way to do that something similar 
would be.
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] RE: [Mono-devel-list] REGRESSION: StringBuilder

2004-01-13 Thread Iain McCoy
I get the same problem, on a freshly checked-out-from-anoncvs-and-built
mcs and mono. I did some digging (just because I could) and I suspect
the problem is that StringBuilder uses String.InternalStrcpy to move
everything to the right of the insert point across. From my reading of
the code, that would go to the method
ves_icall_System_String_InternalStrcpy_StrN in
mono/metadata/string-icalls.c. That function's basically a call to
memcpy, which can't be used on overlapping memory areas (and breaking
that rule is what causes the regression). I think there's a few options
to fix it:
1 Add a String.InternalStrmov that uses memmove instead of memcpy
2 Change String.InternalStrcpy so that it uses memmove

Both of these options fix the problem. I suspect Option 2 is detrimental
to performance because it would mean that overlapping buffers were being
dealt with even when they weren't actually there.

I'm attaching a little patch I wrote that does Option 1. I make no
claims about this patch, except that it works for me. I didn't look over
StringBuilder particularly thoroughly, but I think I caught all of the
cases that needed to be changed. 

I imagine I have broken 5 rules and 10 guidelines with this patch, but
oh well - I hope it is useful.

Iain


On Tue, 2004-01-13 at 23:55, Jaroslaw Kowalski wrote:
> I've just rebuilt mcs and mono and I still get the same error.
>  
> BTW. I'm using:
>  
> :pserver:[EMAIL PROTECTED]:/mono
>  
> Jarek
> - Original Message - 
> From: Torstensson, Patrik
> To: Torstensson, Patrik ; Jaroslaw Kowalski ;
> [EMAIL PROTECTED] ; Mono Development
> Sent: Tuesday, January 13, 2004 1:12 PM
> Subject: [Mono-list] RE: [Mono-devel-list] REGRESSION:
> StringBuilder
> 
> Have you rebuilt everything? I just did the same ression test
> here and that returns correct value.
>  
> Can anyone else test this also with the latest CVS?
>  
> Cheers,
>  Patrik
> 
> __
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Torstensson, Patrik
> Sent: den 13 januari 2004 13:02
> To: Jaroslaw Kowalski; [EMAIL PROTECTED]; Mono
> Development
> Subject: RE: [Mono-devel-list] REGRESSION: StringBuilder
> 
> 
> Looking into it right now, it's strange because SB passed all
> the test.
>  
> Be back in 2..
>  
> Sorry for the problems caused!
>  
> Cheers,
>  Patrik
> 
> __
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Jaroslaw Kowalski
> Sent: den 13 januari 2004 12:33
> To: [EMAIL PROTECTED]; Mono Development
> Subject: [Mono-devel-list] REGRESSION: StringBuilder
> Importance: Low
> 
> 
> Looks like there's been a regression introduced in mono
> yesterday.
>  
> This snippet:
>  
> StringBuilder sb = new StringBuilder();
>  
> sb.Append("testtesttest");
> sb.Insert(0, '^');
> Console.WriteLine("sb: {0}", sb);
> 
> produces:
>  
> sb: ^teetteetteet
>  
> It obviously should be:
> 
> sb: ^testtesttest
>  
> This is kind of critical since NAnt no longer runs on
> mono/Linux.
>  
> Jarek
-- 
Iain McCoy <[EMAIL PROTECTED]>
? mono/autom4te.cache
? mono/mint.pc
? mono/mono/interpreter/interp.lo
? mono/mono/interpreter/libmint.la
? mono/scripts/soapsuds
? mcs/class/Mono.Posix/Mono.Posix/Mono.Posix.dll
? mcs/class/Mono.Posix/Mono.Posix/map.c
? mcs/class/Mono.Posix/Mono.Posix/map.h
Index: mono/mono/metadata/icall.c
===
RCS file: /mono/mono/mono/metadata/icall.c,v
retrieving revision 1.395
diff -u -r1.395 icall.c
--- mono/mono/metadata/icall.c  12 Jan 2004 07:42:17 -  1.395
+++ mono/mono/metadata/icall.c  13 Jan 2004 16:19:43 -
@@ -4452,6 +4452,8 @@
"System.String::InternalAllocateStr", 
ves_icall_System_String_InternalAllocateStr,
"System.String::InternalStrcpy(string,int,string)", 
ves_icall_System_String_InternalStrcpy_Str,
"System.String::InternalStrcpy(string,int,string,int,int)", 
ves_icall_System_String_Int