Re: [Mono-dev] mono embed: passing arrays from and to unmanaged code

2006-01-13 Thread Davide Morelli


thank you, that was really useful!

now my problem is that i'd need to pass an array of struct.
a very simple struct like this one

- in C
typedef struct atom_simple
{
int a_type;
float float_value;
MonoString *string_value;
};

- in C#
[StructLayout (LayoutKind.Sequential)]
public struct Atom
{
public int type;
public float float_value;
public string string_value;
}

I'd like to put those struct in an array but i need a MonoClass to create 
the MonoArray, something like:


MonoClass *c = mono_class_from_name (image, PureData, Atom);
mono_array_new (domain, c, argc);

but is this the right thing to do? i mean does mono_class_from_name () work 
on struct also?

if not, is there another way i can create a monoarray ?

sadly the examples in samples/embed don't cover this.

thank you,
Davide.


- Original Message - 
From: Paolo Molaro [EMAIL PROTECTED]

To: mono-devel-list@lists.ximian.com
Sent: Thursday, January 12, 2006 4:48 PM
Subject: Re: [Mono-dev] mono embed: passing arrays from and to unmanaged 
code




On 01/11/06 Davide Morelli wrote:
I'm trying to pass arrays of floats and strings from and to mono embed 
from

a C software with no luck.

I'd need to call (from C) managed functions like:
void TakeManyStrings(string [] list);
void TakeManyFloats(float [] list);

i'd also need to do the same from managed to umnanaged: call a C function
from C# passing an array of strings and floats.

I couldn't find any useful manual page or source code on how to do so..
could anybody point out any reference to me?


See mono/docs/internal-calls.
An array argument passed to an icall will look like a MonoArray*
argument on the C side.
A MonoArray* is a reference so it is passed to managed functions like
any other reference. See mono/samples/embed/*.c for many invocation
examples.

lupus

--
-
[EMAIL PROTECTED] debian/rules
[EMAIL PROTECTED] Monkeys do it better
___
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] SUSE Linux / Installing mono_mod problems

2006-01-13 Thread Joe Audette
I think I have just the tutorial you're looking forhttp://www.joeaudette.com/buildingmonoforaspnetThe error you are getting is because you don't have the appache dev stuff, theres a link to get it in the article.Cheers,Joejoe_audette [at] yahoo dotcom http://www.joeaudette.com http://www.mojoportal.com- Original Message From: S. Shawn Mehaffie [EMAIL PROTECTED]To: mono-devel-list@lists.ximian.comSent: Friday, January 13, 2006 9:08:01 AMSubject: [Mono-dev] SUSE Linux / Installing mono_mod problems   I am using the SUSE Virtual Machine to see how mono works. I have installed mono, and have dow
 nloaded and unzipped the mono_mode. When I try to run the following command ./configure --prefix=/usr to configure the mono mod so I can compile / install it I get the following error: apsx was not found, DSO compilation will not be available. Any help will be appreciated. I think I need to install something else, but not sure what. I used the installation package to install mono, so I was surprised that the mono mod was not installed since it is required for the ASP.Net functionality to work.I am a new Linux user and am very interested in mono and making sure my ASP.Net applications that I write also run under mono. Please be as detailed as possible in any instructions given.<
 /span>I am also interested in any instructions on using the "Automatic configuration of ASP.NET applications with mod_mono"Any help will be appreciated.Thanks  S. Shawn Mehaffie  ___Mono-devel-list mailing listMono-devel-list@lists.ximian.comhttp://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] mono embed: passing arrays from and to unmanaged code

2006-01-13 Thread Robert Jordan

Davide,


- in C
typedef struct atom_simple
{
int a_type;
float float_value;
MonoString *string_value;
};

- in C#
[StructLayout (LayoutKind.Sequential)]
public struct Atom
{
public int type;
public float float_value;
public string string_value;
}

I'd like to put those struct in an array but i need a MonoClass to 
create the MonoArray, something like:


MonoClass *c = mono_class_from_name (image, PureData, Atom);
mono_array_new (domain, c, argc);

but is this the right thing to do? i mean does mono_class_from_name () 
work on struct also?


Yes. After you've allocated the array, you can fill it up using
the mono_array_* macros declared in metadata/object.h.

Robert



if not, is there another way i can create a monoarray ?

sadly the examples in samples/embed don't cover this.

thank you,
Davide.


- Original Message - From: Paolo Molaro [EMAIL PROTECTED]
To: mono-devel-list@lists.ximian.com
Sent: Thursday, January 12, 2006 4:48 PM
Subject: Re: [Mono-dev] mono embed: passing arrays from and to unmanaged 
code




On 01/11/06 Davide Morelli wrote:
I'm trying to pass arrays of floats and strings from and to mono 
embed from

a C software with no luck.

I'd need to call (from C) managed functions like:
void TakeManyStrings(string [] list);
void TakeManyFloats(float [] list);

i'd also need to do the same from managed to umnanaged: call a C 
function

from C# passing an array of strings and floats.

I couldn't find any useful manual page or source code on how to do so..
could anybody point out any reference to me?


See mono/docs/internal-calls.
An array argument passed to an icall will look like a MonoArray*
argument on the C side.
A MonoArray* is a reference so it is passed to managed functions like
any other reference. See mono/samples/embed/*.c for many invocation
examples.

lupus

--
-
[EMAIL PROTECTED] debian/rules
[EMAIL PROTECTED] Monkeys do it better
___
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] AJAX problem with Mono

2006-01-13 Thread Webmaster








Hello all,



I am having some problems installing AJAX in conjunction with Mono. Everything
seems to have went well up until I tried to call a serverside _javascript_
function. I got an error saying object undefined. I then tried to navigate the
SRC of the apparently created _javascript_ include, and there was nothing. I got
an error saying file not found. 



I think I configured my http handlers correctly, at first I was
placing the app in the subdirectory of another Mono app, and so changed it to
its own space on my server. Still generated problems. Ajax is either creating the files and placing
them where I cant see them, or its not creating them at all.



I followed the instructions that came with AJAX implicitly and I am still having
problems. Can AJAX
even be installed on MONO? Does anyone have any success stories?



I know I am calling the registerAjax function properly,
because I get the output in my source. I just cant see where the outputted JS
files are being place.

Another thing too, is AJAX
supposed to place the JS include code right before a FORM object or in the
head? It outputs the JS include right after a form element, could this be a
problem? 



Any help would be greatly appreciated.



Best Regards



Martin Tuncaydin

[EMAIL PROTECTED]








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


Re: [Mono-dev] System.Web.UI/HtmlTextWriter.cs issue

2006-01-13 Thread Gonzalo Paniagua Javier
On Thu, 2006-01-12 at 14:09 -0500, Ben Maurer wrote:
  In this case the return chk(); will be added to the onclick event in
  addition to the validation code there.
 
 1) you should not use .ToLower to do case insensitive compares, but
 String.Compare. Also, you must use the invariant culture.
 
 2) Why would attrName (or the others) ever be null or empty
 
 3) Is onclick the *only* attribute that this happens to?
 
 4) Some of the microsoft code seems to add semicolons for you at the end
 of js statements if you don't. Does this one do that too
 
 5) No patch should ever be made without test cases.

After Ben's Five Commandments, I have this bug here that will probably
be fixed with this patch:

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

-Gonzalo


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


[Mono-dev] Bug 77242

2006-01-13 Thread Robert Jordan

Hey,

This one http://bugzilla.ximian.com/show_bug.cgi?id=77242
might be important to get fixed in the 1.1.13 branch as well.

The ResourceManager's lookup methods are not falling back
to the invariant culture if the current culture != invariant culture
and if the key was not found in the current culture's resources.

Robert

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


Re: [Mono-dev] timer locks up interface..

2006-01-13 Thread Giovanni A. D.
Thanks Michael and Felipe for your help; I'm going to try it.

Also the Idle Handlers thing is something I never heard about and
sounds cool :-)

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


Re: [Mono-dev] timer locks up interface..

2006-01-13 Thread Giovanni A. D.
It works! :-) thanks again.
here is the code, just in case it could be useful to someone else..

-
using System;
using Gtk;
using Glade;

public class GladeApp
{
public static void Main (string[] args)
{
new GladeApp (args);
}

public GladeApp (string[] args)
{
Application.Init ();

Glade.XML gxml = new Glade.XML (null, gui.glade, window1, 
null);
gxml.Autoconnect (this);

button1.Clicked += OnClickButton1;  
button2.Clicked += OnClickButton2;  

timerSetup();
startTimer();
Application.Run ();
}

Int32 timecnt;
bool stopTimer; 

[Glade.Widget]
Button button1;

[Glade.Widget]
Button button2;

[Glade.Widget]
Label label1;   

// Connect the Signals defined in Glade
private void OnWindowDeleteEvent (object sender, DeleteEventArgs a)
{
Application.Quit ();
a.RetVal = true;
}


private void OnClickButton1 (object o, EventArgs e)
{
Console.WriteLine(Start);
startTimer();
}


private void OnClickButton2 (object o, EventArgs e)
{
Console.WriteLine(Stop);
stopTimer=true;
}   


private bool doGlibTimer()
{
Console.WriteLine(- timer - +timecnt.ToString());
label1.Text=timecnt.ToString();
timecnt++;

if (timecnt  10) {
timecnt=1;
}

return !stopTimer;
}


private void timerSetup()
{
timecnt=1;
stopTimer=true;
}


private void startTimer() {
my_timer.Elapsed += new 
System.Timers.ElapsedEventHandler(doTimerClick);

if (stopTimer) {
stopTimer=false;
GLib.Timeout.Add (1000, new GLib.TimeoutHandler 
(doGlibTimer));
}

Console.WriteLine(Timer setup OK);
}

}
-

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


Re: [Mono-dev] timer locks up interface..

2006-01-13 Thread Giovanni A. D.
as you may have guessed.. while copying and pasting i forgot to delete
a line :-P
(hehe.. getting tired)

( this one:
my_timer.Elapsed += new System.Timers.ElapsedEventHandler(doTimerClick);  )

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


[Mono-dev] XSP warning

2006-01-13 Thread Carlos Solorzano
XSP is all of the sudden going crazy for us. All we did is upgrade  
mono and XSP to 1.1.13.0 and now it keeps printing out this warning  
constantly that it never printed before:




** (/usr/local/lib/xsp/1.0/xsp.exe:15518): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15520): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15518): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15515): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15518): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15515): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15518): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15515): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15515): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15518): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15515): WARNING **: icall.c:1020




Does anyone know whats going on?

--Carlos

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


[Mono-list] Help installing mono

2006-01-13 Thread Paddy Joy
Today I compiled mono from svn for the first time  :-)

In order to compile mono I had to have a working mcs so I installed the 
mono-core rpm (I'm running FC4 here). Do I need to remove this package 
before installing my compiled version of mono?


Thanks
Paddy
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Help installing mono

2006-01-13 Thread Enrique Garcia Ayuda
NoI think its a make error like me in Solaris 8, I have installed mono in Fedora 4 but with the http://www.nrpms.net/Docs/Yum/ RPM only install rpm -ivh 
http://repo.nrpms.net/nrpms-mono-release/1/RPMS/nrpms-mono-release-1-5.1.fc4.nr.noarch.rpm orOr better Donwload the file and install in /etc/yum.repos.d/.The good news it' s that in FC5 the mono it's become official
Regardshttp://www.nrpms.net/Docs/Yum/nrpms.repo2006/1/13, Paddy Joy [EMAIL PROTECTED]
:Today I compiled mono from svn for the first time:-)In order to compile mono I had to have a working mcs so I installed the
mono-core rpm (I'm running FC4 here). Do I need to remove this packagebefore installing my compiled version of mono?ThanksPaddy___Mono-list maillist-
Mono-list@lists.ximian.comhttp://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] Profiling web app to find where memory is going

2006-01-13 Thread Mike Glenn
I'm not sure if this is related but there are some terrible inefficiencies in
following two classes

mcs/class/corlib/System.IO/TextWriter.cs
mcs/class/System.Web/System.Web/HttpWriter.cs

I've not had a chance to make a patch yet, so I'll explain so someone else can
if they want to get it done before I can. But suffice to say that how one calls
Write on a TextWriter output stream in XSP/Mod_mono can double your
connections/sec (as it did for me)!

It comes down to this method in TextWriter.cs

public virtual void Write (char[] value)
{
if (value != null) {
for (int i = 0; i  value.Length; ++i)
Write (value [i]);
}
}

Which I think should look like this

public virtual void Write (char[] value)
{
// No if statement needed since TextWriter is abstract 
// the implementing class should take care of checking for null.
Write(value, 0, value.Length);  
}

And then in HttpWriter.cs you have the following method:

public override void Write (char ch)
{
Write(new string (ch, 1));
}

Which was being called by the TextWriter method at the top and was causing a
class creation explosion. I'm not sure what's the best way to fix this method
but by calling the Write(char[] c, int index, int count) instead I was able to
double the connections/sec for my app on XSP.

Mike Glenn





 


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


Re: [Mono-list] calendar webcontrol and culture

2006-01-13 Thread Joe Audette
Try something like this in your Global.asax.cs in Application_BeginRequestCultureInfo culture = new CultureInfo("ca-ES");System.Threading.Thread.CurrentThread.CurrentCulture = culture;Cheers,Joejoe_audette [at] yahoo dotcom http://www.joeaudette.com http://www.mojoportal.com- Original Message From: Pere Rodríguez [EMAIL PROTECTED]To: mono-list@lists.ximian.comSent: Friday, January 13, 2006 1:59:15 AMSubject: [Mono-list] calendar webcontrol and culture Hello, How can I change language of the month in calendar webcontrol? I add culture tag to header asp page: %@ Page language="c#" ... culture="ca-ES" % but it doesn't work. I need ca-ES or es-ES locations. Thanks in advance, pere ___Mono-list maillist-Mono-list@lists.ximian.comhttp://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] Help installing mono

2006-01-13 Thread Paul F. Johnson
Hi,

 In order to compile mono I had to have a working mcs so I installed the 
 mono-core rpm (I'm running FC4 here). Do I need to remove this package 
 before installing my compiled version of mono?

Compiling mono from source can be a bit hectic to say the least and
happily, it's now part of FC5.

For help, http://www.all-the-johnsons.co.uk/mono/mono-building.html (or
is it building-mono - I can't remember!) should have everything you
need. 

Basically

libgdiplus, make, make install
mono/mcs, make get-monolite-latest, make, make install

And that's the core done. What you do next is up to you.

TTFN

Paul
-- 
Logic, my dear Zoe, is merely the ability to be wrong with authority -
Dr Who

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


[Mono-list] SUSE Linux / mono_mod install problems.

2006-01-13 Thread S. Shawn Mehaffie








I am using the SUSE Virtual Machine to see how mono
works. I have installed mono, and have downloaded and unzipped the
mono_mode. When I try to run the following command ./configure
--prefix=/usr to configure the mono mod so I can compile / install it I get the
following error: apsx was not found, DSO compilation will not be
available. Any help will be appreciated. I think I need to install
something else, but not sure what. I used the installation package to install
mono, so I was surprised that the mono mod was not installed since it is
required for the ASP.Net functionality to work.



I am a new Linux user and am very interested in mono and
making sure my ASP.Net applications that I write also run under mono.
Please be as detailed as possible in any instructions given.



I am also interested in any instructions on using the
Automatic configuration of ASP.NET applications with mod_mono



Any help will be appreciated.



Thanks

S. Shawn Mehaffie








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


RE: [Mono-list] Profiling web app to find where memory is going

2006-01-13 Thread Ben Maurer
 I'm not sure if this is related but there are some terrible
 inefficiencies in following two classes

 mcs/class/corlib/System.IO/TextWriter.cs
 mcs/class/System.Web/System.Web/HttpWriter.cs

 I've not had a chance to make a patch yet, so I'll explain so someone
 else can if they want to get it done before I can. But suffice to say
 that how one calls Write on a TextWriter output stream in XSP/Mod_mono
 can double your connections/sec (as it did for me)!

 It comes down to this method in TextWriter.cs

 public virtual void Write (char[] value)
 {
   if (value != null) {
   for (int i = 0; i  value.Length; ++i)
   Write (value [i]);
   }
 }

 Which I think should look like this

 public virtual void Write (char[] value)
 {
   // No if statement needed since TextWriter is abstract
   // the implementing class should take care of checking for null.
   Write(value, 0, value.Length);
 }


I fixed this part of the issue in System.IO. Thanks for pointing this out!

-- Ben


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


Re: [Mono-list] Profiling web app to find where memory is going

2006-01-13 Thread Joshua Tauberer

Ben Maurer wrote:

I'm not sure if this is related but there are some terrible
inefficiencies in following two classes

mcs/class/corlib/System.IO/TextWriter.cs
mcs/class/System.Web/System.Web/HttpWriter.cs


There are also some possibly unnecessary allocations of new byte[1] in 
BufferedStream.ReadByte/WriteByte.  Might be better for the class to 
hold onto a single byte[] to reuse in each call?


--
- Joshua Tauberer

http://taubz.for.net

** Nothing Unreal Exists **


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


[Mono-list] Re: SUSE Linux / mono_mod install problems.

2006-01-13 Thread Robert Jordan

I am using the SUSE Virtual Machine to see how mono works.  I have installed
mono, and have downloaded and unzipped the mono_mode.  When I try to run the
following command ./configure --prefix=/usr to configure the mono mod so I


It actually mod_mono and not mono_mode oder mono mod ;-)


can compile / install it I get the following error: apsx was not found, DSO
compilation will not be available.  Any help will be appreciated. I think I
need to install something else, but not sure what.  I used the installation
package to install mono, so I was surprised that the mono mod was not
installed since it is required for the ASP.Net functionality to work.


You need to install the apache-devel package.


I am a new Linux user and am very interested in mono and making sure my
ASP.Net applications that I write also run under mono.  Please be as
detailed as possible in any instructions given.


You don't need mod_mono if you just want to test and/or develop.
XSP is better suitable for that.

Robert

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


RE: [Mono-list] Mono 1.1.13 has been released.

2006-01-13 Thread Francis Brosnan Blazquez
El mié, 11-01-2006 a las 19:35 +, Bill Seddon escribió:
Hi Bill,

 I have a couple of questions arising from my trials.  The first is to
 ask whether I am the only Windows user of Mono and, if not, am I alone
 in experiencing problems trying to get applications to run?  

I think you are not alone, we are producing applications running on top
of mono and using Gtk# because we want to run .NET applications on
Windows and Linux. I think the main problem you have is that you are
using Windows Forms that is still not complete in mono.

 It's
 reasonable to ask why someone should be interested in running Mono on
 Windows when the original .NET is available.  

Many reasons, first because you can run the same code (we are actually
doing so) on windows [1] and linux platforms. Obviously, something could
fail. What it could be done is to track and report those failures found
so next releases gets better.

From our experience, using Mono + Gtk# to produce windows applications
is getting more a more stable. From the initial releases we started to
use (1.0.5) until now, Mono have increased its quality, and stability. 

But the point is: how alone is a .NET developer when it gets outside
Windows platform? This is critical point to keep in mind if you are
going to be a .NET developer. 

 My reason is that Mono
 applications can be run without an install.  .NET requires a lengthy
 installation (and a reboot with 1.1 SP) that many administrators (if
 not
 users) will not consider.  Mono can be copied on (or even run from a
 memory stick).

This is a good reason.

 The second is to ask if there is enough testing being on Windows.  The
 error in the trivial example below results from trying to return the
 root folder of the drive on which an assembly is located.  If there is
 no real motivation to support Windows, I'd welcome a statement to that
 effect so that know to look for an alternative solution.  Of course,
 I'd
 like Windows to be a supported platform but I can understand that it
 may
 not be priority for Novell.

Maybe it is not a main target for Novell to have a mono platform running
on Windows, but I'm not wrong when I say you that there are lot of
interest on making mono running on Windows. 

Cheers!

[1] http://gmovil.aspl.es
 
-- 
Francis Brosnan Blazquez [EMAIL PROTECTED]
Advanced Software Production Line, S.L.

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


Re: [Mono-list] calendar webcontrol and culture

2006-01-13 Thread Gonzalo Paniagua Javier
On Fri, 2006-01-13 at 08:59 +0100, Pere Rodríguez wrote:
 Hello,
 
 How can I change language of the month in calendar webcontrol?
 
 I add culture tag to header asp page:
 
  %@ Page language=c# ... culture=ca-ES %
 
 but it doesn't work.
 
 I need ca-ES or es-ES locations.

Please, elaborate it doesn't work: what do you expect? what happens?
how to reproduce?

-Gonzalo



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


RE: [Mono-list] Profiling web app to find where memory is going

2006-01-13 Thread Gonzalo Paniagua Javier
On Fri, 2006-01-13 at 09:15 -0500, Mike Glenn wrote:
 I'm not sure if this is related but there are some terrible inefficiencies in
 following two classes
 
 mcs/class/corlib/System.IO/TextWriter.cs
 mcs/class/System.Web/System.Web/HttpWriter.cs
[...]
 And then in HttpWriter.cs you have the following method:
 
 public override void Write (char ch)
 {
   Write(new string (ch, 1));
 }
 
 Which was being called by the TextWriter method at the top and was causing a
 class creation explosion. I'm not sure what's the best way to fix this method
 but by calling the Write(char[] c, int index, int count) instead I was able to
 double the connections/sec for my app on XSP.

The 'problem' in HttpWriter is fixed in svn.
Thanks.

-Gonzalo



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


Re: [Mono-list] calendar webcontrol and culture

2006-01-13 Thread Pere Rodríguez
I expect that month appears in catalan, but it appears in english.

I run aspx page in Monoppix and month appears in catalan, so I think
that the problem is  my instalation.

I run Mono over Debian Sarge and Debian Sid and I have the problem in
the two distributions.

Where I can look for the problem?

Thanks in advance,

2006/1/13, Gonzalo Paniagua Javier [EMAIL PROTECTED]:
 On Fri, 2006-01-13 at 08:59 +0100, Pere Rodríguez wrote:
  Hello,
 
  How can I change language of the month in calendar webcontrol?
 
  I add culture tag to header asp page:
 
   %@ Page language=c# ... culture=ca-ES %
 
  but it doesn't work.
 
  I need ca-ES or es-ES locations.

 Please, elaborate it doesn't work: what do you expect? what happens?
 how to reproduce?

 -Gonzalo



 ___
 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] Application performance question

2006-01-13 Thread Chad Robinson
This is my first foray into Mono (and C#), and I'm impressed. The developers
have done a wonderful job getting things running. I'm sorry if this question
seems lame or has come up before, but I haven't seen it addressed yet;
hopefully somebody can give me some insight.

I have Mono deployed on a Linux Pentium 4 3.2Ghz system with HyperThreading.
Plenty of RAM. Mono version from Web site as of yesterday, using GMCS.

I'm trying to write a performance-sensitive application, so I'm doing some
load testing at a fundamental level. I wrote the fairly simple application
attached below this message. It's pretty obvious. It just creates a collection
keyed with a ulong, and stores 100,000 items in it. It then references 200,000
keys, changing a field if the entry exists, adding a new entry if it doesn't.
(Net 100,000 changed, 100,000 added.) Finally, it deletes all 200,000 of the 
keys.

There are two blocks of code. One uses a traditional Hashtable. The other uses
the generic Dictionary class.

I'm confused. My understanding is that Dictionary is supposed to be much more
efficient here because it doesn't box and unbox. But, when I run the generic
version, it takes 4.18s to run on average, while the Hashtable version takes
2.54s to run. Despite the boxing, the Hashtable runs MUCH faster. This is
running with --optimize=all (doesn't seem to change anything either way).

On a Windows 2000 system with a 3.0GHz non-HyperThreading processor and Visual
Studio 2005, I get what I expect. The Hashtable version still takes about 2.5s
(just slightly faster), but the Dictionary version blows it away at 1.48s,
which is what you'd expect by eliminating the boxing.

My questions is why the Dictionary is so much slower on Linux. Can others
replicate this behavior?

If so, is it a fixable bug, or some other type of problem? I know generics are
part of the IL itself, so perhaps Mono isn't just handling them efficiently?

If that's the case, I can cope with it. I'll just use Hashtable for now, which
provides at least acceptable (and similar) performance across both platforms.
But if I'm doing something wrong, or there's something I can try/fix, I'd love
to know about it.

Regards,
Chad

--

using System;
using System.Collections;
using System.Collections.Generic;

public class Me {
public class MyObject {
public uint u1;
public float f1;
public uint u2;
public uint u3;

public MyObject(uint u1, float f1, uint u2, uint u3) {
this.u1 = u1;
this.f1 = f1;
this.u2 = u2;
this.u3 = u3;
}

public MyObject() {
this.u1 = 1;
this.f1 = 2.5F;
this.u2 = 3;
this.u3 = 4;
}
}

public static void Main() {
DateTime start = DateTime.Now, finish;

/*  
  Dictionaryulong, MyObject dic = new Dictionaryulong, 
MyObject();

MyObject po;

for (ulong i = 0; i  100; i++) {
po = new MyObject();
dic.Add(i, po);
}

for (ulong i = 0; i  200; i++) {
po = null;

if (dic.TryGetValue(i, out po)) {
po.u1 = (uint) i;
} else {
po = new MyObject();
dic.Add(i, po);
}
}

for (ulong i = 0; i  200; i++) {
if (dic.ContainsKey(i))
dic.Remove(i);
}
*/
Hashtable dic = new Hashtable();
MyObject po;

for (ulong i = 0; i  100; i++) {
po = new MyObject();
dic.Add(i, po);
}

for (ulong i = 0; i  200; i++) {
po = (MyObject)dic[i];

if (po != null) {
po.u1 = (uint)i;
} else {
po = new MyObject();
dic.Add(i, po);
}
}

for (ulong i = 0; i  200; i++) {
dic.Remove(i);
}

finish = DateTime.Now;
Console.WriteLine(finish - start);
}
}
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Application performance question

2006-01-13 Thread Michal Moskal
On 1/13/06, Chad Robinson [EMAIL PROTECTED] wrote:
 I'm confused. My understanding is that Dictionary is supposed to be much more
 efficient here because it doesn't box and unbox. But, when I run the generic
 version, it takes 4.18s to run on average, while the Hashtable version takes
 2.54s to run. Despite the boxing, the Hashtable runs MUCH faster. This is
 running with --optimize=all (doesn't seem to change anything either way).

Using custom IEqualityComparer helps a bit (see attached testecase).
Otherwise it is probably Dictionary implementation that is not as
optimized as the Hashtable.

--
   Michal Moskal,
   http://nemerle.org/~malekith/


foo.cs
Description: Binary data
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Re: Application performance question

2006-01-13 Thread Robert Jordan

Michal Moskal wrote:

On 1/13/06, Chad Robinson [EMAIL PROTECTED] wrote:

I'm confused. My understanding is that Dictionary is supposed to be much more
efficient here because it doesn't box and unbox. But, when I run the generic
version, it takes 4.18s to run on average, while the Hashtable version takes
2.54s to run. Despite the boxing, the Hashtable runs MUCH faster. This is
running with --optimize=all (doesn't seem to change anything either way).


Using custom IEqualityComparer helps a bit (see attached testecase).
Otherwise it is probably Dictionary implementation that is not as
optimized as the Hashtable.


It's the runtime. Mono's Dictionary implementation performs very well
under MS.NET 2.0 (about 70% of the performance of MS' implementation).

Robert

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


Re: [Mono-list] calendar webcontrol and culture

2006-01-13 Thread Gonzalo Paniagua Javier
On Fri, 2006-01-13 at 20:58 +0100, Pere Rodríguez wrote:
 I expect that month appears in catalan, but it appears in english.
 
 I run aspx page in Monoppix and month appears in catalan, so I think
 that the problem is  my instalation.
 
 I run Mono over Debian Sarge and Debian Sid and I have the problem in
 the two distributions.
 
 Where I can look for the problem?

Looks like we don't have a es-CA in our culture information tables, but
the data is there (I saw 'dilluns', 'dimarts'... in the file).

Perhaps Atsushi can help here.

-Gonzalo


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


[Mono-list] Partiting cpanel in fedoracore

2006-01-13 Thread Michael James Wright

Hi Folks

I'm running fedoracore 4 on a acer aspire 3610 laptop I have an 80 GB 
harddrive. ? how do i partition the cpanel scheme.


The following partition scheme is recommended:



NOTE: Different partition schemes are suitable for different types of 
hosting. Some servers may require space to be allocated in different ways 
than others. This recommended scheme is an attempt to provide enough space 
for many different types of hosting but it is no substitution for real world 
experience. This partition scheme may need to be varied to suit the needs of 
your specific setup.




/boot   35 Megabytes (Mb)

/usr 4096+ Mb (If you have a 60 gig drive try 6144 for /usr, 8192 if you 
have an 80 gig drive, etc.)


/var 1500+ Mb

/tmp512+ Mb

/   1024 Mb

/home  grow to fill disk

swap2x memory size



NOTE: The /tmp directory is a special directory that is required to be 
writeable by all users and processes on the system. In general, directories 
that are writable by all users and processes are cause for security concern, 
however this directory is a special case. To minimize any security impact as 
a result of having an unsecured /tmp directory, it is recommended that 
/tmp be mounted on a seperate partition in order to take advantage of the 
no exec option available under both Linux and FreeBSD. If a separate mount 
point exists for /tmp, then the installer will verify and potentially 
remount the partition with the no exec option. Additionally, the installer 
will ensure that the sticky bit is set on the directory and that the other 
permissions are correct. If /tmp is not mounted on a separate partition, 
the installer will create a file system disk image of 512 Mb and mount 
/tmp on the newly created disk image with the no exec directive. Under 
most circumstances, 512 Mb is sufficient for the /tmp partition; however, 
your system may require additional space. It is therefore recommended that 
you include a separate partition for the /tmp mount point (sized according 
to your size specification) prior to installing cPanel.


I'm setting up a small webhosting / ISP Business

if someone can help us out that would great

Regards
Michael Wright


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


[Mono-list] Re: fuzzy string comparison library

2006-01-13 Thread Damien Bateman
does anybody know a good library for fuzzy string comparison? Something
that would tell me how different are 2 string:Yes - please see the following for a variety of edit distance algos, including Levenshtein and variants:
http://www.dcs.shef.ac.uk/~sam/stringmetrics.htmlI have not compiled this under mono yet but I'm sure you can find what you are looking for here.--Damien
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Re: Mono-list Digest, Vol 9, Issue 26 sender for your account)

2006-01-13 Thread mono-list . 1 . tracyanne
 Date: Fri, 13 Jan 2006 14:35:42 +
 From: Alexandre Miguel Pedro Gomes [EMAIL PROTECTED]
 Subject: Re: [Mono-list] CONGRATULATIONS - YOU ARE A LUCK WINNER !!!
 To: [EMAIL PROTECTED], [EMAIL PROTECTED], Mr. [EMAIL PROTECTED],
   [EMAIL PROTECTED]
 Cc: mono-list mono-list@ximian.com
 Message-ID:
   [EMAIL PROTECTED]
 Content-Type: text/plain; charset=windows-1252
 
 Like what the hell is this?
 
 On 1/13/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 
  OUR, Ref: ONSWL/2866457223/09
  REF N: EG288124003/05
  BATCH N:WET 88075700152
 
  Dear winner,
 
 RE: LOTTERY BONUS/PROMOTIONS PRIZE AWARDS WINNING
  NOTIFICATION
 
  We are pleased to notify you of the release today as dated of the Euro
  Million  NationalLottery/International Promotions programs held on the 8th
  day of Jan, 2006. Participants were selected through a computer ballot
  system drawn from 98,000 names from Europe, America,Canada, Asia, Australia,

spam, aint it wonderful.

regards

Tracy Barlow
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Help installing mono

2006-01-13 Thread mono
Thanks Paul that's great info, very helpful. It would be great if there was a
link on the wiki for it, I think it would help a lot of people that go to the
mono website looking for compilation help.

Paddy

 Hi,
 
  In order to compile mono I had to have a working mcs so I installed the 
  mono-core rpm (I'm running FC4 here). Do I need to remove this package 
  before installing my compiled version of mono?
 
 Compiling mono from source can be a bit hectic to say the least and
 happily, it's now part of FC5.
 
 For help, http://www.all-the-johnsons.co.uk/mono/mono-building.html (or
 is it building-mono - I can't remember!) should have everything you
 need. 
 
 Basically
 
 libgdiplus, make, make install
 mono/mcs, make get-monolite-latest, make, make install
 
 And that's the core done. What you do next is up to you.
 
 TTFN
 
 Paul
 -- 
 Logic, my dear Zoe, is merely the ability to be wrong with authority -
 Dr Who
 
 ___
 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-v4l

2006-01-13 Thread Corbin Hoenes
Is there some library that will allow me to do video capture under linux / mono? (e.g a C# binding for video4linux?)
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list