<?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>Segmentation Fault!</title>
	<atom:link href="http://www.segmentationfault.es/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.segmentationfault.es</link>
	<description>La formulación de un problema es más importante que su solución.</description>
	<lastBuildDate>Tue, 29 Jun 2010 19:45:33 +0000</lastBuildDate>
	<language>es</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to backup your server to Amazon S3</title>
		<link>http://www.segmentationfault.es/2010/06/how-to-backup-your-server-to-amazon-s3/</link>
		<comments>http://www.segmentationfault.es/2010/06/how-to-backup-your-server-to-amazon-s3/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 19:39:27 +0000</pubDate>
		<dc:creator>Christopher Vallés</dc:creator>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[7z]]></category>
		<category><![CDATA[amazon s3]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[s3cmd]]></category>

		<guid isPermaLink="false">http://www.segmentationfault.es/?p=1725</guid>
		<description><![CDATA[This post is a HowTo about backups to Amazon S3 using some tools like 7z, s3cmd and a couple of bash scripts.]]></description>
			<content:encoded><![CDATA[<p>Since a few months ago I&#8217;m taking care of three ubuntu servers with different services like svn, mysql, websites, etc. and for sure I want to provide a flexible, secure and cheap backup system to my customers.</p>
<p>I started playing around with <a href="http://s3tools.org/s3cmd" target="_blank">s3cmd</a> command line utility and I realize that is really powerful so, I decide to write my own scripts to be able to backup automatically all the important files of my servers to the cheaper and easy to use <a href="http://aws.amazon.com/s3/" target="_blank">Amazon S3</a> service.</p>
<p>The whole system is based on two bash scripts, the crontab and a few extra applications like <a href="http://p7zip.sourceforge.net/" target="_blank">7zip</a> and s3cmd. I will explain step by step how I build up the system and at the end I&#8217;ll provide the full code of the scripts.</p>
<h4>Requirements</h4>
<p>The first step is to be sure that you have installed the 7zip and s3cmd tools, in my case I&#8217;m using ubuntu so, for me the command to install the tools is:</p>
<pre class="brush: bash; title: ; notranslate">
sudo apt-get install p7zip s3cmd
</pre>
<h4>Basic setup</h4>
<p>Now we can follow with the basic setup, I created a folder in the root of the filesystem called backups, the inside this folder I create serveral folders, at the end the structure is like follow:</p>
<pre class="brush: bash; title: ; notranslate">
/backups
    /compressed
    /data
        /db
        /svn
        /www
    /scripts
</pre>
<p>The compressed folder is used at the end of the script to compress all the files to one .7z file, in the data folder we will copy the information we want to backup and in the scripts folder we will store as it&#8217;s name says the two scripts we will use.</p>
<h4>Backup script</h4>
<p>Now, let&#8217;s have a look at those scripts. The first one is to do the backup, in my case I&#8217;m doing a backup of the subversion, mysql and files under /var/www.</p>
<p>The script starts with the following block:</p>
<pre class="brush: bash; title: ; notranslate">
echo `date '+%F %T'`: Starting the backup

#Dumping the repos
echo `date '+%F %T'`: Starting the dump of the repos
for i in /user/local/svn/*/; do
    repo=`basename $i`
    echo `date '+%F %T'`: Dumping repo $repo
    /usr/bin/svnadmin dump /usr/local/svn/$repo &gt; /backups/data/svn/$repo.dump
    echo `date '+%F %T'`: Repo $repo dumped
done
</pre>
<p>We suppose that the svn folder is located at /usr/local/svn, basically here we are going through each folder inside /usr/local/svn/ and we call svnadmin dump to dump that repository in one file, that file is stored in /backups/data/svn/.</p>
<pre class="brush: bash; title: ; notranslate">
#Dumping the DB
echo `date '+%F %T'`: Starting the dump of the DataBases
for i in /var/lib/mysql/*/; do
    db=`basename $i`
    echo `date '+%F %T'`: Dumping DB $db
    /usr/bin/mysqldump -uroot -p$db_password $db &gt; /backups/data/db/$db.sql
    echo `date '+%F %T'`: Database $db dumped
done
</pre>
<p>In this second block we are doing more or less the same thing, we are going through each folder on /var/lib/mysql/ and calling mysqldump to export each DB in one file stored at /backups/data/db/.</p>
<pre class="brush: bash; title: ; notranslate">
#Copy all the websites
echo `date '+%F %T'`: Starting the dump of websites
for i in /var/www/*/; do
    site=`basename $i`
    echo `date '+%F %T'`: Dumping site $site
    /usr/bin/7z a -mx6 -t7z /backups/data/www/$site.7z -p$compression_password /var/www/$site
    echo `date '+%F %T'`: Site $site dumped
done
</pre>
<p>In the third block we are dumping the websites, I have the websites stored at /var/www folder and each site is inside a folder with the domain as folder name. Basically we are doing the same, loop through /var/www/ and compressing each site individually in a .7z file with a compression level of 6 and secured with a password.<br />
I store each site in a separate file because if I have to restore a site I don&#8217;t need to uncompress all the sites, just the main file and then the compressed site.<br />
I was playing with different compression levels and 6 is the most suitable to maintain a good compression ratio without wasting a lot of time.</p>
<pre class="brush: bash; title: ; notranslate">
#Compressing all the data
echo `date '+%F %T'`: Compressing the info
filename=$(date +%Y%m%d)
/usr/bin/7z a -mx6 -t7z /backups/compressed/$filename.7z -p$password /backups/data/*
echo `date '+%F %T'`: Info compressed
</pre>
<p>Now with all the information we want to backup in place we will compress all together in one single file, that&#8217;s the purpose of this block of code, the final filename is a timestamp of today using the date command.</p>
<pre class="brush: bash; title: ; notranslate">
#Upload to Amazon S3
echo `date '+%F %T'`: Uploading to Amazon S3
/usr/bin/s3cmd put --no-progress /backups/compressed/$filename.7z s3://BUCKET_NAME/$filename.7z
echo `date '+%F %T'`: Upload completed
</pre>
<p>Ok, we have the compressed file and one of the final steps is upload this file to Amazon S3. For that task we are using the s3cmd tool passing the parameter &#8211;no-progress to avoid an &#8220;interactive&#8221; output of the upload status.</p>
<pre class="brush: bash; title: ; notranslate">
#Delete the local backups
echo `date '+%F %T'`: Cleaning up
rm -Rf /backups/data/svn/*
rm -Rf /backups/data/db/*
rm -Rf /backups/data/www/*
rm -Rf /backups/compressed/*
echo `date '+%F %T'`: Clean completed
echo `date '+%F %T'`: Backup completed
</pre>
<p>And the final block of code is just a clean up, after the upload to amazon we delete all the files we have generated inside the /backups folder.</p>
<p>Ok, seems complex but is pretty strightforward, also if you take a look you&#8217;ll see that all the messages contains a timestamp, with that information we are able to determine how many time we spend in each task.<br />
One disadvantage of this script is that we are not checking if the file was uploaded correctly to Amazon, maybe this will be a future improvement.</p>
<h4>Maintenance script</h4>
<p>Now let&#8217;s take a look at the other script, the purpose is just delete old backups based on a timestamp, in my case we&#8217;re storing the backups for one month, it&#8217;s very affordable with the Amazon prices. </p>
<pre class="brush: bash; title: ; notranslate">
for filename in `s3cmd ls s3://$bucket`; do
    if [[ $filename =~ ([0-9]*)\.7z ]]; then
        timestamp=${BASH_REMATCH[1]}
        echo `date '+%F %T'` - Reading metadata of: $filename
        echo -e &quot;\tFilename: $filename&quot;
        echo -e &quot;\tTimestamp: $timestamp&quot;
        if [[ $timestamp -le $limit ]]; then
            let &quot;total=total+1&quot;
            echo -e &quot;\tResult: Backup deleted\n&quot;
            /usr/bin/s3cmd del $filename
        else
            echo -e &quot;\tResult: Backup keeped\n&quot;
        fi
    fi
done
</pre>
<p>This is the only code block we have in the maintenance script, the idea is to retrieve the list of files we have in the bucket with s3cmd, then we check if the gived part contains the pattern ([0-9]*)\.7z (because the command s3cmd ls gives more information rather than just the filenames).<br />
If we detect a segment that matches the regex we get the filename without the extension (the timestamp of the backup), and we check in this case if the timestamp is older than one month (the timestamp of one month ago is stored in the $limit variable). If the backup is older we remove it calling the s3cmd del command.</p>
<p>If you need to store the files more time just change the $limit variable and that&#8217;s it.</p>
<p>Wow, seems a large process, ok, now let&#8217;s have a look at the last step to let this work, the cronjobs.<br />
I created to cronjobs and redirected the output of them to the stdout because I want to receive an email after the backup, my crontab look like this:</p>
<pre class="brush: bash; title: ; notranslate">
# m h  dom mon dow   command
MAILTO=YOUR_EMAIL_ADDRESS_HERE
00 22 * * * /backups/scripts/s3backup 2&gt;&amp;1
00 23 * * * /backups/scripts/s3backup-maintenance 2&gt;&amp;1
</pre>
<p>Just put there the values you want to run the crons and don&#8217;t forget to put at the end 2>&#038;1.</p>
<h4>Conclusion</h4>
<p>With this system you&#8217;ll have your backups in a safe and cheap place without headaches and with a full report in you email every time the script runs. For sure these scripts can be impoved with a few checks and you can extend it to fit your needs.<br />
I hope you have enjoyed this HowTo and begin to use this scripts! For sure improvements are welcomed, don&#8217;t hesitate to comment!.</p>
<h4>Source code</h4>
<p>Grab the full source code of the <a href="http://pastie.textmate.org/1023939" target="_blank">backup script</a> and the <a href="http://pastie.textmate.org/1023947" target="_blank">maintenance script</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.segmentationfault.es/2010/06/how-to-backup-your-server-to-amazon-s3/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Startup online tools: Google Analytics</title>
		<link>http://www.segmentationfault.es/2010/05/startup-online-tools-google-analytics/</link>
		<comments>http://www.segmentationfault.es/2010/05/startup-online-tools-google-analytics/#comments</comments>
		<pubDate>Mon, 10 May 2010 07:32:18 +0000</pubDate>
		<dc:creator>Christopher Vallés</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.segmentationfault.es/?p=1708</guid>
		<description><![CDATA[If you are thinking on a web based project and you want to receive and maintain as much traffic as possible Google Analytics will be your fellow traveler.
Google Analytics is a complete suite to analize and extract information about your traffic, your visitors and at the end the performance of your website and contents.]]></description>
			<content:encoded><![CDATA[<p>If you are thinking on a web based project and you want to receive and maintain as much traffic as possible Google Analytics will be your fellow traveler.<br />
<a href="http://analytics.google.com" target="_blank">Google Analytics</a> is a complete suite to analize and extract information about your traffic, your visitors and at the end the performance of your website and contents.</p>
<p>The basic information that GA gives to you is the number of visitors per day, week, month or custom ranges, also you can see the referrers of your page and the keywords they used to find you over google or another search engine.<br />
More complex tasks are for example the funnels, the objectives, etc. For example, imagine that we have a online service website and we want to know the conversion ratio between the traffic that arrives at our website and the people that finally buys our service. In GA we can setup a Goal, this goal at the end is a destination url, time on the site or pageviews per user. So, for our example we will setup a goal for a specific url, that can be our service payment confirmation page. With that goal in place we will have our usual information about how many traffic we have and then a specific information about how many traffic arrives to the confirmation page.</p>
<p>After that to see in a nice way all that information we can use other tool inside GA called funnels. The funnel is a graphic to display that kind of information, imagine that our checkout process have 2 steps plus the confirmation page, with that in mind we can create a funnel to see how many traffic passes for every stage of the checkout.</p>
<p>In the following picture we can see a funnel example, in this e-commerce shop we have 3481 total visits and only 241 do the login on the page, of this 241 users 146 places an order and 119 users complete the order, that means a conversion rate of 0.09%.</p>
<p><a href="http://www.segmentationfault.es/wp-content/2010/05/google_analytics_funnel_visualization_lg.gif"><img class="size-full wp-image-1709 alignnone" title="google_analytics_funnel_visualization_lg" src="http://www.segmentationfault.es/wp-content/2010/05/google_analytics_funnel_visualization_lg.gif" alt="" width="507" height="530" /></a></p>
<p>These are just some ideas and tools availables in GA, so don&#8217;t forget to use this kind of tools in your websites to extract as much information as possible to know how the market reacts upon your products and processes.</p>
<p>To continue reading and learning about this tool you can visit the <a href="http://services.google.com/analytics/tour/index_en-US.html" target="_blank">Google Analytics Tour Page</a> or just go to <a href="http://analytics.google.com" target="_blank">Google Analytics</a> and create an account!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.segmentationfault.es/2010/05/startup-online-tools-google-analytics/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Startup online tools: Jira</title>
		<link>http://www.segmentationfault.es/2010/05/startup-online-tools-jira/</link>
		<comments>http://www.segmentationfault.es/2010/05/startup-online-tools-jira/#comments</comments>
		<pubDate>Tue, 04 May 2010 08:25:46 +0000</pubDate>
		<dc:creator>Gabi García</dc:creator>
				<category><![CDATA[Startup]]></category>

		<guid isPermaLink="false">http://www.segmentationfault.es/?p=1687</guid>
		<description><![CDATA[If your startup is based on a software product, you must develop it and you want to do it in the best way. Besides, if you are (or have) a developers team, you will need to manage tasks, resources, code releases, etc. So, maybe a issue and project tracking like Jira could be really useful [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.segmentationfault.es/wp-content/2010/05/jira1.jpg"><img class="size-thumbnail wp-image-1688 alignnone" title="jira1" src="http://www.segmentationfault.es/wp-content/2010/05/jira1-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>If your startup is based on a software product, you must develop it and you want to do it in the best way. Besides, if you are (or have) a developers team, you will need to manage tasks, resources, code releases, etc. So, maybe a issue and project tracking like Jira could be really useful for you.<a href="http://www.atlassian.com/software/jira/" target="_blank"></a></p>
<p><a href="http://www.atlassian.com/software/jira/" target="_blank">Jira</a> is a web-application with a clean and fast interface that will become the centre of your development team. Each issue is modeled in Jira as a ticket which can be assigned to any member of the team with an associated ETA (estimated time of arrival).</p>
<p>This software from Atlassian has integration with control versions systems, such as SVN and Git. Jira also allows you to custom the workflow of the tickets, in order to represent better the real workflow of your business. Then, you can create many reports and analyse all the information.</p>
<p>Software licenses for Jira prices starts on $10 for 10 users (deploy on your server) or free if you are working on a Open Source project. You can see all pricings <a href="http://www.atlassian.com/software/jira/pricing.jsp" target="_blank">here</a>.</p>
<p><object id="ep_player" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="540" height="391" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="name" value="ep_player" /><param name="data" value="http://cdn.episodic.com/player/EpisodicPlayer.swf?config=http%3A%2F%2Fcdn.episodic.com%2Fshows%2F13%2Fnmq11yh38p3h%2Fconfig.xml" /><param name="AllowScriptAccess" value="always" /><param name="allowfullscreen" value="true" /><param name="src" value="http://cdn.episodic.com/player/EpisodicPlayer.swf?config=http%3A%2F%2Fcdn.episodic.com%2Fshows%2F13%2Fnmq11yh38p3h%2Fconfig.xml" /><embed id="ep_player" type="application/x-shockwave-flash" width="540" height="391" src="http://cdn.episodic.com/player/EpisodicPlayer.swf?config=http%3A%2F%2Fcdn.episodic.com%2Fshows%2F13%2Fnmq11yh38p3h%2Fconfig.xml" allowfullscreen="true" allowscriptaccess="always" data="http://cdn.episodic.com/player/EpisodicPlayer.swf?config=http%3A%2F%2Fcdn.episodic.com%2Fshows%2F13%2Fnmq11yh38p3h%2Fconfig.xml" name="ep_player"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.segmentationfault.es/2010/05/startup-online-tools-jira/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Startup online tools: uservoice</title>
		<link>http://www.segmentationfault.es/2010/04/startup-online-tools-uservoice/</link>
		<comments>http://www.segmentationfault.es/2010/04/startup-online-tools-uservoice/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 13:41:50 +0000</pubDate>
		<dc:creator>Gabi García</dc:creator>
				<category><![CDATA[Startup]]></category>

		<guid isPermaLink="false">http://www.segmentationfault.es/?p=1647</guid>
		<description><![CDATA[When you have a web-based product or an online service, specially when it has been on creation process yet, you need feedback to know what users want. So you can know the features that people demand on your site and develope it as soon as posible, building your product based on that information. In this [...]]]></description>
			<content:encoded><![CDATA[<p>When you have a web-based product  or an online service, specially when it has been on creation process  yet, you need feedback to know what users want. So you can know the  features that people demand on your site and develope it as soon as  posible, building your product based on that information. In this  manner, you <span>avoid wasting time  developing unnecessary or <span>outdated</span> features.  Getting feedback is also very important to stay updated.</span></p>
<p><em><strong>uservoice</strong> </em>is an online tool to manage feedback <span>easily</span> on your site. You only have to put on your website a simple tab  with the label &#8220;feedback&#8221; linked to your uservoice account. Then, when a  user clicks on this tab, will open a <em>lightbox </em>style pop-up that  allows the user to leave his ideas, suggestions, bugs or anything else.  As an admin, uservoice provides you a backoffice  where you can manage that information. So you can reply to user to thank them, delete the information  if consider that it isn&#8217;t useful or maybe let the user know that his  idea or bug will be done or fixed in future releases.</p>
<p style="text-align: center;"><a href="http://www.segmentationfault.es/wp-content/2010/04/feedback_widget_popup.png"><img class="size-medium wp-image-1648 aligncenter" title="feedback_widget_popup" src="http://www.segmentationfault.es/wp-content/2010/04/feedback_widget_popup-300x212.png" alt="" width="300" height="212" /></a></p>
<p>As  many others web services, <em>uservoice </em>has different types of  pricing (Free, Tin, Bronze, Silver and Gold) depending on your needs and  how much you want to pay!</p>
<p>To sum up, we can say that <em>uservoice</em> is a really  powerful online application to manage the feedback you get from your  users with a really low effort and costs. Wanna try? Visit <a href="http://uservoice.com/" target="_blank">http://uservoice.com/</a>.</p>
<p style="text-align: center;"><a href="http://uservoice.com/"><img class="size-full wp-image-1649 aligncenter" title="UserVoice" src="http://www.segmentationfault.es/wp-content/2010/04/UserVoice.png" alt="" width="300" height="79" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.segmentationfault.es/2010/04/startup-online-tools-uservoice/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Startup online tools: Google Apps</title>
		<link>http://www.segmentationfault.es/2010/04/startup-online-tools-google-apps/</link>
		<comments>http://www.segmentationfault.es/2010/04/startup-online-tools-google-apps/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 08:43:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Startup]]></category>

		<guid isPermaLink="false">http://www.segmentationfault.es/?p=1633</guid>
		<description><![CDATA[One of the most useful apps for Startups is the suite Google Apps. This service provided by Google company allow using custom domain names with several Google products, including: GMail, Calendar, Talk, Docs and Google Sites.]]></description>
			<content:encoded><![CDATA[<p>One of the most useful apps for Startups is the suite Google Apps. This service provided by Google company allow using custom domain names with several Google products, including: GMail, Calendar, Talk, Docs and Google Sites.</p>
<p>Google Apps is a web-based solution, so it has all the advantatges of Cloud Computing applications. You can access to it anywhere and anytime (if you have an Internet connection).</p>
<p style="text-align: center;"><a href="http://www.segmentationfault.es/wp-content/2010/04/cloud_computing1.jpg"><img class="alignnone size-full wp-image-1638" title="Google App Cloud Computing" src="http://www.segmentationfault.es/wp-content/2010/04/cloud_computing1.jpg" alt="" width="469" height="435" /></a></p>
<p>This services provide you 50 times more storage than the industry average with 99.9% uptime reliability guarantee with synchronous replication. Also offer you Mobile email, calendar, IM access and helpful 24/7 customer support.</p>
<p>Standard edition is perfect to newly emerged Startups because it&#8217;s free! But it has some limitations: 50 users maximum, email attachments cannot be larger than 25 MB, limited to sendig email to 500 external recipients per day per email account and less uptime guaranteed. 24/7 support is also offered only for Premium accounts.</p>
<p>Finally, we let you a quick tour video of Google Apps to encourage you to test this amazing suite for your company.</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" 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/kJT3pagjd8s&amp;hl=es_ES&amp;fs=1&amp;color1=0x2b405b&amp;color2=0x6b8ab6" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/kJT3pagjd8s&amp;hl=es_ES&amp;fs=1&amp;color1=0x2b405b&amp;color2=0x6b8ab6" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.segmentationfault.es/2010/04/startup-online-tools-google-apps/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Message to our followers!</title>
		<link>http://www.segmentationfault.es/2010/04/message-to-followers/</link>
		<comments>http://www.segmentationfault.es/2010/04/message-to-followers/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 17:26:58 +0000</pubDate>
		<dc:creator>Gabi García</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.segmentationfault.es/?p=1630</guid>
		<description><![CDATA[Hi to our followers! First of all, we apologies for the unexpected changes done in the SegmentationFault Blog. As you may notice, we have transform our old blog into a corporative website, with a new appearence, and we have decided to write exclusively in English from now on. One year ago we started this blog [...]]]></description>
			<content:encoded><![CDATA[<p>Hi to our followers!</p>
<p>First of all, we apologies for the unexpected changes done in the SegmentationFault Blog. As you may notice, we have transform our old blog into a corporative website, with a new appearence, and we have decided to write exclusively in English from now on.</p>
<p>One year ago we started this blog with the aim of shareing with others a bit of knowledge that we learn everyday. Now, SegmentationFault is becoming to be a more serious project, specially since we are participating in <a href="http://blog.tetuanvalley.com/" target="_blank">Tetuan Valley</a> Startup Spring School 2010.</p>
<p>We hope to continue having your support at this time, with your feedback on the blog or following us on Twitter (@sfteam).</p>
<p>Best regards for all of you,</p>
<p>Christopher, Noemí and Gabriel<br />
SegmentationFault team</p>
]]></content:encoded>
			<wfw:commentRss>http://www.segmentationfault.es/2010/04/message-to-followers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Implement decisions based on truth tables</title>
		<link>http://www.segmentationfault.es/2010/03/decisions-based-on-truth-tables/</link>
		<comments>http://www.segmentationfault.es/2010/03/decisions-based-on-truth-tables/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 14:56:41 +0000</pubDate>
		<dc:creator>Christopher Vallés</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Truth Tables]]></category>

		<guid isPermaLink="false">http://www.segmentationfault.es/?p=1432</guid>
		<description><![CDATA[The other day in my work I find myself in a situation that I had to implement some decisions based on a truth table. Thinking about how it's the best approach to solve the problem I found the following solutions. Which do you think it's the best approach?]]></description>
			<content:encoded><![CDATA[<p>The other day in my work I find myself in a situation that I had to implement some decisions based on a truth table. After simplify the table I finish with a 2&#215;4 table like the below:</p>
<pre style="text-align: center;">+----+----+--------+
| CS | LF | Locale |
+----+----+--------+
| 0  | 0  | DL_DC  |
| 0  | 1  | LF_DC  |
| 1  | 0  | DL_CS  |
| 1  | 1  | LF_CS  |
+----+----+--------+
</pre>
<p><strong>Lengend</strong></p>
<ul>
<li><strong>CS</strong> = Country Supported in the System</li>
<li><strong>LF</strong> = Language Forced in the URL</li>
<li><strong>DL_DC</strong> = Locale for the default country with the default language configured on the DB</li>
<li><strong>LF_DC</strong> = Locale for the default country but with the language forced in the URL</li>
<li><strong>DL_CS</strong> = Locale for the country detected with the default language configured on the DB</li>
<li><strong>LF_CS</strong> = Locale for the country detected with the language forced in the URL</li>
</ul>
<p>Thinking about how it&#8217;s the best approach to solve the problem I found the following solutions.</p>
<p><script src='http://pastie.org/857090.js'></script></p>
<p>Which do you think it&#8217;s the best approach?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.segmentationfault.es/2010/03/decisions-based-on-truth-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS: the &#8216;opacity&#8217; property</title>
		<link>http://www.segmentationfault.es/2010/02/css-opacity/</link>
		<comments>http://www.segmentationfault.es/2010/02/css-opacity/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 13:01:38 +0000</pubDate>
		<dc:creator>Noemí Losada</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[efectos visuales]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.segmentationfault.es/?p=1361</guid>
		<description><![CDATA[Today we will talk about the property 'opacity' in CSS and how it works on IE and Firefox at the same time.]]></description>
			<content:encoded><![CDATA[<p>Today we will talk about the &#8216;opacity&#8217; property in CSS and how it works on IE and Firefox at the same time.</p>
<p>We will try to get the same effect as the image below:</p>
<style type="text/css">
.background{ background-image: url(/wp-content/2010/02/caracol.png); width: 300px; height: 208px; margin-right: auto; margin-left: auto; border: 1px solid #000000; } .white{ background-color: #ffffff; width: 250px; height: 158px; border: solid 1px #000000; margin: 25px 25px; opacity: 0.6; filter:alpha(opacity=60); }</style>
<div class="background">
<div class="white">This is an exemple with the property opacity of CSS</div>
</div>
<p>To create this effect you have to add the following lines on the html file:</p>
<pre class="brush: xml; title: ; notranslate">
﻿&lt;div class=&quot;background&quot;&gt;
   &lt;div class=&quot;white&quot;&gt;This is an exemple with the CSS opacity property&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>The first div have the class &#8220;background&#8221; to put a standard background and the second div is inside the first div to put another background called &#8220;white&#8221; over the first background.</p>
<p>Now you can customize the classes with the following attributes and values on your css file:</p>
<pre class="brush: css; title: ; notranslate">
.background{
 background-image: url(caracol.png);
 width: 300px;
 height: 208px;
 border: 1px solid #000000;
}

.white{
 background-color: #ffffff;
 width: 250px;
 height: 158px;
 border: solid 1px #000000;
 margin: 25px 25px;
 opacity: 0.6;
 filter:alpha(opacity=60);
}
</pre>
<p>The class &#8220;background&#8221; contains an image background, the class &#8220;white&#8221; contains a background color with the opacity property to obtain the transparent effect. The attribute &#8220;opacity: 0.6;&#8221; is for Firefox and the values can go from 1.0 to 0.0, to be able to show this effect in IE you have to use the following code  &#8220;filter:alpha(opacity=60);&#8221; and the possible values can go from 100 to 0.</p>
<p>Remember to put the Doctype declaration on your HTML file to avoid the problems with the diferents bowsers and also write a stardard code.</p>
<p>I hope you enjoy it and do not hesitate if you have any doubt. <img src='http://www.segmentationfault.es/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.segmentationfault.es/2010/02/css-opacity/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>From the Array to the Object</title>
		<link>http://www.segmentationfault.es/2010/02/from-the-array-to-the-object/</link>
		<comments>http://www.segmentationfault.es/2010/02/from-the-array-to-the-object/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 12:04:20 +0000</pubDate>
		<dc:creator>Christopher Vallés</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[object]]></category>
		<category><![CDATA[recursivity]]></category>
		<category><![CDATA[stdClass]]></category>

		<guid isPermaLink="false">http://www.segmentationfault.es/?p=1411</guid>
		<description><![CDATA[The other day working late with my colleague Tudor we found that in one point of our application we had to use an object but we had an Array. At this point we found two possible solutions, the first rewrite our code to use the Array instead the object or the second and more sophisticated solution convert the Array to an Object.]]></description>
			<content:encoded><![CDATA[<p>The other day working late with my colleague Tudor, who also have a blog at <a href="http://blog.motane.lu" target="_blank">blog.motane.lu</a>, we found that in one point of our application we had to use an object but we had an Array. At this point we found two possible solutions, the first rewrite our code to use the Array instead the object or the second and more sophisticated solution convert the Array to an Object.</p>
<p>The tricky point was that the Array could contain more Arrays so we had to write a recursive function to accomplish our objective.</p>
<p>Tudor, at the end, gave the following method to be able to do the conversion.</p>
<pre class="brush: php; title: ; notranslate">
/**
 * Recursively converts an array to a stdClass object
 *
 * @param array $array
 * @return stdClass
 */
 protected function _convertToStdObject(array $array){
   $obj = new stdClass();
   foreach($array as $key =&gt; $value) {
     if(!is_array($value)) {
       $obj-&gt;{$key} = $value;
     }else{
       $obj-&gt;{$key} = $this-&gt;_convertToStdObject($value);
     }
   }

   return $obj;
 }
</pre>
<p>Maybe, in the next interviews we will do to our PHP Developers candidates, we will ask about this and see how they solve the problem <img src='http://www.segmentationfault.es/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.segmentationfault.es/2010/02/from-the-array-to-the-object/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mejorando la búsqueda usando la Web 2.0</title>
		<link>http://www.segmentationfault.es/2010/02/mejorando-busqueda-web/</link>
		<comments>http://www.segmentationfault.es/2010/02/mejorando-busqueda-web/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 10:35:50 +0000</pubDate>
		<dc:creator>Gabi García</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[recuperación de información]]></category>
		<category><![CDATA[web 2.0]]></category>

		<guid isPermaLink="false">http://www.segmentationfault.es/?p=1352</guid>
		<description><![CDATA[Hace unos días asistí a una conferencia de Ricardo Baeza titulada "Mejorando la búsqueda usando la Web 2.0". A pesar de que en el Blog acostumbramos a postear entradas de carácter más práctico que divulgativo, he decidido postear un pequeño ensayo sobre dicha conferencia ya que me resultó interesante y motivo de alguna que otra reflexión.]]></description>
			<content:encoded><![CDATA[<p>En la actualidad, Internet nos ofrece una cantidad ingente de datos de todo tipo (texto, imágenes, vídeos…) y sobre cualquier temática posible. De hecho, el volumen de datos actual ha provocado que una de las grandes problemáticas de la Web sea la necesidad de buscar y filtrar toda esa información para que resulte útil.</p>
<p>Para ello, debemos discernir, en primera instancia, entre los datos que conforman el contenido propiamente dicho (normalmente documentos jerarquizados que siguen una estructura) y los llamados metadatos. ¿Y qué son los metadatos? Entendemos por metadatos, los datos que contienen información sobre los propios datos (etiquetas, enlaces, <em>reviews</em>, <em>pageviews</em>, etc.).</p>
<p>Otro aspecto muy a tener en cuenta en el proceso de clasificación de los datos es la privacidad de éstos. Los buscadores utilizan la información para devolver resultados cada vez más adecuados a los usuarios, y parte de ella (como las <em>querys</em> o los <em>clicks</em>) pueden revelar algunos datos personales.</p>
<p>Llegados a este punto se nos formulan algunas preguntas nada despreciables: ¿Cómo podemos utilizar estos datos? ¿Con qué criterio los organizamos? ¿Cuán fiables son los datos que poseemos?</p>
<p>En lo que respecta a la fiabilidad de los datos, podemos hacer una reflexión desde el punto de vista estadístico. Teniendo en cuenta que el conjunto de búsquedas/visitas es muy elevado, y curiosamente la mayoría de ellas son sobre un conjunto de temas comunes (la llamada “<em>long tale</em>” en la representación gráfica), la distribución tenderá a ser una distribución normal o <em>gaussiana</em>. La media de todos los datos será, por lo tanto, un resultado sorprendentemente bueno.</p>
<p>Así, podemos aprovechar que el conocimiento colectivo supera, en la mayor parte de los casos, al conocimiento individual. Toda esta teoría está detallada en profundidad en el libro <em>The Wisdom of Crowds: Why the Many Are Smarter Than the Few and How Collective Wisdom Shapes Business, Economies, Societies and Nations </em>de <em>James Surowiecki</em>.</p>
<p>Aún disponiendo de datos fiables, debemos establecer una organización y clasificación para que resulten realmente útiles al usuario final. Esto requiere determinar unos criterios sobre el conjunto de información (texto, enlaces, etiquetas, <em>queries</em>, etc.) para medir la calidad de cada recurso.</p>
<p>La clasificación por excelencia de la Web 1.0 (<em>PageRank</em>) basa la calidad de los documentos en función de los enlaces que “apuntan” a cada uno de ellos. Este ingenioso modelo funcionaba a la perfección cuando los únicos usuarios que realizaban los enlaces en la red de redes eran los administradores. Hoy por hoy cualquiera tiene la posibilidad de crear enlaces y este sistema para clasificar los contenidos está perdiendo fuerza en la Web 2.0.</p>
<p>Un modelo alternativo que tiene un buen desempeño en la actualidad es el etiquetado, en inglés <em>tagging</em>, de los documentos. El usuario que añade una información en Internet se encarga también de definir un conjunto de etiquetas o palabras claves que ayuden a clasificar dicha información.</p>
<p>El etiquetado tiene aplicaciones muy diversas e interesantes. Una de ellas consiste en la selección de contenido teniendo en cuenta la diversidad de términos (<em>topical diversity</em>). Un ejemplo claro es la consulta “Jaguar”, que puede hacer referencia al animal o a la marca de automóviles.</p>
<p>También son útiles los <em>tags</em> para segregar y descartar algunas imágenes en <em>querys</em> determinadas. Por ejemplo, si un usuario busca “Honda Civic” probablemente no querrá encontrar como resultado un conjunto de imágenes del coche con el mismo ángulo. Un resultado óptimo devolvería imágenes desde todos los ángulos posibles. Es lo que se designa con el término <em>visual diversity</em>.</p>
<p>El <em>tagging</em> en imágenes tiene más aplicaciones útiles, como la navegación a partir de las etiquetas (como en <em>Yahoo! TagExplorer</em>) o las anotaciones visuales (<em>use visual annotations</em>), en las que una etiqueta es representada mediante un rectángulo que encuadra un objeto particular. Sistemas de este tipo se utilizan actualmente en portales como <em>Flickr</em> o <em>Facebook</em>.</p>
<p>Pese a todo, el gran inconveniente de este sistema es la necesidad de que el usuario defina los <em>tags</em>, con lo que ello respecta (errores ortográficos, errores tipográficos, subjetividad, heterogeneidad…). Inmediatamente se nos ocurre la idea de implementar un sistema para sugerir etiquetas, pero la experiencia nos dice que el usuario es propenso a hacer uso de la “ley del mínimo esfuerzo”. Es decir, que en la mayoría de los casos el usuario se limitaría a introducir una única etiqueta y seleccionar el resto de ellas del conjunto propuesto por el algoritmo de sugerencia.</p>
<p>Otro modelo que cabe destacar es el basado en la correlación entre los recursos. El principio de funcionamiento de este método es buscar el conjunto de elementos relacionados con la consulta introducida por el usuario (otros nombres, lugares, eventos, imágenes, etc.). Estas interrelaciones entre las entidades se suelen representar como grafos, y se aplican los algoritmos y técnicas de teoría de grafos para su implementación.</p>
<p>Relacionado con lo anterior está el uso de las consultas como etiquetas implícitas (<em>querys as implicit tags</em>). Esta técnica aprovecha las decisiones que toma el usuario para detectar las relaciones entre las búsquedas y etiquetar los recursos. Un ejemplo podría ser dos usuarios que realizan las consultas “Roma” e “Imperio romano” respectivamente y, no obstante, hacen <em>click</em> en el mismo enlace de todos los presentes en los resultados. El sistema detectaría estos casos y haría patente esa relación mediante nuevas transiciones en el <em>click graph</em>.</p>
<p>Un sistema complementario para mejorar las búsquedas en la Web 2.0 es el uso del conocimiento implícito (<em>implicit knowledge</em>). La mejor manera de entender el funcionamiento de esta técnica es con un caso práctico. Supongamos que un usuario introduce la <em>query</em> “tfcu”. Usando el conocimiento implícito debe obtener todos los documentos relacionados con la <em>teachers federal credit union,</em> dado que tfcu es el acrónimo de ésta. Del mismo modo, el sistema debe guardar una relación entre CEE, UE, Comunidad Económica Europea y Unión Europea.</p>
<p>El objetivo principal de la recuperación de información (<em>information retrieval</em>) es devolver el conjunto óptimo de recursos relacionados con lo que el usuario está buscando, en el menor tiempo posible. Todos los modelos mencionados, y muchos otros que se han quedado en el tintero, sirven para acercarse más al objetivo, y el uso combinado de todos ellos produce mejores resultados.</p>
<p>La Web crece en volumen de información y evoluciona a la par que los usuarios requieren disponer de la información más relevante de la forma más rápida posible. ¿Pero, en qué dirección evoluciona la Web? La tendencia marca el progresivo adiós a las búsquedas, dando paso a portales que ofrecerán al usuario justo aquello que desean obtener sin necesidad de que éste lo pida. Dicho así puede sonar bastante utópico. Sin embargo, ¿quién imaginaba hace 20 años que se podría obtener todo tipo de información escribiendo algunas palabras en una caja de texto? ¿Llegará un día en el que abriendo nuestro navegar obtendremos la información que necesitamos sin hacer nada para llegar a ella? Sólo el futuro de la Web tiene la respuesta.</p>
<p><span style="text-decoration: underline;"><strong>Fuente</strong></span></p>
<p>Ricardo Baeza &#8211; http://www.dcc.uchile.cl/~rbaeza/spanish.html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.segmentationfault.es/2010/02/mejorando-busqueda-web/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->