Re: [Mono-list] How to add "properties" back

2010-04-26 Thread Christopher David Howie
On 04/25/2010 09:48 PM, Stephen Liu wrote:
> I'm running monodevelop to learn "Stetic GUI Designer
> (Would it be "Static GUI Designer"?).

Actually, it is called Stetic.

> Accidentally I deleted
> "Properties" leaving only "Tools" behind. I have been looking around to
> add it back without result. Please help. TIA

Check in the View menu.  It lists all of the pads that MonoDevelop
supports.  It might be "View > Properties" or "View > Pads > Properties"
depending on which version of MD you are using.  (I lose track of where
it is in which version...)

If it's not at any of those two places, poke around in the View menu;
it's in there somewhere.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

PGP key:

pub   2048R/CF8338F5 2010-04-14
  Fingerprint: 2B7A B280 8B12 21CC 260A  DF65 6FCE 505A CF83 38F5
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] shell does not work on Widnwos Vista

2010-04-27 Thread Christopher David Howie
On 04/27/2010 07:10 AM, Stephen Liu wrote:
> On Windows Vista, create a shortcut of IE and rename it as;
> 
> \Users\satimis\iexplore.lnk
> 
> 
> iexplore.lnk works on "Command Prompt" window but didn't work on "mono 
> Command Prompt" nor on my small program.

The command prompt does a bit of trickery so that you can "run"
shortcuts.  The Windows APIs Mono uses to start programs don't do such
magic.

In short, unless the program is in your PATH, you can't run it without
specifying the full path to it.  This is not any different than on Linux.

(To introduce another side-case, note that Start>Run also looks in the
HKEY_CLASSES_ROOT\Applications registry key.  I'm still not sure exactly
how MS sells this kind of overconfigurability a benefit, but meh.)

In short, Process.Start() is not exactly the best place to experiment
with if your goal is to create a truly cross-platform application, since
it has platform-specific semantics.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

PGP key:

pub   2048R/CF8338F5 2010-04-14
  Fingerprint: 2B7A B280 8B12 21CC 260A  DF65 6FCE 505A CF83 38F5
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Best audio library for Mono?

2010-04-27 Thread Christopher David Howie
On 04/25/2010 12:12 PM, Steve Ricketts wrote:
> What library would you recommend for C# in Mono on a Linux platform to do the
> following things:
> 
> 1. Convert byte arrays between PCM and GSM 6.10
> 2. Play PCM or GSM on speakers from byte arrays
> 3. Capture byte arrays from microphone
> 4. Write PCM or GSM byte arrays to local file
> 
> These functions are necessary to integrate a C#, Mono, Linux application
> into an existing Windows system.  I want to capture audio from either a mic
> or a RF USB receiver and send over IP to be played remotely.
> 
> Thanks for any advice or direction you can provide.

Honestly, the best approach that I can think of would be to write a C
glue library between your application and something like GStreamer
(which is a portable library itself).  This is the approach that Banshee
uses and it seems to work quite well.

GStreamer is full of all manner of nifty things you can use to convert
just about anything to just about anything else, and do other
interesting things in between, like volume normalization.

Obviously, you have to compile your glue for each target platform, and
you will have to distribute GStreamer too, at least on non-Linux
platforms where it's not as easily installable.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

PGP key:

pub   2048R/CF8338F5 2010-04-14
  Fingerprint: 2B7A B280 8B12 21CC 260A  DF65 6FCE 505A CF83 38F5
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Best audio library for Mono?

2010-04-27 Thread Christopher David Howie
On 04/27/2010 12:07 PM, Steve Ricketts wrote:
> It looks like there is a gstreamer-sharp binding but I can't find any
> information on how to use it.  I've posted on the GStreamer forum asking
> where I can find more information on these bindings (not really sure what a
> binding is) but no response yet.  If anyone here knows how to use it or
> where to go for information, I'd sure love to know.

My understanding is that gst-sharp is either very slow-moving or dead
altogether.  I have never seen anything more than a proof-of-concept app
that uses it.

> Regarding glue...  I was thinking that I could write a shared object library
> (.so) in c, using something like GStreamer to do the heavy lifting, and then
> call that unmanaged code from C#.  

Yup, that's exactly what Banshee does.  Do all the tricky pointer stuff
in C, and export a nice, clean set of functions for C# to consume.  If
you want to look at an example, look at the libbanshee sources in
Banshee.  Most of the consumption of this library is in the GStreamer
PlayerEngine.  (I forget where it is in the source tree, but "find
-iname gstreamer\*.cs" should locate it.)

> This will only be on Linux, so distributing GStreamer would be no problem. 
> Actually, we have a lot of control over the platforms that this would run
> on.

Ah, I misread your initial message.  I thought you wanted to run this on
Linux and Windows, but upon rereading it, it is actually quite clear
that you just want to *talk* to a Windows system from Linux.

Yeah, I would definitely go with GStreamer.  :)

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

PGP key:

pub   2048R/CF8338F5 2010-04-14
  Fingerprint: 2B7A B280 8B12 21CC 260A  DF65 6FCE 505A CF83 38F5
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] shell does not work on Widnwos Vista

2010-04-27 Thread Christopher David Howie
On 04/27/2010 01:17 PM, Stephen Liu wrote:
>> The command prompt does a bit of trickery so that 
>> you can "run" shortcuts.  The Windows APIs Mono uses 
>> to start programs don't do such magic.
> 
> 
> On Window Vista I have created a shortcuts of IE on;
> C:\Program Files\Internet Explorer\iexplore.exe
> 
> rename it as iexplorelnk and put it on;
> C:\Users\satimis\
> 
> 
> Afterwards on "Command Prompt" executing iexplorelnk starts IE.  But on the 
> window of my small program, "shell.exe", it still fails.

Based on what I just told you, this is the behavior I would expect.  The
APIs Mono uses do not know what shell links are.  You cannot run shell
links with Process.Start().

> However following commands;
> 
> cmd
> explorer (Windows explorer)
> calc (calcultor0
> ipconfig
> etc.
> 
> which work on "Command Prompt" also work on my program.  But on the top box 
> of the small window I must type;
> 
> explorer explorer
> calc calc
> ipconfig ipconfig
> etc.
> 
> to make them work.  The command must be repeated otherwise the small window 
> will crash.

Crash how?  (Hint: If something is crashing, it is almost always helpful
to give us a stack trace, otherwise all we can usually do is guess at
what's wrong.)

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

PGP key:

pub   2048R/CF8338F5 2010-04-14
  Fingerprint: 2B7A B280 8B12 21CC 260A  DF65 6FCE 505A CF83 38F5
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] shell does not work on Widnwos Vista

2010-04-27 Thread Christopher David Howie
On 04/27/2010 03:19 PM, Robert Jordan wrote:
> On 27.04.2010 20:51, Christopher David Howie wrote:
>> Based on what I just told you, this is the behavior I would expect.  The
>> APIs Mono uses do not know what shell links are.  You cannot run shell
>> links with Process.Start().
> 
> Of course you can.

Hmm, this has never worked for me.  Perhaps I wasn't doing something
right...

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

PGP key:

pub   2048R/CF8338F5 2010-04-14
  Fingerprint: 2B7A B280 8B12 21CC 260A  DF65 6FCE 505A CF83 38F5
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] MonoDevelop 2.4 Beta 1 released

2010-05-06 Thread Christopher David Howie
On 05/06/2010 09:06 PM, Mike Christensen wrote:
> When I'm debugging, I use the Immediate window quite a bit to "mock up
> code" before I change my program, and some polishing up on the
> MonoDevelop immediate window would go a long way.  The more this could
> be like Visual Studio, the better.  (I'm sure you guys hear that one a
> lot).  Any chance of fixing some of these issues before the final
> bits?  Thanks!!

Hopefully even support lambdas and loops, neither of which the VS
immediate window supports, but that Mono's interactive csharp compiler
has supported for a long time...

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

PGP key:

pub   2048R/CF8338F5 2010-04-14
  Fingerprint: 2B7A B280 8B12 21CC 260A  DF65 6FCE 505A CF83 38F5
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] MonoDevelop 2.4 Beta 1 released

2010-05-07 Thread Christopher David Howie
On 05/07/2010 08:08 AM, Lluis Sanchez Gual wrote:
> The immediate window is just an expression evaluator, no code generation
> is involved. I might be able to hack support for loops, but there is no
> way we can support lambdas.
> 
> To fully support the interactive csharp compiler, it would have to be
> loaded in the debugged process, but that would be very intrusive and
> would do more harm than good.

That's a shame, lambda support is incredibly useful when debugging LINQ
code.  :(

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

PGP key:

pub   2048R/CF8338F5 2010-04-14
  Fingerprint: 2B7A B280 8B12 21CC 260A  DF65 6FCE 505A CF83 38F5
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Newbie question on basic configuration

2010-05-10 Thread Christopher David Howie
On 05/10/2010 07:02 PM, Rogers wrote:
> My  httpd.conf reads (mono stuff only)
> 
> LoadModule mono_module modules/mod_mono.so   
> AddHandler mono .aspx .ascx .asax .ashx .config .cs .asmx .axd
> MonoApplications  default "foo"
> 
> It is that last line that is tripping me up.  I've seen 2 different
> implementations and nothing I've tried has worked.

I'm not sure if I'll be able to assist as I haven't used mod_mono *very*
much, but it would definitely help to know the following info:

* What values of "foo" have you tried?

* What happened when you tried each value?

* What did you expect to happen?

* What do the logs show for each value?

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

PGP key:

pub   2048R/CF8338F5 2010-04-14
  Fingerprint: 2B7A B280 8B12 21CC 260A  DF65 6FCE 505A CF83 38F5
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] howto debug cpu leak from commandline?

2010-05-11 Thread Christopher David Howie
On 05/11/2010 03:37 AM, Esben Laursen wrote:
> I have a program that collects some syslog information and analyzes
> that. My problem is that suddenly it consumes all cpu cores 100% This
> happens from time to time sometime after 10 minutes some after
> 12hours. My problem is that I develop in VS2008 and run the software
> primarily on Linux using mono. I have not yet seen it fail in
> Windows, but that might just be a coincidence.
> 
> So is there any way I can debug this on the Linux system, I have used
> dotTrace in Windows and that was great, is there a similar tool for
> mono?

I have not used dotTrace, but I know that the mono runtime has a --trace
option that might be useful.  Note that it will spew a LOT of output, so
you might want to run it like so:

mono --trace --debug yourapp.exe 2>&1 | bzip2 > yourapp.log.bz2

Note that this will show no output on the console; it will all go into
the log file, together with the trace output.

Then when the application hangs, kill the mono process so that bzip2 can
clean up.  Then to view the log:

bzip2 -d -c yourapp.log.bz2 | less

Hit "end" and poke around to see what it was up to when you killed it.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

PGP key:

pub   2048R/CF8338F5 2010-04-14
  Fingerprint: 2B7A B280 8B12 21CC 260A  DF65 6FCE 505A CF83 38F5
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Newbie question on basic configuration

2010-05-11 Thread Christopher David Howie
On 05/11/2010 06:05 PM, Rogers Hellman wrote:
> Chris:  I replied back to you directly, but haven't heard back.  
> Perhaps stuck in your spam box.

No, it's in my inbox, I'm just at work and am otherwise occupied.

Also, please reply to the list too when you reply to somebody.  Nobody
else knows what you told me and so they can't chime in with ideas.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

PGP key:

pub   2048R/CF8338F5 2010-04-14
  Fingerprint: 2B7A B280 8B12 21CC 260A  DF65 6FCE 505A CF83 38F5
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Recommended approach for embedding VLC in a Mono app?

2010-05-14 Thread Christopher David Howie
On 05/14/2010 08:20 AM, Steve Ricketts wrote:
> I need to use VLC in a Mono application.  I've been to the VLC forums and
> can't find how to actually do it in Mono.  There seem to be a number of
> competing approaches (videolan.interop, libvlcnet, c# wrapper) but most of
> these projects seem to be abandoned.  I would like to ask if anyone has used
> VLC in a Mono application and if so, how was it done... sample code would be
> even better!  ;-)
> 
> Any advice or direction would be greatly appreciated.

If the target platform is Linux then you should consider using GStreamer
instead.  It is pretty much the de-facto standard media library for
Linux these days and is incredibly powerful, beyond just playing media
(though it can do that as well).

Unfortunately, there are no usable managed bindings to it yet.  You can
write a C glue library to do what you need though.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

PGP key:

pub   2048R/CF8338F5 2010-04-14
  Fingerprint: 2B7A B280 8B12 21CC 260A  DF65 6FCE 505A CF83 38F5
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Recommended approach for embedding VLC in a Mono app?

2010-05-14 Thread Christopher David Howie
On 05/14/2010 10:34 AM, Daniel Morgan wrote:
> Personally, I think the banshee project should release their C# 
> bindings to gstreamer and other media systems so others could use it
> in their projects.

The Banshee binding to GStreamer is highly Banshee-specific.  It *could*
theoretically be made more generic, but right now it's not very
practical to re-use them in other projects.

But hey, if you want to take a stab at doing so, check out the C#
backend

and the corresponding C glue library
.  Good luck!

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

PGP key:

pub   2048R/CF8338F5 2010-04-14
  Fingerprint: 2B7A B280 8B12 21CC 260A  DF65 6FCE 505A CF83 38F5
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Administrator privileges for my App when running from MonoVS

2010-05-17 Thread Christopher David Howie
On 05/17/2010 06:42 PM, ivancmz wrote:
> Our application uses the serial port to communicate with an external
> embedded device, and from what I've seen, in order to have access to the
> serial port, it needs Administrator privileges.

A quick-and-dirty approach would be to change the permissions on the
/dev/ttyS... device so that the user you are using to debug has read and
write permission.  On Debian these files are owned by the "dialout"
group.  If OpenSuse has a similar group, just add your user to it.  Then
make sure you log out and back in so the group membership change takes
effect.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses you are
agreeing that I am, by definition, "the intended recipient," and that I
may do whatever I wish with the contents of any message you send me,
unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Administrator privileges for my App when running from MonoVS

2010-05-17 Thread Christopher David Howie
On 05/17/2010 11:18 PM, ivancmz wrote:
> Thanks Christopher, I found that in OpenSuse ttyS0 is owned by the
> group "uucp", so I added my user to this group and it worked... I
> have access to the serial port, so thank you very much this is one
> big step... but like you said this is quick-and-dirty approach...

My apologies, I meant that changing the permissions (making the device
world-readable and world-writable) was quick-and-dirty.  Adding users to
groups that have access to devices is the proper way to grant
permissions to access such devices.  When possible, your users should
take this route.

> it would be kind of difficult for me to ask my clients to change 
> their users settings, if that's the way to do it, I'll have to write 
> a tutorial for them xD... but does anyone have another idea?

If you really want to you can write a shell script that tests if the
user has read and write access to the serial port.  If they do, it just
runs your program.  Otherwise, it runs gksu or su to invoke your Mono
app as root.

This is probably the cleanest mechanism if you don't want to require
that your users properly assign groups to users, since it separates the
authentication and authorization steps from your app entirely.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses you are
agreeing that I am, by definition, "the intended recipient," and that I
may do whatever I wish with the contents of any message you send me,
unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] AOT Compiling a .NET assembly

2010-06-02 Thread Christopher David Howie
On 06/02/2010 10:10 PM, MrUnleaded wrote:
> I know that mono has somethings to do AOT compilation and I was curious
> as to how/where in the PE/CLI structure any native code is put and if
> there is some documentation on that anywhere.

AOT code is put into a file whose name is the same as the assembly, with
.so added to the end.  This file is understood only by Mono; the .NET
runtime will not use it.

> I would imagine it would have some relation to the ManagedNativeHeader
> that is referenced in ECMA335 on page 179 but I haven't been able to
> find anything on it other then that DataDirectory/RVA is always 0.

This is for native code compiled into the assembly, which I think is
used primarily by Managed C++.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses you are
agreeing that I am, by definition, "the intended recipient," and that I
may do whatever I wish with the contents of any message you send me,
unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Problems with mkbundle and generating a single executable file

2010-06-04 Thread Christopher David Howie
On 06/04/2010 03:54 AM, Extreme Developer wrote:
> I have written a program in C# and after a lot of efforts I could make
> it compatible with mono and now I can run it on Linux without any
> problem but the problem is that I need to run my software on a cluster
> which is not located at my university so this might be impossible that I
> have access to mono on that system. What I need to do is to run my C#
> program on Linux but as a single executable file without calling mono
> simultaneously.

Just as a side note, be aware that this create an architecture-dependent
binary, so if the cluster cannot run binaries of your system's
architecture, mkbundle will not help you much.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses you are
agreeing that I am, by definition, "the intended recipient," and that I
may do whatever I wish with the contents of any message you send me,
unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] how to "register" a c++ class to c#?

2010-06-06 Thread Christopher David Howie
On 06/06/2010 09:46 PM, 冶晶邓 wrote:
> hi,dear all:
>   i'm an absolutely newbie to mono. when i'm working with lua and
> python, i often write many c++ classes to implement some core logic,
> then "register" them to script. in lua, its metatable can be used for
> simulating the class mechanism. in python, there's a builtin type system
> and corressponding c api for this. then what should i do if i want this
> to work in mono c#? where can i find some samples or tutorials? thanks
> very much!

Since pretty much every C++ compiler uses a different name-mangling
algorithm, there is no simple way to use C++ classes from C#.
Basically, you will need to write a C++ library that wraps all of the
class' methods in C-exported functions.  Or, you might try using SWIG,
which is able to generate such libraries automatically for the most part
.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses you are
agreeing that I am, by definition, "the intended recipient," and that I
may do whatever I wish with the contents of any message you send me,
unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] how to "register" a c++ class to c#?

2010-06-06 Thread Christopher David Howie
On 06/06/2010 11:13 PM, 冶晶邓 wrote:
> hi,David! i don't think we need facing the name-mangling problem,
> because i just need a way to "export" a C function pointer to c# at
> runtime, by placing the "&" operator before a function name, i can get
> its address, then pass it as an userdata to C# and when call in C#, it
> should pass the userdata back to me so i can make a call to the real
> function.
> as i know , all the above is implemented as the "P/Invoke" now, but what
> i need additonally is how to create a C# class on the fly, then use some
> C functions to pretend as its method. is this ok?

I'm confused.  Are you trying to embed Mono in another program, or are
you trying to use a C++ class from C#?  The "direction" you are trying
to do things will change the approach you need to take.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses you are
agreeing that I am, by definition, "the intended recipient," and that I
may do whatever I wish with the contents of any message you send me,
unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] how to "register" a c++ class to c#?

2010-06-07 Thread Christopher David Howie
On 06/07/2010 10:19 AM, 冶晶邓 wrote:
> thanks,Jedd!
> i think i have understood the code  you supplied.
> i wonder if we can create a C# class with some C-API instead of directly
> defining it in C#? just like python who enables us to create new type by
> filling a PyType struct and pass it to PyType_Ready call.
> is that exists?

You technically do have this capability, but this would not be very
helpful to people who want to code against this class.  Since C# is at
heart a static language, it needs to know how types are defined in
advance for other developers to make use of them.

However, you can define a public *interface* in an assembly, and then
emit a completely new class that implements this interface at runtime.
This is a very common technique when writing bindings for remoting
protocols in .NET; the bindings let the user define an interface that
also defines the RPC interface they want to use, then the bindings
implement that interface on a transparent proxying class
behind-the-scenes.  The user only needs to know about the interface type
in advance, not the implementation.

So, for example, if your class has "public: void foo(); void bar();"
then you could define in an assembly:

public ISomeClass
{
void Foo();
void Bar();
}

Then you can emit a new class at runtime that will effectively be:

class SomeClass : ISomeClass
{
private delegate void FooCallback();
private delegate void BarCallback();

private FooCallback fooCallback;
private BarCallback barCallback;

public SomeClass(FooCallback fooCallback, BarCallback barCallback)
{
this.fooCallback = fooCallback;
this.barCallback = barCallback;
}

public void Foo()
{
fooCallback();
}

public void Bar()
{
barCallback();
}
}

This approach has the strong advantage that you are free to reimplement
this interface a different way in the future if your internal binding
needs to change.

Note that I'm not terribly familiar with libmono, so I won't be able to
provide the calls required to emit this class and to obtain and call the
constructor.  (Were it 100% C# I would...)  Perhaps someone else can
chime in with that info.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses you are
agreeing that I am, by definition, "the intended recipient," and that I
may do whatever I wish with the contents of any message you send me,
unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] how to "register" a c++ class to c#?

2010-06-07 Thread Christopher David Howie
On 06/07/2010 12:04 PM, 冶晶邓 wrote:
> now i should consider to write an interface/class generator for my c++
> class~

Which is exactly what SWIG will do for you.  :)

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses you are
agreeing that I am, by definition, "the intended recipient," and that I
may do whatever I wish with the contents of any message you send me,
unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] pinvoke to clutter function

2010-06-14 Thread Christopher David Howie
On 06/14/2010 07:37 AM, Daniel Hughes wrote:
> Unix Transport Error
> Eventally I would like to get the error reporting working so I can get
> the gerror result however firstly I need to get past the Unix
> Transport Error.

To supplement Robert's response, this error usually means that the
debugging connection to your application was unexpectedly terminated,
usually due to a segmentation fault.  Try running it either outside MD
as Robert suggested, or run it not in debug mode (select "Run" instead
of "Debug").

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] PathTooLongException workaround for mono?

2010-06-15 Thread Christopher David Howie
On 06/15/2010 04:12 AM, David S wrote:
> While I personally have not hit the max character boundry, my
> application should probably know how to avoid that considering its
> nothing but IO operations. The only information I have found was a msdn
> page about Windows API calls I could use on
> windows http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath.
> So, im guessing I have to find some Linux and Mac API calls and just
> deal with the different OSes?

Yeah.  Btw, Google rocks for that:
.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses you are
agreeing that I am, by definition, "the intended recipient," and that I
may do whatever I wish with the contents of any message you send me,
unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] PathTooLongException workaround for mono?

2010-06-15 Thread Christopher David Howie
On 06/15/2010 02:23 PM, David S wrote:
> Thats cool and everything, but I want to be able to go past the C# limit
> on path size.

I am not aware of any such limit, except for the limit on the size of
strings.  AFAIK, any path size limit is imposed by the underlying
operating system.

(And if I turn out to be wrong, you can always use Mono.Posix to
directly call fopen etc.)

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Classic ASP and data access to a MDB database

2010-06-23 Thread Christopher David Howie
On 06/23/2010 06:17 AM, Jorge Bastos wrote:
> What should the handle for classic ASP?
> 
> “AddType application/x-asp-net .asp” ?

mod_mono does not support classic ASP, as classic ASP is not IL-compiled
and in general is a totally different web development paradigm.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Some issues with mono 2.0

2010-06-25 Thread Christopher David Howie
On 06/25/2010 06:27 AM, dugc wrote:
> I am running Mono 1.9.1 on Ubuntu 8.10, using Apache (pre-fork) 2.2.9.

To supplement Alan's response, 1.9.1 was released over two years ago.
I've been using Mono since around the 1.2.6 release, and in pretty much
every release stability goes up and memory consumption goes down.  (With
the exception of a few regressions here and there, and fixes for them
make it into a .x release pretty quickly.)

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Installing latest mono on Debian 5.0.5

2010-07-09 Thread Christopher David Howie
On 07/09/2010 03:05 AM, Andrus wrote:
> I tried but  svn does not exist. Then I tried
> apt-get install svn
> 
> but got package not found error.

Because the package is subversion, not svn.  packages.debian.org is your
friend.

> Virtual server has 256 MB of RAM , 30 GB disk space, 64 bit . Can mono 
> compiled in this server ?

I don't see why it couldn't... more RAM would be better but it won't
cause any immediate problems during compilation.

> Where to find step by step instructions for vanilla Debian 5.05 ?

The general process I use is:

1. Run "./configure".
2. If this fails, install the package it needs and goto 1.
3. Run "make && make install".

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Installing latest mono on Debian 5.0.5

2010-07-09 Thread Christopher David Howie
On 07/09/2010 09:57 AM, Christopher David Howie wrote:
> 3. Run "make && make install".

Sorry, this should be:

3. Run "make".
4. If there are no errors, run "su -c 'make install'".

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] SerialPort.ReadTimeout = 0

2010-07-20 Thread Christopher David Howie
On 07/20/2010 06:03 AM, Daniel Hughes wrote:
> Should I raise a bug? would it do any good? The last bug I raised on
> the mono serial port implementation still exists and has seen no
> activity for over a year now.

Bug reports for obscure areas of the framework (like serial ports, which
I'd be surprised if 1% of developers using Mono actually used) stand a
better chance of being fixed in Mono if you provide a patch that fixes
the issue yourself.  :)

For something this simple, I'm sure the patch will be pretty
straightforward.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Mono w/GLib & GObject

2010-07-29 Thread Christopher David Howie
On 07/29/2010 08:25 AM, Adam Tauno Williams wrote:
> Is there any intro-to-the-GObject-mindset docs for C#/.NET/Mono? Or
> any good examples for this-is-how-you-use-Gobject-and-why? I'd
> really appreciate some pointers.

If you are developing a new application, you shouldn't be creating
GObject classes, unless you need to subclass something to work with e.g.
Gtk#.

If your intent is to learn Gtk#, the basic idea is make sure you
.Destroy() things when you're done with them.  Destroying a container
will destroy any contained widgets, so for example you usually only call
Destroy on a dialog when you're done with it, and that will also free
all the widgets it contains.

Basically, just jump in and start coding.  The bindings are pretty good
when it comes to keeping the C ugliness away from you.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] How to compile existing Visual Studio 2010 C# .NET using Mono?

2010-08-03 Thread Christopher David Howie
On 08/03/2010 04:30 AM, Woodgnome wrote:
> Taking it from there to compiling the above is a bit beyond my skills with
> Mono and the question is then, how to do this?
> 
> I have all of the Visual Studio project files available...
>
> Also, if you think there's another approach that makes more sense than this,
> I'm interested in comments on that as well.

It sounds like all you really need to do per-request is:

* Create a temporary directory somewhere.

* Copy the project files into this directory.

* Alter whatever file needs to be altered.

* Run xbuild from inside that directory.

* Package up the output according to your needs.

There's no reason you need to use ASP.NET to do this; anything that can
run commands should work just fine, so if you're a PHP guy, just use PHP.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Segmentation Faults when trying to run OBD 2007.exe

2010-08-08 Thread Christopher David Howie
On 08/08/2010 10:27 PM, Abe Gillespie wrote:
> Two, the app "P/Invokes" into a native Windows library. Issue two
> unfortunately cannot be magically fixed but it can be checked by
> running it through MoMA.

Just as a side note, if Wine provides a compatible-enough implementation
of the API being P/Invoked, installing the Windows version of Mono
inside of Wine and then running the application on that Mono install
*can* (but still may not) work.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Ubuntu

2010-08-10 Thread Christopher David Howie
On 08/10/2010 10:03 AM, Christopher Monroe wrote:
> I'll second the complaint about the forum constantly refreshing the
> browser. It's useless in Opera. I'm forced to use Firefox. It's
> completely baffling as to why they display it the way the do.

I think you guys both meant to bring this up here
, right?

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Ubuntu

2010-08-10 Thread Christopher David Howie
On 08/10/2010 06:34 PM, Daniel Hughes wrote:
> No one expects mono to be pushed out as a automatic update on ubuntu.
> We do however expect a PPA which is on even footing with windows, mac
> etc. I.E same day support to the same quality. And supported by the
> mono team.

It is not the Mono project's job to cater to every existing Linux
distribution.  It's up to the distributions to package software for
themselves.

That is all.

(Also, I'm rather curious why you emailed me instead of the list,
especially when I was originally addressing the Nabble issues.)

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Question about encoding and tricky stuff.

2010-08-23 Thread Christopher David Howie
On 08/23/2010 08:25 PM, Rampage wrote:
> this way the hash matches perfectly but obviously once the stream is read
> it's gone, and since i need both to render the image and calculate the md5
> it's going to be an issue.
> 
> do you have anything to suggest me?

Stream stream; // this is your input stream

var md5 = MD5.Create();
using (var wrap = new CryptoStream(stream, md5,
   CryptoStreamMode.Read)) {
// Process the "wrap" stream how you would process the original data
// stream.

wrap.FlushFinalBlock();

// The "md5" object contains the hash state.
}

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Extension method not found

2010-08-31 Thread Christopher David Howie
On 08/31/2010 11:49 PM, Dr_Asik wrote:
> I want to correct something I just said. ProjectB did not use any 
> other extension methods. I tried using another one and got the same 
> error. So I am unable to use any extension method from ProjectA in
> ProjectB (although ProjectA uses them without issues). However, the 
> decompilation error only happens with the method I listed; other 
> extension methods decompile fine.

Does ProjectB use *any* extension methods?  If so, do they work?

If not, check if ProjectB references System.Core.  If it does not then
this may be the cause of your compilation errors, since the attribute
that designates a method as an extension method is declared in
System.Core.  (The "this" syntax for declaring extension methods is
actually just syntactic sugar for the application of this attribute.)

If you can compile under VS without referencing System.Core then this
could be considered a Mono bug.

And, as a final note, if this doesn't work, or if you are already
referencing System.Core, then try to create a solution that reproduces
the problem with minimal code.  It's a bit hard to assist without having
something we can tinker with and try to fix.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Program start shows MS-DOS header error message

2010-09-10 Thread Christopher David Howie
On 09/10/2010 09:46 AM, Andrew K. wrote:
> Within the loaded dlls a function tries to load an additional dll
> (at startup time) which is written in Visual C++ and .NET 3.5.

Mono does not support mixed-mode assemblies, aka Managed C++ or C++/CLI,
when not compiled with /clr:pure.  If you did not compile it with this
option then Mono doesn't know what to do with it, since it is not pure IL.

http://www.mono-project.com/CPlusPlus

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Playing audio files

2010-09-13 Thread Christopher David Howie
On 09/13/2010 11:04 PM, ChrisB wrote:
> Hi, I wish to play audio files from my application running under
> Mono on openSUSE 11.1. I have looked at the System.Media.SoundPlayer
> class but that seems to be very limited in the file formats it
> supports. I have also investigated using wrappers for other
> applications without success.
> 
> My requirements are very basic in that I just wish to be able to 
> play/stop the audio files and nothing more. I do not have a 
> requirement to play any video files.

There are two approaches that come to mind:

* The Banshee approach.  There is a library written in C that provides
the glue between Banshee and GStreamer, an open-source library that can
(among a wealth of other things) play sound files.  The glue library is
the only one that you should P/Invoke, and it will need to be compiled
for each platform.  (Windows support for GStreamer can be tricky.)

* The MPlayer approach.  I do not know much about this personally,
having spent much more time hacking on the Banshee library.  But I've
heard from others that you can embed an MPlayer instance within your
application with relatively little effort.  I don't recall whether this
is a cross-platform solution or not.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Text to Speech using Mono

2010-09-20 Thread Christopher David Howie
On 09/20/2010 10:19 AM, Atsushi Eno wrote:
> There is no Windows Speech API on Linux or any other platforms than
> windows.

The only thing that I can think of for Linux would be the festival
program, which you can script.  But it won't be a proper API; you will
have to use Process.Start() etc.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Mono programs fail to exit with NVIDIA OpenCL

2010-09-20 Thread Christopher David Howie
On 09/20/2010 12:00 PM, ccoish wrote:
> I have a minimal (~100 line) program I could post if that will help.

What would help more is to get the program stuck and then then the mono
process SIGQUIT.  This will dump a stack trace from the program, which
you could attach to help us analyze where it's getting stuck.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Create a file with execute permission?

2010-09-23 Thread Christopher David Howie
On 09/23/2010 06:36 AM, kevink wrote:
> I create a .sh file and try to execute it with Process.Start() in my app.
> This is failing as the file is created without the "Execute" permission. Is
> there a way to specify this in C# on mono?

Since this is a Unix-ism, I doubt there will be an API in the
standardized framework for this.  But you can use the Mono.Unix library,
specifically the Mono.Unix.Native.Syscall.chmod() method to accomplish this.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] MonoDroid/MonoTouch for FLOSS/hobby development?

2010-10-01 Thread Christopher David Howie
I'm interested in using the MonoDroid/MonoTouch technologies,
specifically MonoDroid, for developing F/LOSS software.  However, with
the current pricing model of MonoTouch ($399/year for one developer)
this is incredibly cost-prohibitive.

As the Android platform is more open, are there any plans to make
MonoDroid available for free or at a substantially reduced cost for
hobbyist/FLOSS developers?  I'm not paying 400 bucks so I can write
stuff for fun on my own time.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] MonoDroid/MonoTouch for FLOSS/hobby development?

2010-10-05 Thread Christopher David Howie
On 10/05/2010 07:14 AM, Daniel Hughes wrote:
> So I guess we just have to sit back and wait to see what happens.

Especially considering the patent shitstorm that's been started against
Android.  :(

Oddly enough, my Windows Mobile 6 phone is looking pretty good right
about now... I can write managed apps for free and there is no
restrictive OS.  Unfortunately it is a crashy OS... oh well.

I digress.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] System.Net.NetworkInformation: network availability

2011-01-26 Thread Christopher David Howie
On 01/10/2011 03:34 AM, Mattia Vitturi wrote:
> This application needs to recognize if it is working online or offline so on
> my Windows side I added this lines of code:
> 
> var netState = NetworkInterface.GetIsNetworkAvailable();

Are you sure that "GetIsNetworkAvailable()" is answering the right
question?  Perhaps it would be better to test if the application's
server is reachable -- the user may be on *some* network, but still may
not be able to reach the required server.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] HttpWebRequest.GetResponse() can trigger an uncatchable exception

2011-07-08 Thread Christopher David Howie
Hello Gonzalo/List:

For reference, see this SO post:
.

This bug has existed since at least 2.8 and continues to exist in
2.20.2.  It's a blocker for me, so I've been investing a bit of time
digging into the class libraries to try to come up with a fix.  I'm not
sure exactly what I'm doing though, and would like to probe for other
ideas about the proper way to fix this.

The basic problem is that HttpWebRequest.GetResponse(), whether invoked
asynchronously or not, will make its own async calls.  One of these down
the line results in a callback to WebRequest:ReadDone(IAsyncResult).
This callback has a slim chance to throw an ArgumentOutOfRangeException,
which is not caught, and therefore kills the entire application.  There
is no workaround for this problem, since it happens in framework code on
a separate thread; the developer cannot catch it.

I have been doing my research on the 2.10.2 tag, so my line numbers will
correspond with that commit.  Here's what I know:

* mcs/class/System/System.Net/WebConnection.cs:477 is
"stream.ReadBufferOffset = pos;".
* :479 calls stream.CheckResponseInBuffer() which, down the line, uses
the ReadBufferOffset in a call to Buffer:BlockCopy(), which is not happy
about the negative argument (this triggers the ArgumentOutOfRangeException).
* pos is declared and set to -1 on :438.
* pos can be set to the result of WebConnection:GetResponse(byte[],int)
on :443, but this is dependent on "cnc.readState == ReadState.None".
Additionally, GetResponse() can return -1.

So it seems there are several opportunities for this pos variable to
have the negative value that triggers the exception.  I'm unsure exactly
how to fix this -- set stream.ReadBufferOffset to zero if pos is less
than zero?  I'm not very familiar with what this code is doing, but I'm
pretty certain that if pos winds up being negative and
stream.CheckResponseInBuffer() winds up being called, this will kill the
whole application.

Input and possible fixes would be appreciated.  I want to fix this!  :)

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] HttpWebRequest.GetResponse() can trigger an uncatchable exception

2011-07-08 Thread Christopher David Howie
On 07/08/2011 10:43 AM, Gonzalo Paniagua Javier wrote:
> Do you have a small test case that reproduces the problem?

No, unfortunately.  This happens in maybe one out of a few thousand
requests.  The only test case I can really come up with is "make lots of
web requests on different threads until a crash happens."  I will poke
around a bit and see if I can come up with a better repro, but it's just
too intermittent to predict.  I suspect that it is dependent on a socket
error to trigger.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] HttpWebRequest.GetResponse() can trigger an uncatchable exception

2011-07-10 Thread Christopher David Howie
 On Sat, 9 Jul 2011 11:50:34 -0400, Gonzalo Paniagua Javier wrote:
> Not much I can do without a test case.

 I know.  :(  The worst bug is the one that only happens once in a blue 
 moon.

> I'd say that this is a problem reusing a connection and somehow 2
> threads "own" the same stream. Set KeepAlive to false (and increase
> the number of file descriptors! (ulimit)) and see if you can still
> reproduce the problem. If it does not happen, bingo! Reduce the
> 'maxconnections' setting via app.config file to 1 and begin as many
> requests as possible to the same URL. If you can reproduce it this
> way, it's easier to find when 2 threads are using the same stream.

 I'm using the following code:

 -->8--
 using System;
 using System.Linq;
 using System.Net;
 using System.Threading;

 internal class Program
 {
 private static string url;

 private const int THREAD_COUNT = 1000;

 private static void Main(string[] args)
 {
 ServicePointManager.DefaultConnectionLimit = 1;

 url = args.Length > 0 ? args[0] : "http://localhost/";;

 var threads = new Thread[THREAD_COUNT];

 for (int i = 0; i < THREAD_COUNT; i++) {
 threads[i] = new Thread(WorkerThread);
 threads[i].Start();
 }

 for (int i = 0; i < THREAD_COUNT; i++) {
 threads[i].Join();
 }
 }

 private static void WorkerThread()
 {
 for (;;) {
 var request = (HttpWebRequest)WebRequest.Create(url);
 request.KeepAlive = false;

 try {
 using (request.GetResponse())
 Console.Write('.');
 } catch {
 Console.Write('!');
 }
 }
 }
 }
 -->8--

 So far (10+ minutes) no exception has been thrown by this test.  I'd be 
 open to suggestions on how to tweak it.

> Also check the values of the variables involved in that BlockCopy 
> call
> and the values of readBuffer* before the call.

 I know that readBufferOffset is -1.  I'm not sure about the others.  If 
 we can get a consistent repro then I'll be able to check pretty easily.

-- 
 Chris Howie
 http://www.chrishowie.com
 http://en.wikipedia.org/wiki/User:Crazycomputers

 If you correspond with me on a regular basis, please read this 
 document: http://www.chrishowie.com/email-preferences/

 PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5

 
 IMPORTANT INFORMATION/DISCLAIMER

 This document should be read only by those persons to whom it is 
 addressed.  If you have received this message it was obviously addressed 
 to you and therefore you can read it.

 Additionally, by sending an email to ANY of my addresses or to ANY 
 mailing lists to which I am subscribed, whether intentionally or 
 accidentally, you are agreeing that I am "the intended recipient," and 
 that I may do whatever I wish with the contents of any message received 
 from you, unless a pre-existing agreement prohibits me from so doing.

 This overrides any disclaimer or statement of confidentiality that may 
 be included on your message.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list