<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mario Carrion &#187; english</title>
	<atom:link href="http://blog.carrion.mx/tag/english/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.carrion.mx</link>
	<description>Personal blog</description>
	<lastBuildDate>Thu, 26 Aug 2010 14:12:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Mono Accessibility 2.1</title>
		<link>http://blog.carrion.mx/2010/08/26/mono-accessibility-2-1/</link>
		<comments>http://blog.carrion.mx/2010/08/26/mono-accessibility-2-1/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 14:09:37 +0000</pubDate>
		<dc:creator>Mario Carrion</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[a11y]]></category>
		<category><![CDATA[august]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[opensuse]]></category>
		<category><![CDATA[resolutions]]></category>
		<category><![CDATA[uia]]></category>

		<guid isPermaLink="false">http://blog.carrion.mx/?p=645</guid>
		<description><![CDATA[Last Tuesday, we presented Mono Accessibility 2.1. We worked really hard on this release. Our main goals were, among other things, to improve our UI Automation Client API implementation, polish the interaction with at-spi2, better Moonlight accessibility and to handle custom and client-side providers. The great work made by all the contributors was the reason [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.carrion.mx%2F2010%2F08%2F26%2Fmono-accessibility-2-1%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.carrion.mx%2F2010%2F08%2F26%2Fmono-accessibility-2-1%2F&amp;source=mariocarrion&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>
<a href="http://www.flickr.com/photos/mariocarrion/4886351160/" title="Candles by Mario Carrion, on Flickr"><img src="http://farm5.static.flickr.com/4136/4886351160_d6472b6aea_m.jpg" width="240" height="160" alt="Candles" class="aligncenter" /></a>
</p>
<p>
Last <a href="http://mono-project.com/Accessibility:_Release_Notes_2.1">Tuesday</a>, we presented <a href="http://mono-project.com/Accessibility">Mono Accessibility</a> 2.1. We worked really hard on this release. Our main goals were, among other things, to improve our <a href="http://msdn.microsoft.com/en-us/library/ms753107.aspx">UI Automation</a> Client API implementation, polish the interaction with at-spi2, better Moonlight accessibility and to handle custom and client-side providers. The great work made by all the contributors was the reason this release accomplished those goals.
</p>
<h3>What happened since last time?</h3>
<p>
Explaining this release is kind of hard if you are not involved in Mono Accessibility, and even more difficult if you&#8217;re not involved in Accessibility at all. However, if you&#8217;re familiar with Mono and .NET you are, also, aware of the possibility of developing .NET-based applications that run on both platforms with minor* changes or no changes at all. But, before the implementation of Mono Accessibility, there was something missing: all those applications were not accessible.
</p>
<p>
This meant two things. First Atk-based Assistive Technologies (ATs) were not able to access Windows Forms nor Silverlight applications. Second .NET-based ATs using UI Automation were not able to run on Mono. Making them useless for people requiring Accessibility to interact with software running Mono on Linux**.
</p>
<p>
After the implementation of Mono Accessibility, we have: </p>
<ul>
<li>UI Automation API Framework</li>
<li>Bridge between UI Automation and ATK</li>
</ul>
<p>
This way ATs using either Accessibility Technology, Atk or UI Automation, will be able to interact with Gtk+, Windows Forms and Silverlight applications, with no changes at all.
</p>
<h3>This is what happened</h3>
<p>
In the following video: (if you are using a RSS reader click <a href="http://www.youtube.com/watch?v=NwMXYXGincE">this link</a>) <a href="http://live.gnome.org/Gcalctool">gcalctool</a> is launched and an application, using UI Automation Client API, interacts with it, clicking buttons &#8220;2&#8243;, &#8220;+&#8221;, &#8220;3&#8243; and &#8220;=&#8221;.
</p>
</p>
<p>
Then <a href="http://github.com/mattguo/UIAExplorer">UIA Explorer</a>, a .NET- based application using UI Automation Client API, also interacts with gcalctool, if you pay attention you will notice that UIA Explorer also lists all other Gtk+ based applications, such as Nautilus and the GNOME Panel.
</p>
<p>
Finally Mozilla Firefox is executed (both Novell Moonlight with Accessibility Support and Novell Moonlight Accessibility Extensions plugins were installed prior running it) and an Atk-based Accessility Debugger, <a href="http://live.gnome.org/Accerciser">Accerciser</a>, is launched to interact with the Moonlight application.
</p>
<p>
<object width="425" height="330"><param name="movie" value="http://www.youtube.com/v/NwMXYXGincE?fs=1&amp;hl=en_US&amp;rel=0&amp;hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/NwMXYXGincE?fs=1&amp;hl=en_US&amp;rel=0&amp;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="330"></embed></object>
</p>
<p>The source code used to test GCalctool is the following:</p>
<pre class="brush:csharp; ruler:true">// gmcs -pkg:mono-uia gcalc.cs &#038;&#038; mono gcalc.exe

using System;
using System.Linq;
using System.Windows.Automation;

namespace Mono.A11y.Examples {
	public class GCalc {
		public static void Main (string []args)
		{
			AndCondition cond
				= new AndCondition (new PropertyCondition (AutomationElementIdentifiers.ControlTypeProperty,
				                                            ControlType.Window),
				                    new PropertyCondition (AutomationElementIdentifiers.NameProperty, "Calculator"));
			var gcalc = AutomationElement.RootElement.FindFirst (TreeScope.Children, cond);

			cond = new AndCondition (new PropertyCondition (AutomationElementIdentifiers.ControlTypeProperty,
			                                                 ControlType.Button),
			                         new PropertyCondition (AutomationElementIdentifiers.NameProperty, "Add"));
			var addButton = gcalc.FindFirst (TreeScope.Descendants, cond);

			cond = new AndCondition (new PropertyCondition (AutomationElementIdentifiers.ControlTypeProperty,
			                                                 ControlType.Button),
			                         new PropertyCondition (AutomationElementIdentifiers.NameProperty, "Numeric 2"));
			var Button2 = gcalc.FindFirst (TreeScope.Descendants, cond);

			cond = new AndCondition (new PropertyCondition (AutomationElementIdentifiers.ControlTypeProperty,
			                                                 ControlType.Button),
			                         new PropertyCondition (AutomationElementIdentifiers.NameProperty, "Numeric 3"));
			var Button3 = gcalc.FindFirst (TreeScope.Descendants, cond);

			cond = new AndCondition (new PropertyCondition (AutomationElementIdentifiers.ControlTypeProperty,
			                                                 ControlType.Button),
			                         new PropertyCondition (AutomationElementIdentifiers.NameProperty, "Calculate result"));
			var calcButton = gcalc.FindFirst (TreeScope.Descendants, cond);

			cond = new AndCondition (new PropertyCondition (AutomationElementIdentifiers.ControlTypeProperty,
			                                                 ControlType.Button),
			                         new PropertyCondition (AutomationElementIdentifiers.NameProperty, "Calculate result"));
			var resultText = gcalc.FindFirst (TreeScope.Descendants, cond);

			// Clicking buttons
			InvokePattern addInvoke = (InvokePattern) addButton.GetCurrentPattern (InvokePattern.Pattern);
			InvokePattern Invoke2 = (InvokePattern) Button2.GetCurrentPattern (InvokePattern.Pattern);
			InvokePattern Invoke3 = (InvokePattern) Button3.GetCurrentPattern (InvokePattern.Pattern);
			InvokePattern calcInvoke = (InvokePattern) calcButton.GetCurrentPattern (InvokePattern.Pattern);

			System.Console.WriteLine ("Pressing \"2\"");
			System.Threading.Thread.Sleep (500);
			Invoke2.Invoke ();

			System.Console.WriteLine ("Pressing \"+\"");
			System.Threading.Thread.Sleep (500);
			addInvoke.Invoke ();

			System.Console.WriteLine ("Pressing \"3\"");
			System.Threading.Thread.Sleep (500);
			Invoke3.Invoke ();

			System.Console.WriteLine ("Pressing \"=\"");
			System.Threading.Thread.Sleep (500);
			calcInvoke.Invoke ();
		}
	}
}</pre>
<h3>Where do I get it?</h3>
<p>
If you installed <a href="2010/03/03/accessibility-in-moonlight/">Mono Accessibility 2.0</a> an option to upgrade should be available now, if not Mono Accessibility is available for a variety of Linux distributions, including:</p>
<ul>
<li>openSUSE 11.2 <a href="http://download.opensuse.org/repositories/Mono:/UIA/openSUSE_11.2/mono-uia.ymp">1-Click Install</a></li>
<li>Ubuntu Karmic Koala <a href="https://edge.launchpad.net/~mono-a11y/+archive/releases">Package Archive on Launchpad</a></li>
<li>Fedora 12 <a href="http://download.opensuse.org/repositories/Mono:/UIA/Fedora_12/ Repository">openSUSE Build Service<a /></a></li>
</ul>
<p>Moonlight applications require the following extra steps:</p>
<ul>
<li>Install the updated <em>xulrunner</em> package from the above repositories. <em>(Required until patch on <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=480317">bug #480317</a>) gets approved.</em></li>
<li>Install Novell Moonlight with Accessibility Support for <a href="http://www.mono-a11y.org/archive/moonlight-plugins/2.3.99.0accessibility/novell-moonlight-2.3.99.0accessibility-i586.xpi">32 bit</a> or <a href="http://www.mono-a11y.org/archive/moonlight-plugins/2.3.99.0accessibility/novell-moonlight-2.3.99.0accessibility-x86_64.xpi"> 64 bit</a>.</li>
<li>Install <a href="http://www.mono-a11y.org/archive/moonlight-a11y-plugins/2.1/novell-moonlight-a11y-2.1-noarch.xpi">Novell Moonlight Accessibility Extensions</a></li>
</ul>
<p>Have fun and if you find any bug with this release, please <a href="https://bugzilla.novell.com/enter_bug.cgi?product=UI%20Automation file bugs">file it</a>. If you want to contribute or need specific assistance, please join our <a href="http://forge.novell.com/mailman/listinfo/mono-a11y">mailing list</a>, or drop in <a href="irc://irc.gimp.org/mono-a11y">#mono-a11y</a> on irc.gimp.org.</p>
<p>
* <em>Of course this depends on what APIs you are using. If you want to know how compatible is your application try <a href="http://www.mono-project.com/MoMA">MoMA</a>.</em><br />
** <em>Notice however, even though Mono is muti platform and UI Automation is included in both Mono and Silverlight, in order to allow other ATs running on other platforms, different than Linux, you will require to implement an specific bridge to talk to you OS Accessibility Layer.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carrion.mx/2010/08/26/mono-accessibility-2-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hackweek V: YaSTroid</title>
		<link>http://blog.carrion.mx/2010/06/22/hackweek-v-yastroid/</link>
		<comments>http://blog.carrion.mx/2010/06/22/hackweek-v-yastroid/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 19:54:14 +0000</pubDate>
		<dc:creator>Mario Carrion</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[hackweek]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[june]]></category>
		<category><![CDATA[opensuse]]></category>
		<category><![CDATA[resolutions]]></category>
		<category><![CDATA[yastroid]]></category>

		<guid isPermaLink="false">http://blog.carrion.mx/?p=643</guid>
		<description><![CDATA[Hackweek is an excellent opportunity to try something new. Hackweek V was not the exception. From June 7th to June 11th I joined a fantastic group of hackers to implement YaSTroid, our Android Front-end to WebYaST. The week was fun. Learning new stuff, in this case Android, always helps me to see things different and [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.carrion.mx%2F2010%2F06%2F22%2Fhackweek-v-yastroid%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.carrion.mx%2F2010%2F06%2F22%2Fhackweek-v-yastroid%2F&amp;source=mariocarrion&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="https://features.opensuse.org/hackweek">Hackweek</a> is an excellent opportunity to try something new. Hackweek V was not the exception. From June 7th to June 11th I joined a fantastic group of hackers to implement <a href="http://gitorious.org/opensuse/yastroid">YaSTroid</a>, our Android Front-end to <a href="http://en.opensuse.org/YaST/Web">WebYaST</a>.</p>
<p>The week was fun. Learning new stuff, in this case <a href="http://www.android.com/">Android</a>, always helps me to see things different and somehow makes me appreciate other development platforms. Recalling Java was not that difficult. Honestly I thought Java had something new to offer to all developers, but it seems that Java hasn&#8217;t changed dramatically in years.</p>
<h3>WebYaST and YaSTroid</h3>
<p>WebYaST is an open source project which goal is to provide a web front-end for YaST functionality to enable remote 1:1 management. The interaction is basically like this (see the <a href="http://en.opensuse.org/YaST/Web/Architecture">detailed diagram</a> to get more information):</p>
<p><a href="http://www.flickr.com/photos/mariocarrion/4725368064/" title="WebYaST by Mario Carrion, on Flickr"><img src="http://farm2.static.flickr.com/1203/4725368064_2e9b9b8c0e.jpg" width="181" height="305" alt="WebYaST" class="aligncenter" /></a></p>
<p>WebYaST and YaSTroid communicate using the <a href="http://en.opensuse.org/YaST/Web/Development/REST_Service_Documentation">REST API</a>. If you have installed WebYaST you can access the documentation locally using:</p>
<pre>http://localhost/restdoc</pre>
<p>This website should show you a list of available methods and their arguments, if any, and examples showing you how to use them and the data returned. Pretty straightforward. Is also good idea to read the <a href="http://gitorious.org/opensuse/yast-rest-service">source code</a> in case the documentation is missing. Everything is written in Ruby, so it should really simple to read.</p>
<h3>Getting YaSTroid</h3>
<p>Developing YaSTroid requires having <a href="http://developer.android.com/sdk/index.html">Eclipse and Android</a> installed. After that clone the repository. Make sure you are using Android 1.5 when defining your virtual device.</p>
<pre>git clone git@gitorious.org:opensuse/yastroid.git</pre>
<h3>Result</h3>
<p><a href="http://www.flickr.com/photos/mariocarrion/4724778779/" title="WebYaST + YaSTroid by Mario Carrion, on Flickr"><img src="http://farm2.static.flickr.com/1030/4724778779_8956a64b5f_m.jpg" width="240" height="127" alt="WebYaST + YaSTroid" class="aligncenter"  /></a>&nbsp;&nbsp;<a href="http://www.flickr.com/photos/mariocarrion/4725501446/" title="WebYaST + YaSTroid by Mario Carrion, on Flickr"><img src="http://farm2.static.flickr.com/1200/4725501446_c826ac04d4_m.jpg" width="240" height="126" alt="WebYaST + YaSTroid"  class="aligncenter"  /></a></p>
<p>Stephen and Scott recorded a video demoing the application using a real device, I recommend watching it full-screen to see all details:</p>
<p>
<div><embed type="application/x-shockwave-flash" src="http://www.novell.com/common/flash/jwplayer/player.swf" width="360" height="240" style="undefined" id="media" name="media" bgcolor="#000000" quality="high" allowfullscreen="true" allowscriptaccess="always" flashvars="file=http://cdn.novell.com/cached/video/2010/misc/yastroid.flv&amp;backcolor=333333&amp;frontcolor=eeeeee&amp;autostart=false&amp;skin=http://www.novell.com/common/flash/jwplayer/skin_fy09launch.swf&amp;plugins=gapro-1&amp;gapro.accountid=UA-9518721-1"></embed></div>
</p>
<p>If you can&#8217;t see the embedded video <a href="http://www.novell.com/common/flash/play.php?media=http://cdn.novell.com/cached/video/2010/misc/yastroid.flv">follow this link</a>.</p>
<h3>Usefull links</h3>
<ul>
<li><a href="http://www.decriptor.com/2010/06/22/yastroid/">YaSTroid</a> by Stephen Shaw</li>
<li><a href="http://en.opensuse.org/YaST">YaST &#8211; openSUSE</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.carrion.mx/2010/06/22/hackweek-v-yastroid/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Comparing Ruby and C#: Equality</title>
		<link>http://blog.carrion.mx/2010/03/17/comparing-ruby-and-c-equality/</link>
		<comments>http://blog.carrion.mx/2010/03/17/comparing-ruby-and-c-equality/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 17:42:12 +0000</pubDate>
		<dc:creator>Mario Carrion</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[march]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[opensuse]]></category>
		<category><![CDATA[resolutions]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby&c#]]></category>

		<guid isPermaLink="false">http://blog.carrion.ws/?p=637</guid>
		<description><![CDATA[While reading The Ruby Programming Language I wrote a couple of notes about the language comparing it to C#. This is the first post of the series talking about those notes. C# and Ruby share a similar syntax to compare equality in objects. Both use the operator equals (==) and, at least, one method to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.carrion.mx%2F2010%2F03%2F17%2Fcomparing-ruby-and-c-equality%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.carrion.mx%2F2010%2F03%2F17%2Fcomparing-ruby-and-c-equality%2F&amp;source=mariocarrion&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://www.flickr.com/photos/mariocarrion/4439073605/" title="Beauty by Mario Carrion, on Flickr"><img src="http://farm3.static.flickr.com/2792/4439073605_ef6885dd43_m.jpg" width="240" height="180" alt="Beauty" class="aligncenter" /></a></p>
<p>While reading <a href="2010/01/21/the-ruby-programming-language/">The Ruby Programming Language</a> I wrote a couple of notes about the language comparing it to C#. This is the first post of the series talking about those notes.</p>
<p>C# and Ruby share a similar syntax to compare equality in objects. Both use the operator equals (==) and, at least, one method to compare. Ruby uses <em>equal?</em> and <em>eql?</em>, C# uses <em>Equals</em>. Also, both support overriding the equals (==) operator to provide a different logic in case that&#8217;s required. The methods&#8217; name are different but they work pretty much the same.</p>
<p>Understanding the difference between both languages is really simple. If you already know the difference between reference types and values types you are pretty much all set.</p>
<h3>Ruby</h3>
<h4>Method equal?</h4>
<p>Method used to test reference equality in two objects. For example:</p>
<pre class="brush:ruby">#!/usr/bin/env ruby

a = 0
b = 0.0
c = b
d = e = 0

# "false" pointer c points to b, and b and a
# are different types.w
puts "c.equal?(a) #{c.equal?(a)}"
# "false" b and a are different types
puts "b.equal?(a) #{b.equal?(a)}"
# "true" Same type, same value.
puts "d.equal?(e) #{d.equal?(e)}"</pre>
<h4>Method eql?</h4>
<p>Synonym of equal?, not strict type conversion. Notice Hash classes uses this method for creating the hash, so if two values are the same the hash method should return the same value.</p>
<pre class="brush:ruby">#!/usr/bin/env ruby

a = 0
b = 0.0
c = b
d = e = 0

# "false" Pointer c points to b, and b and a are different types
puts "c.eql?(a) #{c.eql?(a)}"
# "false" Different types
puts "b.eql?(a) #{b.eql?(a)}"
# "true" Same type, same value.
puts "d.eql?(e) #{d.eql?(e)}"</pre>
<h4>Operator equals (==)</h4>
<p>By default, in Object class, it&#8217;s a synonym of equal?. Tests reference equality.</p>
<pre class="brush:ruby">#!/usr/bin/env ruby

a = 0
b = 0.0
c = b
d = e = 0

# "true" Even when pointer c points to b, and b and a
# are different types, the value is the same
puts "c == a #{c == a}"
# "true" Type is casted to allow comparing them
puts "b == a #{b == a}"
# "true" Same type, same value.
puts "d == e #{d == e}"</pre>
<h3>C#</h3>
<p>Before explaining the equality options, notice one important difference between Ruby and C#.</p>
<p><strong>First</strong>, Ruby is a <strong>dynamic typed language</strong>. When declaring variables there&#8217;s no <em>meaning</em> of <em>variable type</em>, all variables can be used to identify instances of different types depending on the situation. For example, we can define a variable <em>x</em> to act as a <em>string</em>, and then use the same variable <em>x</em> to act as an <em>integer</em>, this doesn&#8217;t mean we are converting the string to integer, this means we are using the same pointer (variable x) for two different types, string and integer, pointing to two different addresses in memory. For example:</p>
<pre class="brush:ruby">#!/usr/bin/env ruby

a = "I'm string"
# Output: "a Value: 'I'm string' Class: 'String'"
puts "a Value: '#{a}' Class: '#{a.class}'"

# Output: "a Value: '10.0' Class: 'Float'"
a = 10.0
puts "a Value: '#{a}' Class: '#{a.class}'"</pre>
<p>C# is a <strong>static typed language</strong>, all variables must indicate their type before instantiating an object. For example, when declaring a variable <em>x</em> of type <em>string</em>, you will be able to create an instance of <em>string</em>, <strong>only</strong>, there&#8217;s no way to &#8220;reuse&#8221; <em>x</em> as an <em>integer</em> in the same scope. Try to compile the following example, it <strong>will</strong> fail:</p>
<pre class="brush:csharp">public class RubyAndCSharp {

	public static void Main (string []args) {
		string x = "I'm string";
		System.Console.WriteLine ("a Value: '{0}' Class: '{1}'", x, x.GetType ());

		x = 10.0; // It will fail here: "error CS0029: Cannot implicitly convert type `double' to `string'"
		System.Console.WriteLine ("a Value: '{0}' Class: '{1}'", x, x.GetType ());
	}
}</pre>
<p><strong>Second</strong>, memory management. Both languages manage memory automatically: by default all memory is created and released automatically, there is no need to explicitly release or allocate memory, unless the programmer wants to do so. However, in C# there&#8217;s a &#8220;difference&#8221; between types. There are two <em>type categories</em>: <a href="http://msdn.microsoft.com/en-us/library/s1ax56ch.aspx">Value Type</a> and <a href="http://msdn.microsoft.com/en-us/library/490f96s2.aspx">Reference Type</a>. The difference, related to memory use, is the way they work and the addresses in memory they use. Declaring value types automatically allocates memory, declaring reference types declares a pointer and the memory is allocated when the object pointed by the variable is instantiated. The Value Types are allocated in the <a href="http://en.wikipedia.org/wiki/Stack-based_memory_allocation">stack</a> and the Reference Types are allocated in the <a href="http://en.wikipedia.org/wiki/Dynamic_memory_allocation">heap</a>.</p>
<p>This difference is really important. Comparing two instances of objects with different &#8220;category&#8221;, one value type and one reference type, does not work, it just fails. Is like comparing an apple to an orange. Is comparing a value stored in the stack to a value stored in the heap. We can&#8217;t compare them without writing any extra code.</p>
<p>And this extra code means using the base class <em>object</em> as the pointer for different types, because both types, value type and reference type, are subclasses of object, in one way or another. Let&#8217;s try to compile the following example:</p>
<pre class="brush:csharp">public class RubyAndCSharp {

	public static void Main (string []args) {
		object x = "I'm string";
		// Output: "a Value: 'I'm string' Class: 'System.String'"
		System.Console.WriteLine ("a Value: '{0}' Class: '{1}'", x, x.GetType ());

		x = 10.0;
		// Output: "a Value: '10' Class: 'System.Double'"
		System.Console.WriteLine ("a Value: '{0}' Class: '{1}'", x, x.GetType ());
	}
}</pre>
<p>After this short (or long?) explanation we are ready to see talk about the methods.</p>
<h4>Method Object.Equals()</h4>
<p>Is used to test reference equality in reference types and bitwise equality in value types. For example:</p>
<pre class="brush:csharp">public class RubyAndCSharp {

	class MyClass {
		public string Name { get; set; }
		public override string ToString () { return Name; }
	}

	public static void Main (string []args) {
		// object.Equals in Reference Types uses address memory
		MyClass myClass0 = new MyClass () { Name = "test" };
		MyClass myClass1 = myClass0;

		System.Console.WriteLine ("object.Equals('{0}','{1}') = {2}", myClass0, myClass1, object.Equals (myClass0, myClass1));

		// Let's try again. This will return false. myClass1 and myClass2 are different instances
		myClass1 = new MyClass () { Name = "test" };

		System.Console.WriteLine ("object.Equals('{0}','{1}') = {2}", myClass0, myClass1, object.Equals (myClass0, myClass1));

		// It doesn't matter myInt0 and myInt1 are different variables, equality will be true.
		int myInt0 = 1;
		int myInt1 = 1;

		System.Console.WriteLine ("object.Equals('{0}','{1}') = {2}", myInt0, myInt1, object.Equals (myInt0, myInt1));
	}
}</pre>
<h4>Operator equals (==)</h4>
<p>Is, basically, a synonym of object.Equals, same rules apply.</p>
<pre class="brush:csharp">public class RubyAndCSharp {

	class MyClass {
		public string Name { get; set; }
		public override string ToString () { return Name; }
	}

	public static void Main (string []args) {
		// == in Reference Types uses address memory
		MyClass myClass0 = new MyClass () { Name = "test" };
		MyClass myClass1 = myClass0;

		System.Console.WriteLine ("object.Equals('{0}','{1}') = {2}", myClass0, myClass1, myClass0 == myClass1);

		// Let's try again. This will return false. myClass1 and myClass2 are different instances
		myClass1 = new MyClass () { Name = "test" };

		System.Console.WriteLine ("object.Equals('{0}','{1}') = {2}", myClass0, myClass1, myClass0 == myClass1);

		// It doesn't matter myInt0 and myInt1 are different variables
		int myInt0 = 1;
		int myInt1 = 1;

		System.Console.WriteLine ("object.Equals('{0}','{1}') = {2}", myInt0, myInt1, myInt0 == myInt1);
	}
}</pre>
<h4>Operator Object.ReferenceEquals()</h4>
<p>Pretty straightforward, tests reference:</p>
<pre class="brush:csharp">public class RubyAndCSharp {

	class MyClass {
		public string Name { get; set; }
		public override string ToString () { return Name; }
	}

	public static void Main (string []args) {
		// Object.ReferenceEquals in Reference Types uses address memory
		MyClass myClass0 = new MyClass () { Name = "test" };
		MyClass myClass1 = myClass0;

		System.Console.WriteLine ("object.Equals('{0}','{1}') = {2}", myClass0, myClass1, System.Object.ReferenceEquals (myClass0, myClass1));

		// Let's try again. This will return false. myClass1 and myClass2 are different instances
		myClass1 = new MyClass () { Name = "test" };

		System.Console.WriteLine ("object.Equals('{0}','{1}') = {2}", myClass0, myClass1, System.Object.ReferenceEquals (myClass0, myClass1));

		// This will also return false.
		int myInt0 = 1;
		int myInt1 = 1;

		System.Console.WriteLine ("object.Equals('{0}','{1}') = {2}", myInt0, myInt1, System.Object.ReferenceEquals (myInt0, myInt1));
	}
}</pre>
<h4>Colophon</h4>
<p>Sometimes you will have to use an <strong>object</strong> reference to refer to both types, value and reference, if you are planning to compare their value you have to use the static method <strong>object.Equals(a,b)</strong>. Using the operator equals (==) will always return false, because of the <a href="http://msdn.microsoft.com/en-us/library/yz2be5wk(VS.80).aspx">boxing/unboxing</a>:</p>
<pre class="brush:csharp">public class RubyAndCSharp {

	public static void Main (string []args) {
		string str0 = "hola";
		string str1 = "hola";

		object obj0 = str0;
		object obj1 = str1;

		System.Console.WriteLine ("Equals: {0}, Using ==: {1}, object.Equals {2}",
		                          obj0.Equals (obj1), // True
		                          obj0 == obj1, // True
		                          object.Equals (obj0, obj1)); // True

		bool bool0 = true;
		bool bool1 = true;

		obj0 = bool0;
		obj1 = bool1;

		System.Console.WriteLine ("Equals: {0}, ==: {1}, object.Equals {2}",
		                          obj0.Equals (obj1), // True
		                          obj0 == obj1, // False
		                          object.Equals (obj0, obj1)); // True

	}
}</pre>
<p><em>Updated 2010-03-17</em>: Thanks to <em>sukru</em> for noticing the error in the examples.</p>
<p><em>Updated 2010-03-18</em>: Fixed typos, thanks to <em>yoeri</em> and <em>doza</em> noticing them.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carrion.mx/2010/03/17/comparing-ruby-and-c-equality/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Accessibility in Moonlight</title>
		<link>http://blog.carrion.mx/2010/03/03/accessibility-in-moonlight/</link>
		<comments>http://blog.carrion.mx/2010/03/03/accessibility-in-moonlight/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 18:02:27 +0000</pubDate>
		<dc:creator>Mario Carrion</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[a11y]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[march]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[opensuse]]></category>
		<category><![CDATA[uia]]></category>

		<guid isPermaLink="false">http://blog.carrion.ws/?p=639</guid>
		<description><![CDATA[An important milestone happened on Friday, February 26: Mono Accessibility 2.0 was released. It&#8217;s important because all applications running on Moonlight 2.0, or greater, will be accessible from now on. Accessibility? If you are not familiar with this word, Accessibility, it might mean nothing to you and, probably, you will need a more formal definition: [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.carrion.mx%2F2010%2F03%2F03%2Faccessibility-in-moonlight%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.carrion.mx%2F2010%2F03%2F03%2Faccessibility-in-moonlight%2F&amp;source=mariocarrion&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>An important milestone happened on Friday, February 26: <a href="http://mono-project.com/Accessibility">Mono Accessibility</a> 2.0 <a href="http://mono-project.com/Accessibility:_Release_Notes_2.0">was released</a>. It&#8217;s important because all applications running on <a href="http://www.mono-project.com/Moonlight">Moonlight</a> 2.0, or greater, will be accessible from now on.</p>
<h3>Accessibility?</h3>
<p>If you are not familiar with this word, <em>Accessibility</em>, it might mean nothing to you and, probably, you will need a more <em>formal</em> definition:</p>
<blockquote><p>&#8220;<em>Accessibility is a general term used to describe the degree to which a product, device, service, or environment is accessible by as many people as possible. Accessibility can be viewed as the <strong>ability to access</strong> and possible benefit of some system or entity. Accessibility is often used to focus on people with disabilities and their right of access to entities, often through use of assistive technology.&#8221; <a href="http://en.wikipedia.org/wiki/Accessibility">Wikipedia</a></em></p></blockquote>
<p>You have interacted with Accessibility in real life, even if this is your first time reading this word. Have you seen those tiny bumps on the floor when taking the subway? Wheelchairs ramps or the dots on elevator buttons? Have you heard that noise, like beeping, when crossing the street? Have you noticed the audio jack in some ATMs?</p>
<p>These are real life examples of Accessibility. Accessibility in software is similar, it&#8217;s basically the degree of interaction between your software and people with temporal or permanent disabilities. People who can only use the keyboard or the mouse, people with low vision, blind people or people with hearing disabilities. All of them will be able to interact and use your application only if it&#8217;s accessible. That&#8217;s why Accessibility is important.</p>
<h3>Accessibility and Moonlight</h3>
<p><a href="http://www.silverlight.net/">Microsoft Silverlight</a> is web application framework for building media experiences and rich interactive applications for the Web. Moonlight is an open source implementation of Silverlight. Besides providing a rich experience for the web, applications running on Moonlight are now available for people with disabilities, allowing them to interact and use these applications. The interaction between these new applications and existent Accessibility Technologies (ATs), such as screen readers, is the same. All existent ATs are reused, it&#8217;s like interacting with any other desktop application. ATs in GNOME should work right now without any change and, if any change is required, it will help to provide a better integration with this framework.</p>
<h3>Implementation</h3>
<p><a href="http://www.flickr.com/photos/mariocarrion/4402576905/" title="Moonlight Atk Bridge by Mario Carrion, on Flickr"><img src="http://farm3.static.flickr.com/2745/4402576905_5c2ec4cefd.jpg" width="419" height="230" alt="Moonlight Atk Bridge" class="aligncenter" /></a></p>
<p><em>Refer to <a href="http://www.mono-project.com/Accessibility:_Architecture">Accessibility Architecture</a> for a detailed explanation of the complete architecture.</em></p>
<p>In both Accessibility implementations, Silverlight and Moonlight, <a href="http://msdn.microsoft.com/en-us/library/ms747327.aspx">Microsoft UI Automation</a> is used for interacting and exposing data of UI elements of the application. These data are used by ATs to access and manipulate those UI elements. Properties such as visibility, sensitivity or interaction, are exposed by <a href="http://msdn.microsoft.com/en-us/library/ms747229.aspx">Automation Peers</a> (also known as Automation Providers), along with <a href="http://msdn.microsoft.com/en-us/library/ms742306.aspx">Automation Patterns</a> to indicate the type of interaction in the control, for example: accepting selection or allowing clicking. There&#8217;s always a relation one to one, one Automation Peer and one Control. The properties are available to ATs through the information exposed by the UIA/Atk Bridge module. This module is loaded by the Moonlight application to interact with ATs. It keeps a tree of <a href="http://library.gnome.org/devel/atk/">Atk</a> objects to represent every UI Automation element in the Moonlight application.</p>
<p>The interaction between ATs and Moonlight applications is like this:</p>
<ol>
<li>An AT requests information about the Moonlight control in Firefox.</li>
<li>Firefox asks Moonlight this information.</li>
<li>Moonlight uses the <em>A11yHelper</em> to load the UIA/Atk bridge module and returns the <a href="http://anonsvn.mono-project.com/viewvc/trunk/uia2atk/MoonAtkBridge/MoonAtkBridge/Moonlight.AtkBridge/RootVisualAdapter.cs">root accessible</a>, it represents the control&#8217;s Automation Peer: <a href="http://anonsvn.mono-project.com/viewvc/trunk/moon/class/System.Windows/System.Windows.Automation.Peers/WindowAutomationPeer.cs">WindowAutomationPeer</a>.</li>
<li>From now on, new AutomationPeers will be mapped, one-to-one, to an Atk.Object. All data requested by an AT will be accessed through the associated Atk.Object, and this one will return information contained in the AutomationPeer.</li>
</ol>
<p>If you are curious you can checkout the sources to see the final implementation:</p>
<ul>
<li><a href="http://anonsvn.mono-project.com/viewvc/trunk/moon/">Moonlight</a>: important bits located in <em>class/System.Windows/System.Windows.Automation.Peers/</em> and <em>class/System.Windows/Mono/A11yHelper.cs</em>.
  </li>
<li><a href="http://anonsvn.mono-project.com/viewvc/trunk/uia2atk/">Moonlight UIA/Atk Bridge</a>: implementation located in <em>MoonAtkBridge/</em>.</li>
</ul>
<h3>How do I install it?</h3>
<p>Before installing, make sure <a href="http://library.gnome.org/users/user-guide/stable/goscustaccess-11.html.en">Assistive Technologies</a> is enabled, then add the Mono UIA repository  (see <a href="http://mono-project.com/Accessibility:_Release_Notes_2.0#Downloading">Downloading</a>) and follow the instructions (taken from <a href="http://mono-project.com/Accessibility:_Release_Notes_2.0#Installing">Installing</a>):</p>
<ol>
<li>Install the updated <em>xulrunner</em> package from the above repositories. (This is required until Firefox 3.7 because of <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=480317">bug #480317</a>)</li>
<li>Install <em>Novell Moonlight with Accessibility Support</em> for <a href="http://mono-a11y.org/releases/2.0/i586/novell-moonlight.xpi">32 bit</a> or <a href="http://mono-a11y.org/releases/2.0/x86_64/novell-moonlight.xpi">64 bit</a>.</li>
<li>Install <em><a href="http://mono-a11y.org/releases/2.0/noarch/novell-moonlight-a11y.xpi">Novell Moonlight Accessibility Extensions</a></em></li>
<li>Restart Firefox</li>
<li>Enjoy!</li>
</ol>
<h3>Useful links</h3>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/windows/bb735024.aspx">Accessibility. Windows Developer Center</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/cc707824(VS.95).aspx">Silverlight: Accessibility Overview</a></li>
<li><a href="http://projects.gnome.org/accessibility/">GNOME Accessibility</a></li>
<li><a href="http://brad.getcoded.net/blog/entry.php?e=1537848530">Mono Accessibility 2.0 unleashed!</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.carrion.mx/2010/03/03/accessibility-in-moonlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tasque 0.1.9!</title>
		<link>http://blog.carrion.mx/2010/02/16/tasque-0-1-9/</link>
		<comments>http://blog.carrion.mx/2010/02/16/tasque-0-1-9/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 01:37:10 +0000</pubDate>
		<dc:creator>Mario Carrion</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[february]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[opensuse]]></category>
		<category><![CDATA[resolutions]]></category>
		<category><![CDATA[tasque]]></category>

		<guid isPermaLink="false">http://blog.carrion.ws/?p=638</guid>
		<description><![CDATA[Yes! Your favorite task management application is back. Tasque v0.1.9 was released today!. New features include: Support for Mono >= 2.6 Customizable color highlighting in tasks. Hiveminder improvements New translations And more! See the announce email to get more information. Get it while it&#8217;s hot! Screenshots? &#160;&#160;&#160; More here! Where to get? Main Downloads page [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.carrion.mx%2F2010%2F02%2F16%2Ftasque-0-1-9%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.carrion.mx%2F2010%2F02%2F16%2Ftasque-0-1-9%2F&amp;source=mariocarrion&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Yes! Your favorite task management application is back. <a href="http://live.gnome.org/Tasque">Tasque</a> v<a href="http://mail.gnome.org/archives/tasque-list/2010-February/msg00007.html">0.1.9</a> was released today!. New features include:</p>
<ul>
<li>Support for Mono >= 2.6</li>
<li>Customizable color highlighting in tasks.</li>
<li>Hiveminder improvements</li>
<li>New translations</li>
<li>And more!</li>
</ul>
<p>See the <a href="http://mail.gnome.org/archives/tasque-list/2010-February/msg00007.html">announce email</a> to get more information.</p>
<p><strong><a href="http://live.gnome.org/Tasque/Download">Get it</a></strong> while it&#8217;s hot!</p>
<h3>Screenshots?</h3>
<p><a href="http://www.flickr.com/photos/mariocarrion/4364109000/" title="Tasque 0.1.9 by Mario Carrion, on Flickr"><img src="http://farm5.static.flickr.com/4030/4364109000_a866485a33_m.jpg" width="148" height="240" alt="Tasque 0.1.9" /></a>&nbsp;&nbsp;&nbsp;<a href="http://www.flickr.com/photos/mariocarrion/4364139136/" title="Tasque Preferences by Mario Carrion, on Flickr"><img src="http://farm3.static.flickr.com/2727/4364139136_f3988cd31b_m.jpg" width="240" height="224" alt="Tasque Preferences" /></a></p>
<p><a href="http://live.gnome.org/Tasque/Screenshots">More here!</a></p>
<h3>Where to get?</h3>
<ul>
<li><a href="http://live.gnome.org/Tasque/Download" title="Download page" alt="Download page">Main Downloads page</a></li>
<li><a href="http://ftp.gnome.org/pub/GNOME/sources/tasque/0.1/" title="Download sources" alt="Download sources">Sources</a></li>
<li><a href="http://ftp.gnome.org/pub/GNOME/binaries/mac/tasque/0.1/" title="Download Mac OS X binaries" alt="Download Mac OS X binaries">Mac OS X binaries</a></li>
<li><a href="http://ftp.gnome.org/pub/GNOME/binaries/win32/tasque/0.1/" title="Download MS Windows binaries" alt="Download MS Windows binaries">MS Windows binaries</a></li>
</ul>
<h3>More information?</h3>
<ul>
<li><a href="http://live.gnome.org/Tasque">Wiki</a></li>
<li><a href="http://live.gnome.org/Tasque/FAQS">FAQs</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.carrion.mx/2010/02/16/tasque-0-1-9/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Parallel Development Environments? Pulque!</title>
		<link>http://blog.carrion.mx/2010/01/25/parallel-development-environments-pulque/</link>
		<comments>http://blog.carrion.mx/2010/01/25/parallel-development-environments-pulque/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 03:15:59 +0000</pubDate>
		<dc:creator>Mario Carrion</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[january]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[opensuse]]></category>
		<category><![CDATA[pulque]]></category>
		<category><![CDATA[resolutions]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.carrion.ws/?p=634</guid>
		<description><![CDATA[By Claire L. Evans / CC BY-ND 2.0 This is an updated version of Multiple Parallel Mono Environments. What is Pulque? Pulque is a collection of applications written in Ruby and Bash scripting to maintain parallel development environments. Why does Pulque exist? Three reasons: I need to keep multiple versions installed of the same software, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.carrion.mx%2F2010%2F01%2F25%2Fparallel-development-environments-pulque%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.carrion.mx%2F2010%2F01%2F25%2Fparallel-development-environments-pulque%2F&amp;source=mariocarrion&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://www.flickr.com/photos/astro-dudes/2735367731/"><img title="¡Quiero pulque! by Claire L. Evans" src="http://farm4.static.flickr.com/3108/2735367731_73c00175a0_m.jpg" alt="¡Quiero pulque!" width="240" height="180" /></a></p>
<p><a rel="cc:attributionURL" href="http://www.flickr.com/photos/astro-dudes/">By Claire L. Evans</a> / <a rel="license" href="http://creativecommons.org/licenses/by-nd/2.0/">CC BY-ND 2.0</a></p>
<p><em>This is an updated version of <a href="/2009/07/01/multiple-parallel-mono-environments/">Multiple Parallel Mono Environments</a>.</em></p>
<h3>What is Pulque?</h3>
<p><em>Pulque</em> is a collection of applications written in Ruby and Bash scripting to maintain parallel development environments.</p>
<h3>Why does Pulque exist?</h3>
<p>Three reasons:</p>
<ol>
<li>I need to keep <em>multiple versions installed</em> of the same software,</li>
<li>I need to know what <em>Version Control System</em> is used by the software, and the most important</li>
<li>I want to keep myself <strong>sane</strong>.</li>
</ol>
<p>At work, I have to interact with different open source projects, most of them use <a href="http://subversion.tigris.org/">Subversion</a> and <a href="http://git-scm.com/">Git</a>, but some others use <a href="http://bazaar.canonical.com/en/">Bazaar</a> and <a href="http://mercurial.selenic.com/">Mercurial</a>. Keeping track of the current parallel development environment and the VCS used by the software is exhausting.</p>
<p>You spend time focusing on something that shouldn&#8217;t be that important: </p>
<ul>
<li>Managing your parallel environments and,</li>
<li>Keeping track of the VCS used by the software</li>
</ul>
<p>Is easy to get confused when interacting with the repository, for example, executing <em>svn update</em> when the software is stored in a <em>git</em> repository. Is silly, but <strong>it happens</strong>. Unless you are using an IDE that support Multiple Parallel Development Environments you will need the terminal to configure and build your projects.</p>
<p><em>Pulque</em> helps you maintaining parallel development environments by: </p>
<ul>
<li>Printing in the bash prompt the <em>name of the parallel development environment</em> and <em>the type of the VCS</em>, this information is updated depending on the working directory, </li>
<li>Defining aliases to the default commands used to configure and build the software project, to always prefix your projects using your parallel environment, and</li>
<li>Showing a failure or success alert when the command finishes.</li>
</ul>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/Fj3dsNwWOVQ&#038;hl=en_US&#038;fs=1&#038;color1=0x3a3a3a&#038;color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Fj3dsNwWOVQ&#038;hl=en_US&#038;fs=1&#038;color1=0x3a3a3a&#038;color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<h3>Installing and using Pulque</h3>
<p>Follow the instructions in <a href="http://github.com/mariocarrion/pulque/blob/master/INSTALL">INSTALL</a>, or if you are using openSUSE 11.2:</p>
<p style="text-align: center;"><a href="http://download.opensuse.org/repositories/home:/MarioCarrion/openSUSE_11.2/pulque.ymp"><img alt="OneClick Install" src="http://www.mariocarrion.com/icons/oneclick.png" title="OneClick Install" width="162" height="46" class="aligncenter"  /><br />Click here to drink Pulque!</a></p>
<p>Don&#8217;t forget to add the function <em>pswitch</em> to your <em>.bashrc</em>. Bash will autocomplete your environment name when using <em>TAB TAB</em>.</p>
<pre class="brush:bash">
function pswitch {
  source /usr/bin/__pswitch $1
}
</pre>
<p>Read the <a href="http://github.com/mariocarrion/pulque/blob/master/USING">USING</a> file to understand how to use <em>Pulque</em> in the daily basis. If you find something weird or interesting please <a href="http://github.com/mariocarrion/pulque/issues">create an issue</a> to fix it.</p>
<h3>Colophon</h3>
<p>According to <a href="http://en.wikipedia.org/wiki/Pulque ">Wikipedia</a>: &#8220;<em>Pulque, or octli, is a milk-colored, somewhat viscous alcoholic beverage made from the fermented sap of the maguey plant, and is a traditional native beverage of Mexico.</em>&#8220;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carrion.mx/2010/01/25/parallel-development-environments-pulque/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Ruby Programming Language</title>
		<link>http://blog.carrion.mx/2010/01/21/the-ruby-programming-language/</link>
		<comments>http://blog.carrion.mx/2010/01/21/the-ruby-programming-language/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 04:50:49 +0000</pubDate>
		<dc:creator>Mario Carrion</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[january]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[opensuse]]></category>
		<category><![CDATA[resolutions]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.carrion.ws/?p=635</guid>
		<description><![CDATA[A couple of days ago I finished reading: The Ruby Programming Language, book written by David Flanagan and Yukihiro Matsumoto. If I have to say anything about the book and, the language, of course, is: I am impressed. The syntax is pretty for writing and simple for reading. Its simplicity makes you understand the code, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.carrion.mx%2F2010%2F01%2F21%2Fthe-ruby-programming-language%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.carrion.mx%2F2010%2F01%2F21%2Fthe-ruby-programming-language%2F&amp;source=mariocarrion&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://www.flickr.com/photos/mariocarrion/4294063393/" title="Ruby by Mario Carrion, on Flickr"><img src="http://farm3.static.flickr.com/2758/4294063393_54d8564980_m.jpg" width="240" height="160" alt="Ruby" /></a></p>
<p>A couple of days ago I finished reading: <a href="http://www.amazon.com/Ruby-Programming-Language-David-Flanagan/dp/0596516177">The Ruby Programming Language</a>, book written by David Flanagan and Yukihiro Matsumoto. If I have to say anything about the book and, the language, of course, is: I am impressed. The syntax is pretty for writing and simple for reading. Its simplicity makes you understand the code, is like visualizing the goal of the program in your mind by reading it, not running it. It is like reading a well written letter. You just understand.</p>
<p>I must say, when I was reading the book, at the beginning. I did not feel comfortable with the weird, at that time, syntax. Method decorations such as <em>&#8220;!&#8221;</em> and <em>&#8220;?&#8221;</em>, and the support for methods aliases made no sense. Actually I thought I was wasting my time by trying to learn the language. I was wrong.</p>
<p>When I learned C++ several years ago, I did not have reference to object orientation or any object-oriented programming language. Learning it was difficult, but, at the same time, easy. Difficult because I did not know the paradigm, easy because it was my first time learning that kind of syntax. After learning C++ I decided to learn Java and after that, I decided to learn C#.</p>
<p>And I learned them all the same way. I <em>&#8220;translated&#8221;</em> the syntax. Translated it from the <em>&#8220;new language&#8221;</em> to the <em>&#8220;old language&#8221;</em>. I did learn them all. And I thought, for long time, that the rule was: <em>&#8220;Learn all the languages the same way: by translation&#8221;</em>. I was wrong. Again.</p>
<p>Learning a new programming language, in my opinion, is better when you do not translate the new language. Similar to learn to speak a new language. In both cases, you have <strong>to think in the language</strong>. I decided to think in the new language. To do it that way. The Ruby way. The results were amazing. Were so amazing that inspired me to write <a href="http://github.com/mariocarrion/pulque">a project</a> in Ruby. I wanted to try out the syntax, the platform and the community. To see if the language was that good as I thought. </p>
<p>After trying it out. No disappointments at all. Actually is interesting that C# and Ruby share a lot of things, syntactically speaking. Both of them are pretty languages. Probably they do not share goals. However, I&#8217;m sure they share one goal: to make the life of the software developer easier. And, to a software developer, a programming language, and everything around it, that makes your life easier is what matters the most.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carrion.mx/2010/01/21/the-ruby-programming-language/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Hackweek IV: Gwibber + Sharing</title>
		<link>http://blog.carrion.mx/2009/07/27/hackweek-iv-gwibber-sharing/</link>
		<comments>http://blog.carrion.mx/2009/07/27/hackweek-iv-gwibber-sharing/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 17:51:56 +0000</pubDate>
		<dc:creator>Mario Carrion</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[opensuse]]></category>

		<guid isPermaLink="false">http://blog.carrion.ws/?p=589</guid>
		<description><![CDATA[I decided to try something different this Hackweek to learn a programming language and get involved into another exciting software libre project. There were too many options, too many good projects to work on. I selected gwibber because of three reasons: gwibber supports several microblogging services, including my favorites: Twitter and Facebook. gwibber is written [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.carrion.mx%2F2009%2F07%2F27%2Fhackweek-iv-gwibber-sharing%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.carrion.mx%2F2009%2F07%2F27%2Fhackweek-iv-gwibber-sharing%2F&amp;source=mariocarrion&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>I decided to try something different this <a href="http://news.opensuse.org/2009/07/08/hack-week-iv-approaches/">Hackweek</a> to learn a programming language and get involved into another exciting <em>software libre</em> project. There were too many options, too many good projects to work on. I selected <a href="http://live.gnome.org/Gwibber">gwibber</a> because of three reasons:</p>
<ol>
<li>gwibber supports several <a href="http://bazaar.launchpad.net/~gwibber-committers/gwibber/trunk/files/head%3A/gwibber/microblog/">microblogging services</a>, including my favorites: <a href="http://www.twitter.com/">Twitter</a> and <a href="http://www.facebook.com/">Facebook</a>.</li>
<li>gwibber is written in Python.</li>
<li>gwibber doesn&#8217;t integrate with other gnome applications, for example <a href="http://projects.gnome.org/cheese/">Cheese</a> or <a href="http://live.gnome.org/Nautilus">Nautilus</a>.</li>
</ol>
<h3>So&#8230; what&#8217;s the new cool feature?</h3>
<p>Something I like to call &#8220;Sharing Services&#8221;. What&#8217;s a <em>sharing service</em>? A sharing service is a service using an online provider to share data, easier impossible. For example: Images would be shared using <a href="http://twitpic.com/">Twitpic</a>, Videos would use <a href="http://yfrog.com/">yfrog</a>, Files would use <a href="http://drop.io/">Drop.io</a> and Plaint Text files would use <a href="http://pastebin.ca/">Pastebin</a> (this is configurable, in case you were wondering) I&#8217;m sure you got the idea.</p>
<p><a title="Data Sharing on Gwibber by Mario Carrion, on Flickr" href="http://www.flickr.com/photos/mariocarrion/3761746699/"><img src="http://farm3.static.flickr.com/2429/3761746699_f73e35f00b_m.jpg" alt="Data Sharing on Gwibber" width="240" height="186" /></a> <a title="Data Sharing on Gwibber by Mario Carrion, on Flickr" href="http://www.flickr.com/photos/mariocarrion/3762563436/"><img src="http://farm3.static.flickr.com/2528/3762563436_6dacc2b37b_m.jpg" alt="Data Sharing on Gwibber" width="240" height="183" /></a></p>
<h3>Technical approach</h3>
<p>The implementation is based on the following UML class diagram:</p>
<p><a title="Data Sharing on Gwibber by Mario Carrion, on Flickr" href="http://www.flickr.com/photos/mariocarrion/3762526330/"><img src="http://farm4.static.flickr.com/3516/3762526330_ccfdc15155_m.jpg" alt="Data Sharing on Gwibber" width="240" height="236" /></a></p>
<p>The idea is simple, subclass <em>Provider</em> and override <em>share</em> method and you are pretty much all set. I already implemented 3 services: <em>twitpic</em> to share images, <em>yfrog</em> to share images and video, and <em>pastebin.ca</em> to share plain text files. My plans include to implement the following providers:</p>
<h4>Plain text</h4>
<ul>
<li><a href="http://www.pastebin.cz/info/api">Pastebin.cz</a></li>
<li><a href="http://openpaste.org/en/help/#api-tools">OpenPaste</a></li>
</ul>
<h4>Video</h4>
<ul>
<li><a href="http://www.vimeo.com/">Vimeo</a></li>
<li><a href="http://twitvid.io/">Twitvid</a></li>
</ul>
<h4>Files</h4>
<ul>
<li><a href="http://drop.io/">Drop.io</a></li>
</ul>
<p>To allow communication between gnome/gtk/dbus-based applications I added a new dbus method: <em>share(filename,message)</em>, that way you can &#8220;share&#8221; your file using a message, you don&#8217;t need to explicitly tell the provider+service to use, gwibber will use the filename&#8217;s mime-type to get the valid provider and the configured service, convenient isn&#8217;t it?</p>
<p><a title="Data Sharing on Gwibber  by Mario Carrion, on Flickr" href="http://www.flickr.com/photos/mariocarrion/3762638188/"><img src="http://farm3.static.flickr.com/2472/3762638188_992bfb26c3_m.jpg" alt="Data Sharing on Gwibber " width="240" height="183" /></a></p>
<h3>Where to get it?</h3>
<p>I branched <a href="https://code.launchpad.net/~gwibber-committers/gwibber/trunk">trunk</a> to implement this feature, you can read <a href="https://code.launchpad.net/~mario-carrion/gwibber/gwibber-services">launchpad</a> to get more information, basically you need to:</p>
<pre class="bash">bzr branch lp:~mario-carrion/gwibber/gwibber-services</pre>
<p>and execute:</p>
<pre class="bash">./bin/gwibber</pre>
<p>I also included a patch for cheese, I&#8217;m using <a href="http://git.gnome.org/cgit/cheese/log/?h=gnome-2-26">gnome-2-26</a> branch, in case you want to share your videos and images on gwibber using cheese.</p>
<h3>Cool video</h3>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/nbeRTHTfZjM&amp;hl=en&amp;fs=1&amp;color1=0x006699&amp;color2=0x54abd6" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/nbeRTHTfZjM&amp;hl=en&amp;fs=1&amp;color1=0x006699&amp;color2=0x54abd6" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<h3>Known bugs and issues</h3>
<p>I&#8217;m aware of several bugs, for example: web timeouts, invalid responses and random deadlocks, so take it easy, remember: <strong>this is a preview, be happy</strong>. Also I need to think about multiple instances and implementing a real HTTP handler instead of using the MultiPartForm class, will decide it later.</p>
<p>OpenSUSE 11.1 Users: you may need to install python-related dependencies. OpenSUSE 11.1-64, if you want to use the nautilus extension, you will need create a symbolic link in <em>/usr/lib/</em> for <em>libpython2.6.so</em>. I&#8217;m going to report the packing bug as soon as possible.</p>
<p>BTW, you can always follow me on twitter: <a href="http://www.twitter.com/mariocarrion">@mariocarrion</a> in case you want to recommend me a new provider.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carrion.mx/2009/07/27/hackweek-iv-gwibber-sharing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Multiple Parallel Mono Environments</title>
		<link>http://blog.carrion.mx/2009/07/01/multiple-parallel-mono-environments/</link>
		<comments>http://blog.carrion.mx/2009/07/01/multiple-parallel-mono-environments/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 18:20:49 +0000</pubDate>
		<dc:creator>Mario Carrion</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[opensuse]]></category>

		<guid isPermaLink="false">http://blog.carrion.ws/?p=571</guid>
		<description><![CDATA[If you are a Mono developer, either you develop Mono or you use Mono for development, I&#8217;m sure you already have your Parallel Mono Environment set up and you are happy using it. Keeping a parallel environment is necessary because that way you don&#8217;t break your default Mono installation or an specific mono application, so [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.carrion.mx%2F2009%2F07%2F01%2Fmultiple-parallel-mono-environments%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.carrion.mx%2F2009%2F07%2F01%2Fmultiple-parallel-mono-environments%2F&amp;source=mariocarrion&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>If you are a <a href="http://www.mono-project.com/">Mono</a> developer, either you develop Mono or you use Mono for development, I&#8217;m sure you already have your <a title="Paralle Mono Environments" href="http://www.mono-project.com/Parallel_Mono_Environments">Parallel Mono Environment</a> set up and you are happy using it. Keeping a parallel environment is necessary because that way you don&#8217;t break your default Mono installation or an specific mono application, so you can keep using the latest version of whatever you need, however sometimes you need more than one parallel environment, usually because you are working on different versions, for example <em>mono-2-6</em>, <em>mono-head</em> and <em>mono-package</em>; in the <a href="http://www.mono-project.com/Accessibility">Accessibility Team</a> we are always working on different Mono versions jumping from one version to another, so we need to keep multiple parallel environments, and we don&#8217;t want to compile everything every time over and over. One way to accomplish multiple parallel environments is to keep <em>n</em> copies of <em>mono-dev-env</em> (something like <em>mono-dev-env-2-6</em> or <em>mono-dev-env-trunk</em>); but since I like to keep everything in one place and use the same procedure to set up my environments, I updated the default environment file to something like this (you can always get an updated version from: <a href="http://www.mariocarrion.com/files/mono-dev">here</a>):</p>
<pre class="brush:bash">#!/bin/bash
#
# Based on http://www.mono-project.com/Parallel_Mono_Environments , with the
# following modifications:
#
# - Aliases for make:
#   - mk = make
#   - mki = make install
#   - mku = make uninstall
#   - mkuci = make uninstall, clean, autogen and install
#   - mkc = make clean
#   - mkdc = make dist-clean
#   - autogenmono = autogen.sh with prefix, you also add your arguments
#   - configuremono = configure with prefix, you also add your arguments
#   - bootstrapmono = bootstrap with prefix, you also add your arguments
# - Success/Failure messages raised depending on executed command.
#
# You will need to add the following alias into your .bashrc:
#
# function exportmono {
#   source ~/path/to/mono-dev $1
# }
#
# so you can use:
# - "exportmono trunk"
# - "exportmono 2.4"
# - "exportmono whatever"
# to use multiple parallel environments, when no argument is used "trunk"
# is set by default.
#
#
# You can also use "lcustom" to load custom scripts, for example
# if you need to define environment variables instead of adding those here
# you will write a custom-var.sh and will use:
#
# "lcustom ~/custom-var.sh"

# Use this variable to add local enviroment paths
# (i.e. to include a custom executable script)
EXTRA_PATH=$HOME/Documents/Repository/uia2atk/tools

# Colors, based on http://wiki.archlinux.org/index.php/Color_Bash_Prompt
NO_COLOR='\e[0m'
# regular colors
BLACK='\e[0;30m'
RED='\e[0;31m'
GREEN='\e[0;32m'
YELLOW='\e[0;33m'
BLUE='\e[0;34m'
MAGENTA='\e[0;35m'
CYAN='\e[0;36m'
WHITE='\e[0;37m'
# emphasized (bolded) colors
EBLACK='\e[1;30m'
ERED='\e[1;31m'
EGREEN='\e[1;32m'
EYELLOW='\e[1;33m'
EBLUE='\e[1;34m'
EMAGENTA='\e[1;35m'
ECYAN='\e[1;36m'
EWHITE='\e[1;37m'
# underlined colors
UBLACK='\e[4;30m'
URED='\e[4;31m'
UGREEN='\e[4;32m'
UYELLOW='\e[4;33m'
UBLUE='\e[4;34m'
UMAGENTA='\e[4;35m'
UCYAN='\e[4;36m'
UWHITE='\e[4;37m'
# background colors
BBLACK='\e[40m'
BRED='\e[41m'
BGREEN='\e[42m'
BYELLOW='\e[43m'
BBLUE='\e[44m'
BMAGENTA='\e[45m'
BCYAN='\e[46m'
BWHITE='\e[47m'

# We are going to load CUSTOM FILES
#
# Basically the idea is to split multiple development paths or variables
# into different files, that way we can keep this file as clean as possible.
# This magic function tries to load those files.

function lcustom {
  if test x"$1" = x; then
  	echo -e "${RED}>>${NO_COLOR} Nothing to do, no arguments provided."
  else
  	source $1 &#038;&#038; echo -e "${RED}>>${NO_COLOR} Loaded: '$1'" || echo -e "${RED}>>${NO_COLOR} Not loaded"
  fi
}

MONO_REV=$1
if test x"$MONO_REV" = x; then
	MONO_REV="trunk"
fi

HOME_ROOT=$HOME/.root-dev/$MONO_REV
MONO_PREFIX=$HOME_ROOT
GNOME_PREFIX=$HOME_ROOT

if [ -d $HOME_ROOT ]; then
  echo -e "${RED}>>${NO_COLOR} Using environment: ${RED}$MONO_REV"
else
  mkdir -p $HOME_ROOT &#038;&#038; echo -e "${RED}>>${NO_COLOR} Using environment (for the first time): ${RED}$MONO_REV" || echo -e "${RED}>>${NO_COLOR} Unable to create local path."
fi

# configure-related functions
function autogenmono {
  ./autogen.sh --prefix=$MONO_PREFIX $* &#038;&#038; mynotify "autogenmono" || mynotify 1 "autogenmono"
}
function configuremono {
  ./configure --prefix=$MONO_PREFIX $* &#038;&#038; mynotify "configuremono" || mynotify 1 "configuremono"
}
function bootstrapmono {
  if test x"$1" = x; then
    echo -e "${RED}>>${NO_COLOR} Use bootstrapmono bootstrap-file"
    echo -e "${RED}>>${NO_COLOR} For example: bootstrapmono bootstrap-2.12"
  else
    ./$1 --prefix=$MONO_PREFIX $2 &#038;&#038; mynotify "bootstrapmono" || mynotify 1 "bootstrapmono"
  fi
}

# make-related functions
function mkuci {
  make uninstall &#038;&#038; make clean &#038;&#038; autogenmono $* &#038;&#038; make install &#038;&#038; mynotify "mkuci" || mynotify 1 "mkuci"
}
function mk {
  make $* &#038;&#038; mynotify "mk" || mynotify 1 "mk"
}
function mki {
  make install $* &#038;&#038; mynotify "mki" || mynotify 1 "mki"
}
function mku {
  make uninstall &#038;&#038; mynotify "mku" || mynotify 1 "mku"
}
function mkc {
  make clean &#038;&#038; mynotify "mkc" || mynotify 1 "mkc"
}
function mkdc {
  make dist-clean &#038;&#038; mynotify "mkdc" || mynotify 1 "mkdc"
}

function mynotify {
  MSG_CONTENT=$1
  MSG_URGENCY="normal"
  MSG_RESULT="done"

  echo $1 | grep "[^0-9]" > /dev/null 2>&#038;1
  # Is first argument a numeric value?
  if [ "$?" -ne "0" ]; then
    if [ "$1" -eq "1" ]; then
      MSG_CONTENT=$2
      MSG_URGENCY="critical"
      MSG_RESULT="failed"
    fi
  fi

  notify-send -t 2500 -u $MSG_URGENCY "$MSG_CONTENT $MSG_RESULT: '`basename $PWD`'"
}

export DYLD_LIBRARY_PATH=$MONO_PREFIX/lib:$DYLD_LIBRARY_PATH
export LD_LIBRARY_PATH=$MONO_PREFIX/lib:$LD_LIBRARY_PATH
export C_INCLUDE_PATH=$MONO_PREFIX/include:$GNOME_PREFIX/include
export ACLOCAL_PATH=$MONO_PREFIX/share/aclocal
export PKG_CONFIG_PATH=$MONO_PREFIX/lib/pkgconfig:$GNOME_PREFIX/lib/pkgconfig
export MANPATH=$MONO_PREFIX/share/man:$MANPATH
# a11y support
export GTK_MODULES=gail:atk-bridge

PATH=$EXTRA_PATH:$PATH
PATH=$MONO_PREFIX/bin:$PATH
PS1="$WHITE@mono-dev$NO_COLOR:$RED$MONO_REV$NO_COLOR:\w-> "
</pre>
<p>To use this script you will need to define an alias in your <em>.bashrc</em>:</p>
<p><code lang="bash"><br />
function exportmono {<br />
   source ~/path/to/mono-dev $1<br />
}<br />
</code></p>
<p>You can use this alias: <em>exportmono 2.4</em> if you are planning to define a 2.4 environment, or <em>exportmono trunk</em>, or whatever; there are more aliases that I like to use, for example, <em>autogenmono</em>, <em>mk</em> or <em>mki</em>, the nice about these aliases is that they also use <em>notify-send</em> to send a message when the command is completed, so you can work on something else while compiling, installing, cleaning or configuring. Also the bash prompt is using colors to identify what is the current parallel environment, in this case I&#8217;m using mono-2-4 and the environment name is <em>2.4</em>.</p>
<p><a href="http://www.flickr.com/photos/mariocarrion/3679259436/" title="Mono  by Mario Carrion, on Flickr"><img src="http://farm4.static.flickr.com/3641/3679259436_e8d2f03123.jpg" width="500" height="193" alt="Mono " /></a>&nbsp;&nbsp;&nbsp;<a href="http://www.flickr.com/photos/mariocarrion/3679267312/" title="Screenshot by Mario Carrion, on Flickr"><img src="http://farm4.static.flickr.com/3016/3679267312_324898f2e1.jpg" width="500" height="193" alt="Screenshot" /></a></p>
<p>This environment should work on any recent bash version, if not let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carrion.mx/2009/07/01/multiple-parallel-mono-environments/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HP Pavilion TX2500z. Part I</title>
		<link>http://blog.carrion.mx/2008/10/05/hp-pavilion-tx2500z-part-i/</link>
		<comments>http://blog.carrion.mx/2008/10/05/hp-pavilion-tx2500z-part-i/#comments</comments>
		<pubDate>Sun, 05 Oct 2008 06:02:57 +0000</pubDate>
		<dc:creator>Mario Carrion</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[opensuse]]></category>
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://blog.carrion.ws/?p=480</guid>
		<description><![CDATA[I have no complains about my Dell Inspiron 1420, (I love it, indeed), is lighter than my older Dell Inspiron 1150, however I decided to get a new one for several reasons, the most import is that I really want to spend more time playing with Moonlight and Drawing Recognition, so getting a Tablet PC [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.carrion.mx%2F2008%2F10%2F05%2Fhp-pavilion-tx2500z-part-i%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.carrion.mx%2F2008%2F10%2F05%2Fhp-pavilion-tx2500z-part-i%2F&amp;source=mariocarrion&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>I have no complains about my <a href="http://blog.carrion.ws/2007/08/03/dell-inspiron-1420/">Dell Inspiron 1420</a>, (I love it, indeed), is lighter than my <a href="http://blog.carrion.ws/2005/03/30/finalmente-2/">older Dell Inspiron 1150</a>, however I decided to get a new one for several reasons, the most import is that I really want to spend more time playing with <a href="http://www.mono-project.com/Moonlight">Moonlight</a> and Drawing Recognition, so getting a Tablet PC was the next step. The ugly about Tablet PCs is the price, most of them are really expensive, I spent a lot time reviewing the <a href="http://shop.lenovo.com/us/notebooks/thinkpad/x-series-tablet">Lenovo X61</a>, <a href="http://www.dell.com/tablet">Dell XT</a> and <a href="http://www.tabletpc.toshiba.com">Toshiba Portege</a>, however I found one with great hardware and good price: <a href="http://shopping.hp.com">HP Pavilion TX2500z</a>.</p>
<p>I&#8217;m aware that supporting Tablet PCs in Linux is not the most common thing, is not like people buying Tablet PCs to install Linux, you don&#8217;t see that, actually, I haven&#8217;t seen (live) someone using a Tablet PC with Linux; and, being honest with you, I don&#8217;t trust HP because of a previous hardware experience, but, that was long time ago (6 years I think), so this time I decided to give it a try and being brave (really brave!), and, actually I have no complains about the hardware.</p>
<p>Running OpenSUSE 11 in HP Pavilion TX2500z is somehow hard, will take you time but, I think is worth it. I installed it using OpenSUSE 11 DVD, so here we go!.</p>
<p>My HP Pavilion TX2500z hardware is the following:</p>
<ul>
<li>AMD Turion(TM) X2 Ultra Dual-Core Mobile Processor ZM-86 (2.4 GHz)</li>
<li>12.1&#8243; diagonal WXGA High-Definition HP BrightView Widescreen (1280 x 800) w/Integrated Touch-screen</li>
<li>4GB DDR2 System Memory</li>
<li>ATI Radeon HD 3200 Graphics</li>
<li>320GB 5400RPM SATA Hard Drive</li>
<li>Webcam and Fingerprint Reader</li>
<li>802.11a/b/g/n WLAN and Bluetooth</li>
<li>SuperMulti 8X DVD+/-R/RW with Double Layer Support</li>
</ul>
<p>lspci:</p>
<p><code><br />
00:00.0 Host bridge: Advanced Micro Devices [AMD] RS780 Host Bridge<br />
00:01.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (int gfx)<br />
00:04.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE port 0)<br />
00:05.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE port 1)<br />
00:06.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE port 2)<br />
00:11.0 SATA controller: ATI Technologies Inc SB700/SB800 SATA Controller [AHCI mode]<br />
00:12.0 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI0 Controller<br />
00:12.1 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI1 Controller<br />
00:12.2 USB Controller: ATI Technologies Inc SB700/SB800 USB EHCI Controller<br />
00:13.0 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI0 Controller<br />
00:13.1 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI1 Controller<br />
00:13.2 USB Controller: ATI Technologies Inc SB700/SB800 USB EHCI Controller<br />
00:14.0 SMBus: ATI Technologies Inc SBx00 SMBus Controller (rev 3a)<br />
00:14.1 IDE interface: ATI Technologies Inc SB700/SB800 IDE Controller<br />
00:14.2 Audio device: ATI Technologies Inc SBx00 Azalia<br />
00:14.3 ISA bridge: ATI Technologies Inc SB700/SB800 LPC host controller<br />
00:14.4 PCI bridge: ATI Technologies Inc SBx00 PCI to PCI Bridge<br />
00:14.5 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI2 Controller<br />
00:18.0 Host bridge: Advanced Micro Devices [AMD] Family 11h HyperTransport Configuration (rev 40)<br />
00:18.1 Host bridge: Advanced Micro Devices [AMD] Family 11h Address Map<br />
00:18.2 Host bridge: Advanced Micro Devices [AMD] Family 11h DRAM Controller<br />
00:18.3 Host bridge: Advanced Micro Devices [AMD] Family 11h Miscellaneous Control<br />
00:18.4 Host bridge: Advanced Micro Devices [AMD] Family 11h Link Control<br />
01:05.0 VGA compatible controller: ATI Technologies Inc RS780M/RS780MN [Radeon HD 3200 Graphics]<br />
08:00.0 Network controller: Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller (rev 01)<br />
09:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)<br />
</code></p>
<p>Forget about everything you find in <a href="http://www.google.com/search?q=HP+Pavilion+TX2500z+Linux&#038;ie=utf-8&#038;oe=utf-8&#038;aq=t&#038;rls=org.mozilla:en-US:official&#038;client=firefox-a">Google</a> (if you find something!), or forums, and so on. Seems that this hardware is an upgraded version, so, any NVidia-based guide won&#8217;t work, but you can use it as reference.</p>
<p><strong>Installation</strong></p>
<p>Start as usual, booting the DVD, and using the following kernel arguments:</p>
<pre>acpi=off</pre>
<p>otherwise you&#8217;ll get a black screen after the &#8220;OpenSUSE Loading&#8221; progress bar, and of course, this means that you won&#8217;t be able to install it. <a href="https://bugzilla.novell.com/show_bug.cgi?id=430453">Bug #430453</a>. Remember to remove &#8220;acpi=off&#8221; from your kernel arguments after installing: open YaST and edit it, in &#8220;Boot Loader&#8221;. Don&#8217;t forget to update your OpenSUSE before continuing.</p>
<p><strong>Video configuration</strong></p>
<p>By default you will use <em>vesa</em> in your Video card, so, you&#8217;ll need ATI drivers ( <em>fglrx</em>), just follow the <a href="http://en.opensuse.org/ATI_Driver_HOWTO">1-click installer</a>. After installation don&#8217;t forget to logout. Then use a terminal: CTRL+ALT+F1 and:</p>
<ul>
<li>Stop gdm:
<pre>sudo gdm-stop</pre>
</li>
<li>Update Xorg file:
<pre>sudo aticonfig --initial</pre>
</li>
<li>Run:
<pre>sudo sax2 -r</pre>
</li>
<li>Sax2 will detect your card, however, you will have to explicitly indicate your first mouse device, select &#8220;Synaptics&#8221; and save your settings, otherwise using your mousepad will be <strong>really</strong> annoying.</li>
<li>Start GDM:
<pre>gdm-start</pre>
</li>
</ul>
<p>Compiz works, but I recommend you to disable <em>&#8220;mimap&#8221;</em> in &#8220;Application Switcher&#8221; Compiz Plugin, otherwise you will see a blank screen in each application preview when doing ALT+TAB.</p>
<p><strong>Sound</strong></p>
<p>The Sound Card is detected, but doesn&#8217;t work, you can use YaST to set the model in your Sound Card, however due to a bug the value isn&#8217;t saved (<a href="https://bugzilla.novell.com/show_bug.cgi?id=430734">Bug #430734</a>), so you have to edit: <em>/etc/modprobe.d/alsa-base</em> and add the following line:</p>
<pre>options snd-hda-intel model=dell</pre>
<p><strong>Wireless</strong></p>
<p>I found in several forums that enabling ndiswrapper and installing the MS Windows driver will allow you to use your wireless card, however, it didn&#8217;t work for me. I installed <a href=" http://www.broadcom.com/support/802.11/linux_sta.php">official Broadcom module</a> instead. You will need to download the x64 version (of course!) and follow the <a href="http://www.broadcom.com/docs/linux_sta/README.txt">README</a>. I copied the tar.gz to <em>/opt/bcm4322</em> because I wanted to install the module automatically into the kernel every time the computer starts up, so editing: <em>/etc/init.d/boot.local</em> and adding the following lines make it happen: </p>
<ul>
<li>/sbin/modprobe -k ieee80211_crypt_tkip</li>
<li>/sbin/insmod /opt/bcm4322/wl.ko</li>
</ul>
<p><strong>Tablet PC</strong></p>
<p>Don&#8217;t forget to read the <a href="http://en.opensuse.org/TabletPCs">OpenSuSE Tablet PC Page</a>. First, you will have to add a new repository that includes support for this Tablet PC</p>
<pre>http://download.opensuse.org/repositories/home:/dkukawka/</pre>
<p>and install the following packages:</p>
<ul>
<li>wacom-kmp-default</li>
<li>x11-input-wacom</li>
<li>x11-input-wacom-tools</li>
</ul>
<p>Next, to load your wacom module automatically you have to edit your <em>/etc/init.d/boot.local</em>:</p>
<p><pre>/sbin/modprobe -k wacom</pre>
</p>
<p>You will have to log out and log in before setting up your Tablet support. Open YaST to configure your X11, in &#8220;Graphics Card and Monitor&#8221;, your screen will be black, don&#8217;t get scared, this is expected. In YaST you will have to modify your screen resolution to 12.2, because by default is detected as something else, otherwise the Pen won&#8217;t work as expected because of the screen resolution. (<a href="https://bugzilla.novell.com/show_bug.cgi?id=430527">Bug #430527</a>)</p>
<p><strong>Screen Rotation</strong></p>
<p>Seems that Screen Rotation isn&#8217;t yet supported, (according to <a href="http://wiki.cchtml.com/index.php/Features">this</a>), there&#8217;s an open bug in ATI Drivers that you <a href="http://ati.cchtml.com/show_bug.cgi?id=119">can follow</a>, is 3 years old <img src='http://blog.carrion.mx/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . However seems that some brave people had managed to get it, I haven&#8217;t tested it:</p>
<ul>
<li>http://ubuntuforums.org/showthread.php?p=4680284</li>
<li>http://ubuntuforums.org/showthread.php?t=703806</li>
</ul>
<p><strong>Memory Card Reader</strong></p>
<p>Nothing to configure here. Plug your card and it should mount it automatically.</p>
<p><strong>Bluetooth</strong></p>
<p>Nothing to configure here.</p>
<p><strong>Webcam</strong></p>
<p>Nothing to configure here, run <em><a href="http://live.gnome.org/Cheese">cheese</a></em> and have fun.</p>
<p><strong>Fingerprint Reader</strong></p>
<p>You need to add the following repository to YaST. (<a href="https://bugzilla.novell.com/show_bug.cgi?id=432199">Bug 432199</a>)</p>
<pre>http://download.opensuse.org/repositories/home:/dgege:/fprint/openSUSE_11.0/</pre>
<p>and install the following packages: <em>pam_fprint libfprint fprint_demo</em>. Notice that even the device is supported I don&#8217;t see a real use for it, IMO, I mean, the integration is not yet tight so, you can&#8217;t do too much. To configure your fingerprint you have to do execute:</p>
<pre>fprint_demo</pre>
<p>Your user must be in the <em>fprint</em> group. Scan your fingerprints. BTW, there&#8217;s a bug in the x86_64 package, you can fix it doing the following:</p>
<pre>ln -s /lib/security/pam_fprint.so /lib64/security/</pre>
<p>This is needed if you want to test your fingerprint with PAM: <em>/etc/pam.d/common-auth</em> </p>
<pre>auth   sufficient      pam_fprint.so</pre>
<p><strong>Remote Controls</strong></p>
<p>I haven&#8217;t set up this completely, however seems that the device is somehow supported. You will need the following package: <em>lirc-kmp-default lirc-32bit</em>. I&#8217;ve followed <a href="http://gentoo-wiki.com/Lirc">Gentoo&#8217;s LIRC Page</a>, but nothing. If you find the way to set the Remote Control, let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carrion.mx/2008/10/05/hp-pavilion-tx2500z-part-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
