tag:blogger.com,1999:blog-38327488668828453392024-03-13T23:17:12.434-07:00Fer programesWelcome to Fer programes, a blog created with the intention to help us and other programmers in the developing of IT applications. It includes some commands used previously to solve specific problems, links to interesting web pages and general explanations about informatic topics. You are free to collaborate with comments when you consider it is oportune.Unknownnoreply@blogger.comBlogger97125tag:blogger.com,1999:blog-3832748866882845339.post-42024785749796356302013-11-12T09:22:00.000-08:002015-05-16T02:31:22.454-07:00JavaScript intresting links<ul>
</ul>
Miscellaneous: <br />
<ul>
<li><a href="http://savage.net.au/Ron/html/review.of.js.libs.html">Comparing YUI, Dojo, ExtJS, and JQuery</a>.</li>
</ul>
<ul>
<li><a href="http://www.flotcharts.org/">Flotcharts</a>. </li>
</ul>
<ul>
<li><a href="http://www.appelsiini.net/projects/jeditable">JEditable: edit in place plugin form JQuery</a>.</li>
</ul>
<ul>
<li><a href="http://vitalets.github.io/x-editable/demo.html?c=inline">X-editable</a>. </li>
</ul>
<ul>
<li><a href="http://javascriptools.sourceforge.net/samples/sample_mask.html">Input masks</a>. </li>
</ul>
<ul>
<li><a href="http://angularjs.org/">AngularJS</a>. </li>
</ul>
<ul>
<li><a href="http://jqfundamentals.com/chapter/javascript-basics">JQuery fundamentals</a>. </li>
</ul>
<ul>
<li><a href="http://javascriptweblog.wordpress.com/2010/07/06/function-declarations-vs-function-expressions/">Function declarations vs function expressions</a>.</li>
</ul>
<br />
D3.js:<br />
<ul>
<li><a href="http://www.schneidy.com/Tutorials/MapsTutorial.html">D3.js map tutorial</a>. </li>
</ul>
<ul>
<li><a href="http://bl.ocks.org/mbostock/2206340">D3 click to zoom examples</a>. </li>
</ul>
<ul>
<li><a href="http://www.gislounge.com/maps-with-d3/">Making maps with D3</a>. </li>
</ul>
<br />
Datatables: <br />
<ul>
<li><a href="http://datatables.net/release-datatables/examples/advanced_init/dt_events.html">Datatables events</a>. </li>
</ul>
<ul>
<li><a href="https://datatables.net/extras/colvis/">Datatables column visualization selection</a>. </li>
</ul>
<ul>
<li><a href="http://datatables.net/extras/fixedheader/">Datatables fixed headers</a>, <a href="http://datatables.net/extras/fixedcolumns/">fixed columns</a>. </li>
</ul>
<ul>
<li><a href="http://datatables.net/extras/tabletools/">Datatables table tools</a>. </li>
</ul>
<ul>
<li><a href="http://datatables.net/extras/thirdparty/ColumnFilterWidgets/DataTables/extras/ColumnFilterWidgets/">Datatables column filter widgets</a>.</li>
</ul>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-42754954925327757152013-11-12T08:56:00.000-08:002013-11-16T10:49:16.447-08:00Django interesting linksInitialization tutorials:<br />
<ul>
<li><a href="http://www.tangowithdjango.com/">TangoWithDjango</a>. Fantastic tutorial that explains how to build a web site with Django 1.5.4 as a backend and Twitter Bootstrap as a frontend.</li>
</ul>
<ul>
<li><a href="https://docs.djangoproject.com/en/dev/intro/tutorial01/">Django tutorial</a> in <strike>four steps</strike> six steps (wow! Now there is a part introducing tests and another about static files management). The manual of the official django webpage. As the whole framework, the tutorial is excellent.</li>
</ul>
<br />Miscellaneous:<br />
<ul>
<li><a href="http://blog.disqus.com/post/62187806135/scaling-django-to-8-billion-page-views#!">Scaling Django to 8 Billion Page Views</a>. The story of Disqus, how they improved the cache when dealing with high volumes of requests. They used <a href="https://www.varnish-cache.org/">Varnish</a>, a software that works as a cache.</li>
</ul>
<ul>
<li><a href="https://docs.djangoproject.com/en/1.5/howto/static-files/deployment/">How to serve static files in production</a>. Don't forget to run <span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">collectstatic</span></span>! </li>
</ul>
<ul>
<li><a href="https://docs.djangoproject.com/en/1.5/howto/custom-management-commands/">Writing custom admin commands</a>.</li>
</ul>
<ul>
<li><a href="http://pydoc.net/Python/django-nvd3/0.1.10/django_nvd3.templatetags.nvd3_tags/">Django-nvd3</a> package. </li>
</ul>
<ul>
<li><a href="http://thecodeship.com/deployment/deploy-django-apache-virtualenv-and-mod_wsgi/">Deploy Django on Apache with virtualenv and mod-wsgi</a>. </li>
</ul>
<ul><ul>
<li><a href="https://www.digitalocean.com/community/articles/100">Another good tutorial</a>. </li>
</ul>
</ul>
<ul>
<li><a href="https://djangosnippets.org/snippets/2899/">Django authentication with ActiveDirectory</a>.</li>
</ul>
<ul>
<li><a href="http://garmoncheg.blogspot.com.au/2012/07/django-resetting-passwords-with.html">Django resetting passwords</a>. </li>
</ul>
<ul>
<li><a href="https://bradmontgomery.net/blog/2008/11/24/a-simple-django-example-with-ajax/">A simple Django with AJAX example</a>. </li>
</ul>
<ul>
</ul>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-5849757655968773412013-10-23T16:52:00.000-07:002013-11-16T08:40:37.355-08:00Using gitSome useful commands when using git<br />
<br />
Make a commit:<br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">git add *</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">git commit -m "message"</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">git push origin master</span></span><br />
<br />
Recover the state (be careful, overrides local changes!):<br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">git reset --hard HEAD</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">git clean -f -d</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">git pull origin master</span></span><br />
<br />
Delete on the repository the local deleted files:<br />
(from <a href="http://stackoverflow.com/questions/1402776/how-do-i-commit-all-deleted-files-in-git">http://stackoverflow.com/questions/1402776/how-do-i-commit-all-deleted-files-in-git</a>) <br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-34831414978454410782013-10-23T14:41:00.000-07:002013-11-16T08:57:31.420-08:00Using the ndv3.js library<a href="http://nvd3.org/">nvd3.js</a> is an amazing d3 charts library.<br />
<br />
However, it has few documentation in its website. In this post I put a summary of the useful things I've done when working with nvd3.<br />
<ul>
<li>Integrating nvd3 with Django</li>
</ul>
<a href="http://django-nvd3.readthedocs.org/en/latest/">django-nvd3</a> is a Django package which integrates nvd3 charts in a Django-Pythonic way. It also lacks a bit of documentation.<br />
<br />
In <a href="http://pydoc.net/Python/django-nvd3/0.1.10/django_nvd3.templatetags.nvd3_tags/">this site</a> there is the source code of the package, what allows us to see the possible parametrizations of the chart:<br />
<br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">def load_chart(chart_type, series, container, x_is_date=False, x_axis_date_format="%d %b %Y", tag_script_js=True, color_category='category20'):</span></span><br />
<br />
The variable <span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">color category</span></span> is the way to specify the colors range of the chart. However, in my case I had to specify its values in the javascript code instead of doing it directly in Python.<br />
<br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">...</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"><sscript charset="utf-8" language="javascript" type="text/javascript">(javascript)<br />var mycolors = ["#80B898","#007030","#E58A01"];<br />d3.scale.mycolors = function() {<br /> return d3.scale.ordinal().range(mycolors);<br />}</sscript></span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"><sscript charset="utf-8" language="javascript" type="text/javascript">(end javascript) </sscript></span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;"><br />{% load_chart grafico.charttype grafico.chartdata "grafico_container" True "%d %b %Y" color_category='mycolors' %}<br />...</span></span><br />
<br />
<ul>
<li>Customizing more nvd3.js charts</li>
</ul>
If you want further customization on nvd3.js charts then you have to move completely to the js environment. Some useful links I used:<br />
<br />
<a href="http://stackoverflow.com/questions/351495/dynamically-creating-keys-in-javascript-associative-array">Event trigger when a serie is selected</a><br />
<br />
<a href="http://stackoverflow.com/questions/17197407/set-focus-area-in-nvd3-js-linewithfocuschart">Brush extent when working with a line with focus chart</a><br />
<br />
<a href="http://stackoverflow.com/questions/13521080/d3-nvd3-js-updating-other-graphs-on-the-same-page">Updating different d3 charts on the same page </a><br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-79038654914333354702013-06-02T13:41:00.000-07:002013-06-04T13:41:48.814-07:00How to add a Gmail account with double step verification to an Android phoneIt is a bit tricky. When you are asked to write the password, it is not your account password. You must specify a password which is unique for the Android application. It is well explained here:<br />
<br />
<a href="http://alleged.org.uk/pdc/2012/11/29.html">http://alleged.org.uk/pdc/2012/11/29.html</a> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-84009248551784500422013-05-23T12:45:00.000-07:002013-05-25T12:46:08.218-07:00Ubuntu 12.04 things<ul>
<li>How to add to launcher Chrome in incognito mode:</li>
</ul>
<a href="http://askubuntu.com/questions/159630/how-do-i-make-google-chrome-open-incognito-by-default-in-12-04">http://askubuntu.com/questions/159630/how-do-i-make-google-chrome-open-incognito-by-default-in-12-04</a><br />
<br />
<ul>
<li>Configure Ubuntu inside Virtualbox. Install virtualbox-guest-additions</li>
</ul>
<a href="http://askubuntu.com/questions/155947/virtualbox-guest-additions-wont-install-on-ubuntu-server-12-04">http://askubuntu.com/questions/155947/virtualbox-guest-additions-wont-install-on-ubuntu-server-12-04</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-45121841946889965882013-05-08T14:33:00.000-07:002013-05-25T12:59:01.718-07:00CSS - Utilities<ul>
<li>How to make an horizontal list. Very well explained. Step by step: </li>
</ul>
<a href="http://css.maxdesign.com.au/listutorial/horizontal_master.htm">http://css.maxdesign.com.au/listutorial/horizontal_master.htm</a><br />
<br />
<ul>
<li>Resolution order in CSS</li>
</ul>
<a href="http://www.boogiejack.com/CSS_4.html">http://www.boogiejack.com/CSS_4.html</a><br />
<a href="http://www.webteacher.ws/2010/08/26/resolving-conflicts-in-css/">http://www.webteacher.ws/2010/08/26/resolving-conflicts-in-css/</a><br />
<a href="http://www.webteacher.ws/2008/05/19/tip-calculate-the-specificity-of-css-selectors/">http://www.webteacher.ws/2008/05/19/tip-calculate-the-specificity-of-css-selectors/</a><br />
<br />
<ul>
<li>id vs class </li>
</ul>
<a href="http://stackoverflow.com/questions/970730/css-id-vs-class">http://stackoverflow.com/questions/970730/css-id-vs-class</a><br />
<a href="http://stackoverflow.com/questions/544010/css-div-id-vs-div-class">http://stackoverflow.com/questions/544010/css-div-id-vs-div-class</a><br />
<br />
<ul>
<li>3 column liquid layout</li>
</ul>
<a href="http://alistapart.com/article/holygrail">http://alistapart.com/article/holygrail</a><br />
<a href="http://matthewjamestaylor.com/blog/perfect-3-column.htm">http://matthewjamestaylor.com/blog/perfect-3-column.htm</a><br />
<br />
<ul>
<li>How to float divs</li>
</ul>
<a href="http://stackoverflow.com/questions/2156712/how-to-float-3-divs-side-by-side-using-css">http://stackoverflow.com/questions/2156712/how-to-float-3-divs-side-by-side-using-css</a><br />
<br />
<br />
<br />
Apart from these utilities, recently I found "the collection", the most popular set of utlities for the front end desig: <a href="http://en.wikipedia.org/wiki/Twitter_Bootstrap">Twitter Bootstrap</a>. Twitter Bootstrap is a free collection of tools for creating websites and web applications (HTML, CSS, and JavaScript toolkit). It contains HTML and CSS-based design templates for typography, forms, buttons, charts, navigation and other interface components, as well as optional JavaScript extensions. It is the most popular project in GitHub and is used by NASA and MSNBC among others.<br />
<br />
<a href="http://twitter.github.io/bootstrap/">http://twitter.github.io/bootstrap/</a> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-30085960560242622892013-04-28T00:05:00.000-07:002013-05-02T03:08:10.110-07:00How to compile a Python codeInteresting web page:<br />
<br />
<a href="http://effbot.org/pyfaq/how-do-i-create-a-pyc-file.htm">http://effbot.org/pyfaq/how-do-i-create-a-pyc-file.htm</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-88021460478416189032013-01-02T07:41:00.000-08:002013-01-05T07:42:10.151-08:00Galaxy Ace - Boot soundsTo manage the start up and shut down sounds on a Samsung Galaxy Ace device, you must change the following files (with a root admin file manager application, like TotalCommander):<br />
<ul>
<li>Start up: <span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">/system/etc/poweron.ogg</span></span></li>
</ul>
<ul>
<li>Shut down: <span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">/system/media/audio/ui/sh</span></span><wbr></wbr><span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">utdown.og<span style="font-size: x-small;">g</span></span></span></li>
</ul>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;"><span style="font-size: x-small;">Info here: <a href="http://www.youtube.com/watch?v=affvUhk9P1g">http://www.youtube.com/watch?v=affvUhk9P1g</a></span></span> </span></span> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-13524754613045737882012-12-24T03:56:00.000-08:002012-12-27T04:06:58.709-08:00Install and configure Trac in alwaysdata.com web siteI followed this steps to install Trac in the alwaysdata.com web site:<br />
<br />
The main manual is from this page:<br />
<br />
<a href="http://forum.alwaysdata.com/viewtopic.php?pid=3218#p3218">http://forum.alwaysdata.com/viewtopic.php?pid=3218#p3218</a><br />
<br />
<pre class="wiki"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;">PYTHONPATH=~/modules easy_install-2.5 --install-dir ~/modules Genshi==0.6
PYTHONPATH=~/modules easy_install-2.5 --install-dir ~/modules Trac==1.0
./trac-admin /home/<user>/www/trac/myproject initenv
./trac-admin /home/<user>/www/trac/myproject deploy /tmp/deploy
mv /tmp/deploy/* /home/<user>/www/trac</user></user></user></span></span></pre>
<pre class="wiki"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;"> </span></span></pre>
<pre class="wiki"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;">Section 5: Small modification
#!/usr/bin/eval PYTHONPATH=/home/<user>/modules TRAC_ENV=/home/<user>/www/trac/myproject python
Section 6: Small modification
AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ cgi-bin/trac.fcgi/$1 [QSA,L] </user></user></span></span></pre>
<br />
I also had to solve some issues reported here:<br />
<a href="http://forum.alwaysdata.com/viewtopic.php?id=1601">http://forum.alwaysdata.com/viewtopic.php?id=1601</a><br />
<br />
To configure Trac authentication (Trac works with apache authentication) I followed:<br />
<a href="http://trac.edgewall.org/wiki/TracModWSGI#ConfiguringAuthentication">http://trac.edgewall.org/wiki/TracModWSGI#ConfiguringAuthentication</a><br />
<br />
<pre class="wiki"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;">$ htpasswd -c /somewhere/trac.htpasswd admin
New password: <type password="password">
Re-type new password: <type again="again" password="password">
Adding password for user admin</type></type></span></span></pre>
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;"><br /></span></span>
<br />
<pre class="wiki"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;">$ htpasswd /somewhere/trac.htpasswd john
New password: <type password="password">
Re-type new password: <type again="again" password="password">
Adding password for user john</type></type></span></span></pre>
<br />
The final .htaccess file is the following: <br />
<pre class="wiki"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;">AddHandler fcgid-script .fcgi</span></span></pre>
<pre class="wiki"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;">RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ cgi-bin/trac.fcgi/$1 [QSA,L]
AuthType Basic
AuthName "trac"
AuthUserFile /home/<user>/www/trac/trac.htpasswd
Require valid-user</user></span></span></pre>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-55951577868867478192012-11-25T00:24:00.002-08:002012-11-25T00:25:30.621-08:00Accents in javascriptsIn the following link, we can see the codes we have to use to put accents and special characters in javascripts:<br />
<br />
http://www.pjb.com.au/comp/diacritics.html<br />
<br />
It is extremely easy and useful.Camprohttp://www.blogger.com/profile/05995101718097306696noreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-32030878362172774952012-10-18T09:12:00.000-07:002012-10-20T09:12:37.706-07:00SQL-like Map-Reduce programming<a href="http://www.ibm.com/developerworks/opensource/library/os-mapreducesql/index.html">http://www.ibm.com/developerworks/opensource/library/os-mapreducesql/index.html</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-90355641335068202822012-10-12T08:51:00.000-07:002012-10-14T08:51:56.614-07:00Map-Reduce implementation in PythonRecently I discovered a Python implementation of the Map-Reduce framework.<br />
It is mincemeat.py, and can be found here: <a href="https://github.com/michaelfairley/mincemeatpy">https://github.com/michaelfairley/mincemeatpy</a><br />
The advantage is that it is an only-file implementation and it is quite efficient.<br />
There is an example attached with the downloaded file.<br />
To run it, you need just to execute example.py, which will perform the server tasks.<br />
For each client, just run mincemeat.py specifying the server port (127.0.0.1 by default).<br />
<br />
Other implementations of the Map-Reduce pattern in python are:<br />
<br />
octopy<br />
hadoopy<br />
dino<br />
mrjobUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-90585558377435076642012-10-02T08:23:00.000-07:002012-10-04T08:24:12.111-07:00Dynamic Google Earth applicatons with Network Links<a href="http://geochalkboard.wordpress.com/2007/09/04/dynamic-google-earth-applications-with-network-links/">http://geochalkboard.wordpress.com/2007/09/04/dynamic-google-earth-applications-with-network-links/</a><br />
<br />
<a href="http://geochalkboard.wordpress.com/2007/09/20/the-kml-behind-network-links/">http://geochalkboard.wordpress.com/2007/09/20/the-kml-behind-network-links/</a><br />
<br />
<a href="http://geochalkboard.wordpress.com/2007/10/08/creating-dynamic-google-earth-applications-with-python/">http://geochalkboard.wordpress.com/2007/10/08/creating-dynamic-google-earth-applications-with-python/</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-16700158529029245722012-09-30T02:42:00.000-07:002012-10-01T02:42:51.502-07:00Django - User authentication with django-registrationhttp://stackoverflow.com/questions/6127264/newbie-django-error-templatedoesnotexist-at-accounts-login<br />
<br />
https://bitbucket.org/devdoodles/registration_templates/srcUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-55185791555218698342012-09-28T09:26:00.000-07:002012-09-29T09:31:23.241-07:00NoSQL and MapReduce<a href="http://en.wikipedia.org/wiki/NoSQL">NoSQL</a> is a wide variety of database systems that differ of the classical RDBMS based on SQL.<br />
<br />
<a href="http://en.wikipedia.org/wiki/MapReduce">MapReduce</a> is a framework that provides high performance in solving problems in a parallel way of computers, servers, clusters...<br />
<br />
Here there is an interesting presentation about NoSQL and MapReduce: <a href="http://www.slideshare.net/j_singh/nosql-and-mapreduce">http://www.slideshare.net/j_singh/nosql-and-mapreduce</a><br />
<br />
And here a popular NoSQL Databases web page: <a href="http://nosql-database.org/">http://nosql-database.org/</a> <br />
<br />
The <a href="http://en.wikipedia.org/wiki/CAP_theorem">CAP theorem</a> says that, for a distributed system, it is impossible to simultaneously provide the following guarantees:<br />
<ul>
<li>Consistency</li>
<li>Availability</li>
<li>Partition tolerance </li>
</ul>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-25541049464027947062012-08-05T07:02:00.000-07:002012-08-07T07:02:20.529-07:00Agile methodologies and RailsI have found a very interesting online course called Software as a Service in which you are introduced to agile methodologies and Rails programming.<br />
<br />
It can be followed here: <a href="https://www.coursera.org/courses">https://www.coursera.org/courses</a><br />
<br />
Here there is information about the course book and other important information (the assignments are thought to be done working in a virtual machine, which is available there also): <a href="http://beta.saasbook.info/bookware-vm-instructions">http://beta.saasbook.info/bookware-vm-instructions</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-25663790869604744062012-06-14T13:20:00.005-07:002012-06-14T13:20:35.010-07:00What is big data?The best definition I've found in the net:<br />
<br />
Big Data is a term used to describe large collections of data (also known as datasets) that may be unstructured, and grow so large and quickly that it is difficult to manage with regular database or statistics tools.<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-32375429524936934472012-06-05T03:58:00.000-07:002012-06-07T03:59:07.228-07:00SAS - Equivalences between PROC SQL joins and DATA statementsIt is explained here (in Spanish) :<br />
<br />
<a href="http://analisisydecision.es/proc-sql-merge-set/">http://analisisydecision.es/proc-sql-merge-set/</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-66320145971548250122012-04-02T13:22:00.000-07:002012-04-04T13:23:50.988-07:00How to configure the wireless of an Acer Travelmate 2300 in UbuntuI followed this steps and then it worked perfectly!<br /><br /><a href="http://okbon.blogspot.com.es/2008/05/install-acer-travelmate-2300-ipn-2220.html">http://okbon.blogspot.com.es/2008/05/install-acer-travelmate-2300-ipn-2220.html</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-70677099690344182102012-02-29T07:09:00.002-08:002012-04-04T13:25:46.126-07:00mysql - How to order by user defined order/sort by number of items on a field<a href="http://stackoverflow.com/questions/6345377/mysql-how-to-order-by-user-defined-order-sort-by-number-of-items-on-a-field">http://stackoverflow.com/questions/6345377/mysql-how-to-order-by-user-defined-order-sort-by-number-of-items-on-a-field</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-27522571319400229392012-02-15T04:17:00.000-08:002012-02-17T04:17:58.211-08:00Using Django database layer outside of Django<a href="http://stackoverflow.com/questions/2180415/using-django-database-layer-outside-of-django">http://stackoverflow.com/questions/2180415/using-django-database-layer-outside-of-django</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-15325879123894444692012-02-11T02:40:00.000-08:002013-01-12T12:59:06.458-08:00How to redirect output to screen and a fileWith the command tee (in Linux) or the command wtee (in Windows)<br />
<br />
Example (in Linux)<br />
<br />
ls | tee output.txt<br />
<br />
Example (in Windows)<br />
<br />
dir | wtee > output.txtUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-69629036099654425482012-02-08T01:47:00.000-08:002012-09-03T01:34:06.659-07:00RMySQL - How to connect R with MySQL in WindowsFollowing the instructions of <a href="http://stackoverflow.com/questions/4785933/adding-rmysql-package-to-r-fails">http://stackoverflow.com/questions/4785933/adding-rmysql-package-to-r-fails</a><br />
<br />
Important note 1: The installation works when using MySQL for 32bit computers and R for 32bit computers. I have tried to install it to the 64bit version of R but I did not succeed.<br />
<ul>
<li>Install RTools</li>
<li>Install MySQL or header and library files of mysql</li>
<li>Create or edit file <code>C:\Program Files\R\R-2.12.1\etc\Renviron.site</code> and add two lines like <code>CYGWIN=nodosfilewarning<br />MYSQL_HOME=C:/ARCHIV~1/MYSQL/MYSQLS~1.5</code></li>
<li>Copy libmysql.lib from mysql/lib to mysql/lib/opt to meet dependencies.</li>
<li>Copy libmysql.dll to <code>C:\Program Files\R\R-2.12.1\bin</code> or to <code>windows/system32</code> directory.</li>
<li>Run <code>install.packages('RMySQL',type='source')</code> and wait while compilation will end.</li>
</ul>
Important note 2: My computer contains Spanish language Windows, and I had several problems with the accent in the folder named "Configuración local", where the downloaded packages are stored and compiled.<br />
I solved the problem in the following way. I changed the environment variable TMP to another local folder without containing any accent.<br />
After the installation I rolled back the change in the environment variable.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3832748866882845339.post-66868107636170590182012-02-05T00:27:00.000-08:002012-02-07T00:28:35.055-08:00MySQL - Get row number on select<a href="http://stackoverflow.com/questions/2520357/mysql-get-row-number-on-select">http://stackoverflow.com/questions/2520357/mysql-get-row-number-on-select</a><br /><br /><pre class="lang-sql prettyprint"><code><span class="kwd">SET</span><span class="pln"> </span><span class="pun">@</span><span class="pln">rank</span><span class="pun">=</span><span class="lit">0</span><span class="pun">;</span><span class="pln"><br /></span><span class="kwd">SELECT</span><span class="pln"> </span><span class="pun">@</span><span class="pln">rank</span><span class="pun">:=@</span><span class="pln">rank</span><span class="lit">+1</span><span class="pln"> </span><span class="kwd">AS</span><span class="pln"> rank</span><span class="pun">,</span><span class="pln"> itemID</span><span class="pun">,</span><span class="pln"> COUNT</span><span class="pun">(*)</span><span class="pln"> </span><span class="kwd">as</span><span class="pln"> ordercount<br /> </span><span class="kwd">FROM</span><span class="pln"> orders<br /> </span><span class="kwd">GROUP</span><span class="pln"> </span><span class="kwd">BY</span><span class="pln"> itemID<br /> </span><span class="kwd">ORDER</span><span class="pln"> </span><span class="kwd">BY</span><span class="pln"> ordercount </span><span class="kwd">DESC</span><span class="pun">;</span><span class="pln"><br /></span></code></pre>Unknownnoreply@blogger.com0