[Mono-dev] [PATCH] Support for heads with absolute URLs in Monologue
I didn't find a product for Monologue on BNC so here's the patch. Please review, can I commit? Thanks, Andres -- Index: ChangeLog === --- ChangeLog (revision 99902) +++ ChangeLog (working copy) @@ -1,5 +1,14 @@ 2008-03-11 Andrés G. Aragoneses [EMAIL PROTECTED] + * worker/monologue-worker.cs: Support absolute URLs for heads, + use String.Empty instead of , and fix some indentation. + * worker/default.tpl: move local path for heads into the .cs + file in order to support absolute URLs. + * worker/Makefile: Use gmcs, since now we use String.IsNullOrEmpty + and Uri.IsAbsoluteUri. + +2008-03-11 Andrés G. Aragoneses [EMAIL PROTECTED] + * worker/bloggers.xml: Corrected the accent (HTMLish). 2008-03-11 Andrés G. Aragoneses [EMAIL PROTECTED] Index: worker/monologue-worker.cs === --- worker/monologue-worker.cs (revision 99902) +++ worker/monologue-worker.cs (working copy) @@ -206,6 +206,20 @@ static string error_msg = div class='ircnick' style='color:red'Error retrieving/loading feed/div; static string date_error_msg = div class='ircnick' style='color:red'Invalid dates in feed/div; static string error_img = img src='images/error.png' alt='Error retrieving/loading feed'; + + static string ProcessHeadEntryAndReturnUrl(string head) + { + string localHeadsPath = images/heads/; + + if (String.IsNullOrEmpty(head)) + head = none.png; + + if (!((new Uri(head, UriKind.RelativeOrAbsolute)).IsAbsoluteUri)) + head = localHeadsPath + head; + + return head; + } + static void Render () { Template tpl = new Template(default.tpl); @@ -216,16 +230,13 @@ tpl.setField (BLOGGER_ERROR_IMG, b.Error || b.DateError ? error_img : ); tpl.setField (BLOGGER_URL, b.HtmlUrl.ToString ()); tpl.setField (BLOGGER_NAME, b.Name); - - if (b.Head != null) -tpl.setField (BLOGGER_HEAD, b.Head); - else -tpl.setField (BLOGGER_HEAD, none.png); + tpl.setField (BLOGGER_HEAD, ProcessHeadEntryAndReturnUrl(b.Head)); + if (b.IrcNick != null) - tpl.setField (BLOGGER_IRCNICK, b.IrcNick); -else - tpl.setField (BLOGGER_IRCNICK, ); +tpl.setField (BLOGGER_IRCNICK, b.IrcNick); + else +tpl.setField (BLOGGER_IRCNICK, String.Empty); tpl.setField (BLOGGER_RSSURL, b.RssUrl); @@ -251,10 +262,7 @@ else tpl.setField (ENTRY_PERSON_IRCNICK, ); - if (bl.Head != null) - tpl.setField (ENTRY_PERSON_HEAD, bl.Head); - else - tpl.setField (ENTRY_PERSON_HEAD, none.png); + tpl.setField (ENTRY_PERSON_HEAD, ProcessHeadEntryAndReturnUrl(bl.Head)); tpl.setField (ENTRY_PERSON_URL, bl.HtmlUrl.ToString()); } else { Index: worker/default.tpl === --- worker/default.tpl (revision 99902) +++ worker/default.tpl (working copy) @@ -29,7 +29,7 @@ div class=entry div class=person-info a href=@@ENTRY_PERSON_URL@@ - img class=face src=images/heads/@@ENTRY_PERSON_HEAD@@ alt=@@ENTRY_PERSON_IRCNICK@@/ + img class=face src=@@ENTRY_PERSON_HEAD@@ alt=@@ENTRY_PERSON_IRCNICK@@/ br /br / @@ENTRY_PERSON@@ br /@@ENTRY_PERSON_IRCNICK@@ @@ -68,7 +68,7 @@ h2Bloggers/h2 ul !-- @@BLOGGER@@ -- -li@@BLOGGER_ERROR_IMG@@divimg class=head src=images/heads/@@BLOGGER_HEAD@@ alt=@@BLOGGER_IRCNICK@@ //div +li@@BLOGGER_ERROR_IMG@@divimg class=head src=@@BLOGGER_HEAD@@ alt=@@BLOGGER_IRCNICK@@ //div a href=@@BLOGGER_URLBLOGGER_NAME@@/a div a href=@@BLOGGER_RSSURL@@img src=images/feed.png alt=@@BLOGGER_IRCNICK@@ feed/a Index: worker/bloggers.xml === --- worker/bloggers.xml (revision 99902) +++ worker/bloggers.xml (working copy) @@ -150,5 +150,9 @@ Blogger Name=Rusty Howell RssUrl=http://rustyhowell.blogspot.com/feeds/posts/default/-/mono?alt=rss; IrcNick=rusty/ Blogger Name=Calvin Gaisford RssUrl=http://calvinrg.blogspot.com/feeds/posts/default/-/mono?alt=rss; IrcNick=calvin Head=calvin.png/ Blogger Name=Sandy Armstrong RssUrl=http://automorphic.blogspot.com/feeds/posts/default?alt=rss; IrcNick=sandy Head=sandy.png/ - Blogger Name=Andres G. Aragoneses RssUrl=http://knocte.blogspot.com/feeds/posts/default?alt=rss; IrcNick=knocte / + Blogger Name= Andres G. Aragoneses + RssUrl = http://www.blogger.com/feeds/13199395/posts/summary/-/Mono?alt=rss; + IrcNick = knocte + Head= http://www.mono-project.com/files/5/54/Knocte.png; + / /BloggerCollection Index: worker/RSS.NET.dll === Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: worker/Makefile === --- worker/Makefile (revision 99902) +++ worker/Makefile (working copy) @@ -1,4
[Mono-dev] Mono 1.9 / MD Idea
Hi folk I have folowed this step and have a little trouble. My system is MDV 2008, after a fresh install i had Mono 1.25 and MD , located in /usr/ dir, i think about trying mono 1.9, so uninstall all rpm, download the linux generic install from mono and install it in /opt/ dir. When starting MD in the good environment (/opt/) i have error message about file in /usr/lib/monodevelop So i delete/clean evrything in ~/.config about MD/Mono and then no more problem, so i conclude there is some config file with absolute path and/or environment var. It isn't possible to use the startup path than the one in the config files? ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] string marshalling conversion 34 not implemented
Hello Josh, You didn't post the signature of your pinvoke function, but it looks like you are trying to marshal a string using UnmanagedType.VBByRefStr. This does seem to be a limitation in mono (and not fixed in svn head), however the docs seem to indicate that this should only be used for VB compatibility. If you are changing/return the string in unmanaged, you need to use a StringBuilder. If you are only passing a string in, you can just pass a string (and specify the native string type). See this great page on the wiki for more info: http://www.mono-project.com/Interop_with_Native_Libraries Thanks, Jonathan 2008/4/4 Josh [EMAIL PROTECTED]: Mono is throwing me the error string marshalling conversion 34 not implemented when I'm attempting to call a function to libvlc.dll from my code. The other calls to the DLL work fine, but the AddTarget Function causes the error. I'm getting the same results on both Windows and Linux versions. [AddTarget Function] === public Err AddTarget(string Target) { if ((m_iVlcHandle == -1)) { m_strLastErr = LibVlc is not initialzed; return Err.NoInit; } Err enmErr = Err.Success; try { enmErr = VLC_AddTarget(m_iVlcHandle, Target, null, 0, (int)Mode.Append, (int)Pos.Close); } catch (Exception ex) { m_strLastErr = ex.Message; return Err.Execption; } if (((int)enmErr 0)) { m_strLastErr = VLC_Err((int)enmErr); return enmErr; } // OK return Err.Success; } === [Mono Details - Windows] === Mono JIT compiler version 1.9 (tarball) Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com TLS: normal GC:Included Boehm (with typed GC) SIGSEGV: normal Notification: Thread + polling Architecture: x86 Disabled: none === [Mono Details - Linux] === Mono JIT compiler version 1.9 (tarball) Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com TLS: __thread GC:Included Boehm (with typed GC) SIGSEGV: normal Notifications: epoll Architecture: x86 Disabled: none === Any ideas? Might this be fixed in HEAD? I'm also up to using a different media player that is known to work in mono. Josh ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] string marshalling conversion 34 not implemented
On Sat, Apr 5, 2008 at 3:42 PM, Jonathan Chambers [EMAIL PROTECTED] wrote: Hello Josh, You didn't post the signature of your pinvoke function, but it looks like you are trying to marshal a string using UnmanagedType.VBByRefStr. This does seem to be a limitation in mono (and not fixed in svn head), however the docs seem to indicate that this should only be used for VB compatibility. If you are changing/return the string in unmanaged, you need to use a StringBuilder. If you are only passing a string in, you can just pass a string (and specify the native string type). See this great page on the wiki for more info: http://www.mono-project.com/Interop_with_Native_Libraries Thanks, Jonathan 2008/4/4 Josh [EMAIL PROTECTED]: Mono is throwing me the error string marshalling conversion 34 not implemented when I'm attempting to call a function to libvlc.dll from my code. The other calls to the DLL work fine, but the AddTarget Function causes the error. I'm getting the same results on both Windows and Linux versions. [AddTarget Function] === public Err AddTarget(string Target) { if ((m_iVlcHandle == -1)) { m_strLastErr = LibVlc is not initialzed; return Err.NoInit; } Err enmErr = Err.Success; try { enmErr = VLC_AddTarget(m_iVlcHandle, Target, null, 0, (int)Mode.Append, (int)Pos.Close); } catch (Exception ex) { m_strLastErr = ex.Message; return Err.Execption; } if (((int)enmErr 0)) { m_strLastErr = VLC_Err((int)enmErr); return enmErr; } // OK return Err.Success; } === [Mono Details - Windows] === Mono JIT compiler version 1.9 (tarball) Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com TLS: normal GC:Included Boehm (with typed GC) SIGSEGV: normal Notification: Thread + polling Architecture: x86 Disabled: none === [Mono Details - Linux] === Mono JIT compiler version 1.9 (tarball) Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com TLS: __thread GC:Included Boehm (with typed GC) SIGSEGV: normal Notifications: epoll Architecture: x86 Disabled: none === Any ideas? Might this be fixed in HEAD? I'm also up to using a different media player that is known to work in mono. Josh ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list Jonathan, I think that the code I'm using was converted from a VB source. Here is the VB PInvoke function I dug up from that code: [code] Private Declare Function VLC_AddTarget Lib libvlc (ByVal iVLC As Integer, ByVal Target As String, ByVal Options() As String, ByVal OptionsCount As Integer, ByVal Mode As Integer, ByVal Pos As Integer) As Err [/code] That URL you provided looks like it's going to be spot-on what I need to fix the problem, thank you!. If I come across any other issues I'll post back. Also, if anyone knows of a working mono sample using libvlc it would be much appreciated. Thanks again. Josh ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] errors compiling from svn
Hi All, I'm using the 1.9 VM and trying to compile Mono from svn head r99904 I'm getting this error, any suggestions to help me get past it much appreciated. make[8]: Entering directory `/home/linux/share/src/mono/mcs/tools/tuner' touch tune.stampt MONO_PATH=.:../../class/lib/default:$MONO_PATH /home/linux/share/src/mono/mono/runtime/mono-wrapper --debug ../linker/monolinker.exe -d ../../class/lib/net_2_1_raw -o ../../class/lib/net_2_1 -l none -c link -a smcs -b true -m display_internalized false -x Descriptors/mscorlib.xml -x Descriptors/smcs.xml -x Descriptors/System.xml -s Mono.Tuner.InjectAttributes,Mono.Tuner:OutputStep -s Mono.Tuner.AdjustVisibility,Mono.Tuner:OutputStep -s Mono.Tuner.PrintStatus,Mono.Tuner:OutputStep -s Mono.Tuner.RemoveSerialization,Mono.Tuner:OutputStep -s Mono.Tuner.CheckVisibility,Mono.Tuner -i masterinfos/silverlight/mscorlib.info -i masterinfos/silverlight/System.info -i masterinfos/silverlight/System.Core.info -i masterinfos/silverlight/System.Xml.Core.info make[8]: *** [tune.stamp] Killed make[8]: Leaving directory `/home/linux/share/src/mono/mcs/tools/tuner' make[7]: *** [do-all] Error 2 make[7]: Leaving directory `/home/linux/share/src/mono/mcs/tools/tuner' make[6]: *** [all-recursive] Error 1 make[6]: Leaving directory `/home/linux/share/src/mono/mcs/tools' make[5]: *** [all-recursive] Error 1 make[5]: Leaving directory `/home/linux/share/src/mono/mcs' make[4]: *** [profile-do--net_2_1--all] Error 2 make[4]: Leaving directory `/home/linux/share/src/mono/mcs' make[3]: *** [profiles-do--all] Error 2 make[3]: Leaving directory `/home/linux/share/src/mono/mcs' make[2]: *** [all-local] Error 2 make[2]: Leaving directory `/home/linux/share/src/mono/mono/runtime' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/linux/share/src/mono/mono' make: *** [all] Error 2 [EMAIL PROTECTED]:~/share/src/mono/mono Thanks, Joe -- Joe Audette Software Solutions Architect Source Tree Solutions, LLC PO Box 621861 Charlotte, NC 28262 704.323.8225 [EMAIL PROTECTED] http://www.sourcetreesolutions.com http://www.mojoportal.com ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] string marshalling conversion 34 not implemented
On Sat, Apr 5, 2008 at 6:17 PM, Josh [EMAIL PROTECTED] wrote: On Sat, Apr 5, 2008 at 3:42 PM, Jonathan Chambers [EMAIL PROTECTED] wrote: Hello Josh, You didn't post the signature of your pinvoke function, but it looks like you are trying to marshal a string using UnmanagedType.VBByRefStr. This does seem to be a limitation in mono (and not fixed in svn head), however the docs seem to indicate that this should only be used for VB compatibility. If you are changing/return the string in unmanaged, you need to use a StringBuilder. If you are only passing a string in, you can just pass a string (and specify the native string type). See this great page on the wiki for more info: http://www.mono-project.com/Interop_with_Native_Libraries Thanks, Jonathan 2008/4/4 Josh [EMAIL PROTECTED]: Mono is throwing me the error string marshalling conversion 34 not implemented when I'm attempting to call a function to libvlc.dll from my code. The other calls to the DLL work fine, but the AddTarget Function causes the error. I'm getting the same results on both Windows and Linux versions. [AddTarget Function] === public Err AddTarget(string Target) { if ((m_iVlcHandle == -1)) { m_strLastErr = LibVlc is not initialzed; return Err.NoInit; } Err enmErr = Err.Success; try { enmErr = VLC_AddTarget(m_iVlcHandle, Target, null, 0, (int)Mode.Append, (int)Pos.Close); } catch (Exception ex) { m_strLastErr = ex.Message; return Err.Execption; } if (((int)enmErr 0)) { m_strLastErr = VLC_Err((int)enmErr); return enmErr; } // OK return Err.Success; } === [Mono Details - Windows] === Mono JIT compiler version 1.9 (tarball) Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com TLS: normal GC:Included Boehm (with typed GC) SIGSEGV: normal Notification: Thread + polling Architecture: x86 Disabled: none === [Mono Details - Linux] === Mono JIT compiler version 1.9 (tarball) Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com TLS: __thread GC:Included Boehm (with typed GC) SIGSEGV: normal Notifications: epoll Architecture: x86 Disabled: none === Any ideas? Might this be fixed in HEAD? I'm also up to using a different media player that is known to work in mono. Josh ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list Jonathan, I think that the code I'm using was converted from a VB source. Here is the VB PInvoke function I dug up from that code: [code] Private Declare Function VLC_AddTarget Lib libvlc (ByVal iVLC As Integer, ByVal Target As String, ByVal Options() As String, ByVal OptionsCount As Integer, ByVal Mode As Integer, ByVal Pos As Integer) As Err [/code] That URL you provided looks like it's going to be spot-on what I need to fix the problem, thank you!. If I come across any other issues I'll post back. Also, if anyone knows of a working mono sample using libvlc it would be much appreciated. Thanks again. Josh Jonathan, To follow up, you are the man. The magic answer was changing over to StringBuilder (http://msdn2.microsoft.com/en-us/library/2839d5h5(VS.71).aspx). All I had to do was switch the P/Invoke signature from type String to StringBuilder and go through and tell my code to pass in a StringBuilder and Vio-la! it works using libvlc.dll both in the Linux and Windows versions of mono (and still works fine in .NET, too). Thank you for your help, now I can move on to the final 43 errors MoMA is reporting. ;-) Thanks again! Josh ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list