[Mono-list] Debugging binding Obj-C?
I'm having problems binding a precompiled third party framework. I keep getting a dyld error about being unable to find the library but it only shows the error after I've done the binding, added the library to a project, compiled the project and deployed it to the device, watched it crash, and looked at the error log on the device. Is there a way to test the binding as soon as the dll is made? How would I make sure the binary blob is included and adjust the path reference internally in the dll to make sure it's correct? Sent from my iPad ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] Abstract Async binding?
Is there a reason that when binding Obj-C it isn't possible to use both the Async and Abstract attributes on the same method? Thanks, Michael McGlothlin Sent from my iPhone ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] Native number types but not general number type?
With the addition of native number types I have returned to an old line of thought about why C# doesn't have a general Number type with other number types in some sort of hierarchy under it. Obviously there are times when using a very specific number type is important for performance or compatibility but usually I don't really care. I probably don't care if the number is represented as 32 bits or 64 bits, if it's signed or not, if it is whole numbers or fractional, etc. So long as the behavior is correct when casting to a more specific type I'd rather it just work with the least amount of effort. Likewise I'd like to more easily use lossless numbers of unlimited size, including fractional values, when needed and easy manipulation of numbers into different representations (such as byte order, different ways of storing the sign, etc). Something similar to changing text encodings. A general number type seems it'd ease portability even more than native types. It was mentioned that Mono may push for these native types to made standard. Is there a technical reason a general number type couldn't be, or shouldn't be, introduced? Not asking anyone to actually doing it so much as trying to understand the problem. Sent from my iPad___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-dev] making mono builds reproducible (xamarin bz #26842)
I'd always store time in epochs. Seconds since 1/1/1970 GMT. The use of textual date strings instead of a epochs is one of the worst things I've seen from the C# way of doing things. I had often wondered why so many programs could have so much trouble with handling dates and times correctly.. Sent from my iPad On Feb 16, 2015, at 4:19 PM, Daniel Kahn Gillmor d...@fifthhorseman.net wrote: Hi Mono folks-- some good discussion has come up on the xamarin bugtracker about being able to make builds using the mono toolchain reproducible: https://bugzilla.xamarin.com/show_bug.cgi?id=26842 Jo Shields offered a one-liner fix to PEWriter.cs to allow the use of an environment variable to fix the timestamp epoch, but made it clear that more feedback is needed, so i'm raising it here: from: public DWORD TimeDateStamp = (uint)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds; to: public DWORD TimeDateStamp = Environment.GetEnvironmentVariable(IKVM_WRITER_TIMESTAMP_EPOCH) != null ? uint.Parse(Environment.GetEnvironmentVariable(IKVM_WRITER_TIMESTAMP_EPOCH)) : (uint)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds; (i'm not sure whether the integer number of seconds is the best form for the environment variable, or whether it would be better to parse a standard date string -- from debian's perspective, we can deal with either, of course) And this still doesn't solve the secondary issue of the assembly GUID, as Jo noted. Any thoughts about how to best enable binary-reproducible builds from the mono toolchain if the invoker requests them? Regards, --dkg ___ 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-list] Sandbox
Might look at the csharp tool as it lets you run in more of a scripting style. You could probably add to it to build in special security and error handling. Thanks, Michael McGlothlin Sent from my iPhone On Jan 15, 2015, at 2:55 PM, Ollhax oll...@gmail.com wrote: Sounds like a good plan, but the problem is that I can't do step # 3 - /create a new AppDomain with low security permissions/. Just to be sure the documentation is not old, I installed Ubuntu and ran the example in the end of this article: http://msdn.microsoft.com/en-us/library/bb763046%28v=vs.110%29.aspx (slightly modified since the GetHostEvidence stuff isn't supported, and tried creating a file instead). Worked fine on Windows (threw an exception), but sandboxing was not done in Mono. I also played a little with the --security setting, but no luck. Perhaps it's possible to make Roslyn not accept bad code instead? I.e. restrict which assemblies you use to a bare minimum, don't build unsafe code, and so on. Not sure how safe it would be, but I'm giving it a try. -- View this message in context: http://mono.1490590.n4.nabble.com/Sandbox-tp4665163p4665240.html Sent from the Mono - General mailing list archive at Nabble.com. ___ 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] Specific thread for event?
I had the general idea of making an event that would invoke every handler in its list on the thread it was registered from. So I added accessors that'd store the thread and set things up so when I invoke the handlers it'd use those threads .. only there seems to be no way to run code on a specific thread in C# (possibly if I did something unsafe with internal threading?) as far as I can see. I messed around with the ExecutionContext and various other things but none seems to let you interrupt a running thread, do something, and resume. The best I have been able to manage is having the main UI thread get special treatment in iOS. That's actually what I want but I'd like a more universal solution as it's likely I'll have other components that are picky about what thread they're on. Seems like having events raised on the correct thread automatically would be a good behavior and avoid a lot of boilerplate code. Obviously something has been done with iOS to make it possible to access the main thread. Am I missing something or is this pretty much a deadend? Sent from my iPad ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] Native types nullable?
I'm experimenting with switching from Classic to Unified API for iOS. It doesn't seem there are implicit casts from nullable int?, float?, etc to nint, nfloat, etc. Any reason these couldn't be added? Thanks, Michael McGlothlin Sent from my iPhone ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-dev] Proposed changes to mono/mcs/class/corlib/Mono/DataConverter.cs
How would I access your new version (In a different branch or such?)? How long until the changes will filter through to the NuGet package! Thanks, Sent from my iPad On Dec 9, 2014, at 8:25 AM, Miguel de Icaza mig...@xamarin.com wrote: Hey, I have a variation of this patch now. I need to rebuild my Mono before i can commit it. It will use a conditional compiler directive to use this other system On Mon, Dec 8, 2014 at 11:53 PM, Stephen Shaw ss...@decriptor.com wrote: I can't comment on the code changes themselves, but it would be helpful to fork mono on github and then create a Pull Request (PR) with your changes. Cheers, Stephen On Mon, Dec 8, 2014 at 8:54 PM, Michael McGlothlin mike.mcgloth...@gmail.com wrote: Couldn't figure out how to get Xamarin Studio to create an actual patch file after trying, and failing, to push a change with git. It appears this is the correct place to post this? I usually put most of my code in PCL and then call it from platform specific code so I'm trying to make DataConverter happy as PCL. To make DataConverter compile as PCL I had to change Encoding.UTF7 to Encoding.GetEncoding ( utf-7 ) and the numeric calls to 12000 and 12001 on GetEncoding() to the string-based utf-32 and uff-32BE. These three changes had to be made twice as there are two variants using this same code. I also changed ArrayList to Listobject to make PCL happy. case '7': e = Encoding.GetEncoding (utf-7); n = 1; break; case '3': e = Encoding.GetEncoding (utf-32); n = 4; break; case '4': e = Encoding.GetEncoding (utf-32BE); n = 4; break; static public IList Unpack (string description, byte[] buffer, int startIndex) { DataConverter conv = CopyConv; var result = new Listobject (); int idx = startIndex; bool align = false; int repeat = 0, n; ___ 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-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] Proposed changes to mono/mcs/class/corlib/Mono/DataConverter.cs
Couldn't figure out how to get Xamarin Studio to create an actual patch file after trying, and failing, to push a change with git. It appears this is the correct place to post this? I usually put most of my code in PCL and then call it from platform specific code so I'm trying to make DataConverter happy as PCL. To make DataConverter compile as PCL I had to change Encoding.UTF7 to Encoding.GetEncoding ( utf-7 ) and the numeric calls to 12000 and 12001 on GetEncoding() to the string-based utf-32 and uff-32BE. These three changes had to be made twice as there are two variants using this same code. I also changed ArrayList to Listobject to make PCL happy. case '7': e = Encoding.GetEncoding (utf-7); n = 1; break; case '3': e = Encoding.GetEncoding (utf-32); n = 4; break; case '4': e = Encoding.GetEncoding (utf-32BE); n = 4; break; static public IList Unpack (string description, byte[] buffer, int startIndex) { DataConverter conv = CopyConv; var result = new Listobject (); int idx = startIndex; bool align = false; int repeat = 0, n; DataConverter.cs Description: Binary data ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-list] Marshaling a struct with network byte order?
Is there any common way to correctly marshal a struct such that the resulting bytes are in network byte order? I have a file format that requires this order for compatibility. Currently I'm storing each chunk as a struct and am using Marshal to convert it to/from bytes. Seems to work fine other than being little endian. Is there something like a MarshalAs attribute for controlling byte order? Couldn't find a general .NET/C# way other than doing it with Array.Reverse() each time. I thought Mono might have dealt with such a cross platform issue itself.. Sent from my iPad ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Binding Cocoa examples?
Where is the BaseType attribute defined? Xamarin Studio doesn't seem to include it in either Mono or Xamarin Mac versions. The only binding template I see is for iOS. Thanks, Michael McGlothlin Sent from my iPhone On Nov 19, 2014, at 7:02 PM, Miguel de Icaza mig...@xamarin.com wrote: hey, You can see it here: http://github.com/mono/monomac Go to src/appkit.cs to see the binding for NSView. On Sat, Nov 15, 2014 at 1:28 PM, Michael McGlothlin mike.mcgloth...@gmail.com wrote: I'm trying to figure out how to bind to obj-c and c and for my first exercise I decided to bind to Apple's ScreenSaverView and make a screensaver. I'm trying to do this with Xamarin Studio and their Sharpie app but not having much luck. Where can I look to see Mono's actual binding to classes such as NSView? What I'd actually do I mean and not something generated. Thanks, Michael McGlothlin Sent from my iPhone ___ 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
Re: [Mono-list] Cross-Platform GUI Tookit
I'd like to see a good semantic system that'd make it easy to map to actual controls individual to the platform and apply styling. Thanks, Michael McGlothlin Sent from my iPhone On Nov 15, 2014, at 10:01 AM, Edward Ned Harvey (mono) edward.harvey.m...@clevertrove.com wrote: From: mono-list-boun...@lists.ximian.com [mailto:mono-list- boun...@lists.ximian.com] On Behalf Of IBBoard In theory, yes, but in practice then it was always a little flaky on Linux, had rendering issues on anything but simple layouts, and had at least one major issue I can think of on OS X. Also, a recent post [1] said that it was based on deprecated technology and that you shouldn't expect [it] to come back to life. Windows.Forms is the oldest and junkiest thing available, even on Windows. It's even worse on mono because it's buggy, and worse still on OSX because it requires X11. Not to mention, it looks like hell on any platform. So no. Windows.Forms is not a good answer for cross-platform GUI. The aforementioned Eto.Forms is some kind of wrapper that allows you to design your GUI and run the same code on iOS, Mac OSX, Linux GTK# 2 or 3, and Windows.Forms and WPF. I say again, I haven't used it yet and can't advocate it right now - but it's the right idea going in the right direction. Just hope to have more than one option to compare. ___ 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] Binding Cocoa examples?
I'm trying to figure out how to bind to obj-c and c and for my first exercise I decided to bind to Apple's ScreenSaverView and make a screensaver. I'm trying to do this with Xamarin Studio and their Sharpie app but not having much luck. Where can I look to see Mono's actual binding to classes such as NSView? What I'd actually do I mean and not something generated. Thanks, Michael McGlothlin Sent from my iPhone ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] BinaryFormatter with PCL?
Is there any way to use BinaryFormatter with portable classes? I have as much of my code as possible portable so I can do iOS, Android, etc but I'm trying to serialize objects and it's a lot more trouble than I expected. I can push a BinaryFormatter object but it still doesn't work because the Serializable attribute isn't set and I can't figure out a way to get the platform specific code to push it in a way I can use it as an attribute. Thanks, Michael McGlothlin Sent from my iPhone ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] MemoryMappedFile not supported?
I'm experimenting with writing a local service that I need to be reasonably fast. I'd like it to work on Windows, Mac OS, and Linux at least. I've never written a service in C# but the first thing I tried for IPC was using memory mapped files. Immediately I got a complaint that what I was doing wasn't supported under Mono because it didn't jive with Unix.. so I switched to creating from a file (as the previous error message told me to do) but it seems if the file exists it dies with an error about the file already existing and if the file doesn't already exist it dies with an error that the file doesn't exist. Is this just plain not the right way to make a fast local service in C#? I'd be ok with using pipes or IPC sockets if it is a better idea but in Googling it seemed that C# had made these rely on networking for some reason. Michael McGlothlin___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] Changing basic file io?
If I wanted to replace the standard libraries for file io with my own is there a way to push my replacement in so that it'd fill that role without needing to rewrite every program, and third-party library, that uses file io? I guess there must be some way since Mono exists at all. I get annoyed when programs lose data or corrupt files so I have a transactional wrapper that makes snapshots and logs changes. Sent from my iPad ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Xamarin Open Source License
It would be nice if Xamarin took a bit more pity on open source developers and hobby developers. I've been using a business version, at work, for Xamarin.iOS. I would like to explore other platforms, continuing to educate myself, and maybe work on some open source stuff. Even the indie licenses are pretty steep for non-commercial development. At the least it'd be nice if you had access to all platforms for non-commercial use when you purchased a license for commercial use on anything. Sent from my iPad On May 9, 2014, at 5:37 AM, lytico lyt...@users.sourceforge.net wrote: Is there an Open Source License, and who does it get? I appealed at http://resources.xamarin.com/open-source-contributor.html my project: https://github.com/limada/limada my profile: https://github.com/lytico After some weeks and asking again 2 times per e-mail, I got this (auto-generated?) answer: Thank you for your interest in contributing to the mobile C# open source developer community. Xamarin's open source contributor subscription offer is limited to active developers on established open source projects. Based on your current activity on this project, it does not appear that you are eligible for a non-commercial subscription. ... etc. etc. So, is there that open source program? And if, who are this active developers on established open source projects? remark: I am even a (indirect) contributor to what I'll get: see https://github.com/mono/xwt/commits?author=lytico ; xwt is part of Xamarin Studio cheers lytico -- View this message in context: http://mono.1490590.n4.nabble.com/Xamarin-Open-Source-License-tp4662728.html Sent from the Mono - General mailing list archive at Nabble.com. ___ 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
Re: [Mono-list] Porting Microsoft.Reporting.WinForms to Mono?
I've used Gtk under Linux so I'd guess Gtk# might be similar? I'm already trying to figure out how to mesh together the C# way of doing things with the iOS, Android, etc way while maximizing code reuse. Keep finding myself cycling through different methods or rolling my own but not sure what the best way is. Lots to process. Thanks, Michael McGlothlin Sent from my iPhone On Mar 5, 2014, at 10:56 AM, Andy York a...@brdstudio.net wrote: I would like to warn you that learning some of the Gtk# API was a challenge for me at first because I was stuck in the Microsoft way of doing things. Once I learned how to use Gtk# effectively I loved it but not at first. For example the Gtk.TreeView does not work anything like WinForms.GridView and everyone I know who tried to make the Gtk.TreeView work like a WinForms.GridView didn't succeed but preferred the Gtk.TreeView + Gtk.TreeStore methods in the end. In the long run it feels to me like Gtk# is easier to use MVC techniques on than WinForms so if you have the time to learn the Gtk# API I recommend it very highly for cross platform development. This is just the opinion of a humble developer nothing more. From: Miguel de Icaza mig...@xamarin.com Sent: Wednesday, March 05, 2014 11:47 AM To: Michael McGlothlin mike.mcgloth...@gmail.com Subject: Re: [Mono-list] Porting Microsoft.Reporting.WinForms to Mono? Hey, Mono has an implementaiton of Windows.Forms, but it is both old, unmaintainted and known to have some bugs. Some people have been able to use it effectively, but we do not currently have an active maintainer, so we encourage developers to pick something like Gtk# instead. On Thu, Feb 27, 2014 at 3:21 PM, Michael McGlothlin mike.mcgloth...@gmail.com wrote: [Intro: I'm somewhat new to C# and am much more familiar with Linux and MacOS than Windows. In the past few months I've been learning C# to develop Xamarin.iOS apps and simply trying to wrap my mind around this combination of C# and iOS stuff that doesn't always make sense to someone that's been doing command-line and server-side Unix, Python, and JavaScript stuff mostly.] I've been asked to fix, update and make portable an app build around Microsoft.Reporting.WinForms. From searching I see a bunch of old posts saying that Mono doesn't support WinForms but nothing very recent. I don't really know much about it so my basic question is if there is an easy fix (add the needed assembly somewhere) and if not what is the recommended way to handle porting? I had nothing to do with writing this app and it's fairly large, complex, and seems poorly written but as much as I'd like to do a total remit it's probably not the best strategy at the moment. Sent from my iPad Michael McGlothlin ___ 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 maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] Porting Microsoft.Reporting.WinForms to Mono?
[Intro: I'm somewhat new to C# and am much more familiar with Linux and MacOS than Windows. In the past few months I've been learning C# to develop Xamarin.iOS apps and simply trying to wrap my mind around this combination of C# and iOS stuff that doesn't always make sense to someone that's been doing command-line and server-side Unix, Python, and JavaScript stuff mostly.] I've been asked to fix, update and make portable an app build around Microsoft.Reporting.WinForms. From searching I see a bunch of old posts saying that Mono doesn't support WinForms but nothing very recent. I don't really know much about it so my basic question is if there is an easy fix (add the needed assembly somewhere) and if not what is the recommended way to handle porting? I had nothing to do with writing this app and it's fairly large, complex, and seems poorly written but as much as I'd like to do a total remit it's probably not the best strategy at the moment. Sent from my iPad Michael McGlothlin ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list