miércoles, 5 de febrero de 2014

Installing LaTeX on Mac OS X

Previously, I wrote a tutorial on how to install LaTeX on Windows. This time, I’ll do the same thing for Mac OS X. I’m using OS X 10.7 (Lion), but I’m sure this guide still holds for Mountain Lion, Leopard or earlier versions of OS X. The scope of this tutorial is to show you how to install the complete LaTeX package, including my favorite free editor (Texmaker). The installation will be a lot shorter than that for Windows users :)

Installing MacTeX


The governing LaTeX distribution for Mac OS X is MacTeX. This distribution is actually an all-in-one package as it not only contains the LaTeX distribution, but also several editors and other useful stuff. So let’s cut to the case: head over to the MacTeX website (or here). If you follow the link you can immediately download it. Note that this download is about 2 GB and thus may take a while to be downloaded (depending on your internet connection).

Once you’ve downloaded the distribution, install it by double-clicking the .dmg file. The rest will speak for itself, as the installation procedure is just the same as any other Mac software.

Now, open your Applications folder and search for a folder called TeX. This contains everything you need, as can be seen here. TeXShop and TeXworks are both open source LaTeX editors, released under the GPL. If you want to use one of these, you can start right away. Personally I prefer another editor: Texmaker. It will be shown in the next section how to install this one (which is no rocket science ;)). Furthermore in the TeX folder we see BibDesk, a handy tool for maintaining references for BibTeX. We also see LaTeXit, a great tool that can be used to add LaTeX equations to Powerpoint for instance.

Installing Texmaker


As I said before, you already get two LaTeX editors with the MacTeX installation. However, I’m used to Texmaker so I’ll show you how to install this editor as del (this one is really easy). Head over to the Texmaker website. Next, go to the download section in the menu on the right and download Texmaker. You probably need the 64 bit version, depending on your Mac hardware. Once you downloaded the file, drag and drop it to the Applications folder and your ready to LaTeX!
Anything else?

That’s it? Yes! However, for the control freaks among us there is an extra distribution for MacTeX called MaxTeXtras. You can find it here. This download contains several editors (like Texmaker), utilities, tools and demos you might find handy. Have fun!

source

Installing LaTeX on Windows

In this guide, I will show you how to install the needed components of LaTeX on Windows. In this tutorial Windows 7 is used, but the steps will be similar for other versions.

Installing MiKTeX


MiKTeX is a free TeX distribution for Windows systems. The current version is MiKTeX 2.9. The survey starts at the MiKTeX website. In the menu, click on MiKTeX 2.9 and scroll down to download the MiKTeX 2.9 Net Installer. This is the installation file that will be used to download the MiKTeX distribution. Run the file once it is downloaded. The installation wizard of MiKTeX will now pop up.

First, agree with the copying conditions and click next. In the following window, click ‘Download MiKTeX’ to download the distribution to a directory on your computer. Again, click next. Next you will be prompted whether you want install Basic or Complete MiKTeX. I recommend you to download the complete distribution, since it will save a lot of time in the future. Note that the complete package is quite large (1.2 GB) and it takes a while to install. So you’ll need a steady internet connection and enough space on your hard-disk. The next thing you have to choose is the source where the package will be downloaded from. Search for a source that is located in your country, or nearby. After you click next you’ll have to choose a directory where MiKTeX will be installed. This was the last step, the downloading will now begin. Note that this installation will take a while.

Once its finished, navigate to the directory where you’ve installed MiKTeX. There are a lot, really a lot, of files here. However, there is only one .exe file. Run this file (called setup-2.9.3959.exe for this version). This time, the real installation of MiKTeX will take place. This process will again be quite lengthy.

Installing the editor


In order to actually compile LaTeX documents, we need an editor. For windows, the most used editors are probably TeXnicCenter and Texmaker. I might add an overview of all editors in the future, but that is not where this tutorial is about. Personally, I like Texmaker the most, so let’s install that editor right away!

On the Texmaker website, go to the download section to download Texmaker for Windows. The current version is 2.2.1. We’re going to download the Executable file (.exe). When the downloading is complete, don’t run the installation wizard! Wait for the MiKTeX installation to be completed. This way, Texmaker will automatically configure the settings for you. Once you’re ready to install Texmaker, agree to the GPL license by clicking ‘I Agree’ and choose a directory to install the editor. Done! Wow, that was fast :-)

The installation of LaTeX is now complete. A guide to create your first document might be added in the future. For now, here are some references.

source:

viernes, 13 de diciembre de 2013

Installing pygame on OS X with a Homebrew Python 2.7 install

Solved this surprisingly quickly today thanks in part to this post by Basti am. His post was mostly correct but some parts have changed, so I’m going to document how I got it working. Note that this method will miss out PNG, SCRAP, and PORTMIDI support. Good luck getting those working!
  1. Install Python via Homebrew:
    brew install python
  2. Install pip (because one package manager isn’t enough, right Python?):
    easy_install pip
  3. Install numpy with pip:
    pip install numpy
  4. Install the pre-requesites for pygame with Homebrew:
    brew install sdl sdl_ttf sdl_image sdl_mixer
  5. Download the pygame source. (in my case was: pygame_version) It’s one of the top links. Extract it somewhere and go to that directory in a terminal.
  6. Run python config.py.
  7. Fix the Setup file to point to your Homebrew SDL libraries, not OS X ones (which are missing stuff). Change the lines starting SDL, FONT, IMAGE, and MIXER to read:
    SDL = -I/usr/local/include/SDL -L/usr/local/lib -lSDL
    FONT = -lSDL_ttf
    IMAGE = -lSDL_image
    MIXER = -lSDL_mixer

    Below those definitions are lines commented out that enable/disable features. Remove the # to uncomment the ones you want.
  8. Run python setup.py install.
  9. Success!














source: http://jalada.co.uk/2011/06/17/installing-pygame-on-os-x-with-a-homebrew-python-2-7-install.html



lunes, 28 de octubre de 2013

Downloading an Entire Web Site with wget



If you ever need to download an entire Web site, perhaps for off-line viewing, wget can do the job—for example:

$ wget \
     --recursive \
     --no-clobber \
     --page-requisites \
     --html-extension \
     --convert-links \
     --restrict-file-names=windows \
     --domains website.org \
     --no-parent \
         www.website.org/tutorials/html/





This command downloads the Web site www.website.org/tutorials/html/.

The options are:

--recursive: download the entire Web site.

--domains website.org: don't follow links outside website.org.

--no-parent: don't follow links outside the directory tutorials/html/.

--page-requisites: get all the elements that compose the page (images, CSS and so on).

--html-extension: save files with the .html extension.

--convert-links: convert links so that they work locally, off-line.

--restrict-file-names=windows: modify filenames so that they will work in Windows as well.

--no-clobber: don't overwrite any existing files (used in case the download is interrupted and
resumed).


source: http://www.linuxjournal.com/content/downloading-entire-web-site-wget

lunes, 21 de octubre de 2013

Instalar Python, NumPy, SciPy y matplotlib en Mac OS X con dobleclicks


En este post esta como instalar Python, NUmPy, SciPy y matplot en Lion, pero incluye muchas lineas de comando y modificar tu .bash_profile y tratando con problemas de compiladores y demas. Eso es lo que se llama generalmente compilarlo por ti mismo (CIY method). La forma mas sencilla, es un metodo que generalmente se llama el metodo del doble click, o sea, que todo se hace con clicks.

El metodo CIY se usa mas para usuarios avanzados, que quieran tener una instalacion muy personalizada.

Hasta hace poco el metodo CIY era la unica forma de tener todo funcionando en Lion, pero los programadores de NumPy, SciPy, and matplotlib han hecho un DMG para hacer el proceso mucho mas sencillo. Una vez que conoces Python, se van a ver en la necesidad de instalar otros paquetes, yo les sugiero pip.

Instalar Python

Vas a la pagina de Python y descargas el paquete llamado Python 2.7.2 Mac OS X 64-bit/32-bit x86-64/i386 Installer. Double-click al archivo dmg descargado para instalarlo.

Instalar NumPy

Vas a la pagina NumPy y descargas el paquete denominado numpy-1.6.1-py2.7-python.org-macosx10.6.dmg. Double-click al archivo dmg descargado para instalarlo. 

Instalar SciPy

Vas a la pagina SciPy y descargas el paquete denominado scipy-0.10.1-py2.7-python.org-macosx10.6.dmg. Double-click al archivo dmg descargado para instalarlo. 

Install matplotlib

Vas a la pagina matplotlib y descargas el paquete denominado matplotlib-1.2.0-py2.7-python.org-macosx10.6.dmg.Double-click al archivo dmg descargado para instalarlo. Felicidades! Ya debe estar funcionado. Cuando queiras actualizarlos, visita a la pagina y descargate la ultima version de esos archivos. Probemos en una terminal con Python a ver si funciona.

import numpy
import scipy
import matplotlib
Las instrucciones pueden tener ya un tiempo, si no le funciona chequee en  “Install Python” los nuevos terminos.

fuente: http://penandpants.com/2012/03/01/install-python-2/

lunes, 14 de octubre de 2013

Razonamiento del sentido Comun (Reasoning Common Sense)


Unas observaciones, de la excelente presentacion de CYC en Google Tech 2006 denominada 
"Computers versus Common Sense".

enlace http://www.youtube.com/watch?v=gAtn-4fhuWA 


La conferencia fue hecha en el 2006, por lo cual hay puntos señalados que no tienen validez en la actualidad, como que Google no te da respuestas concretas a algunas de tus pregunta. Ya que actualmente, pones en Google “President of Cuba” y Google te muestra una tarjeta con el nombre del presidente de Cuba.
Otro punto es que, según el ejemplo que dio del perro y la madre, que dice:

El perro de mi mama murió.

Y el programa le preguntó: háblame mas sobre su madre; porque era lo único que sabía.
Pues la razón que pase eso, a mi manera de ver, es que, el programa que recibe la pregunta, si desconoce un concepto, debería preguntárselo al usuario y así, el programa tener el concepto del usuario. Y poder inferir conocimiento.
Por ejemplo:
Si el software no sabe que es dog, el preguntaría:
Perdóname, no se lo que es dog.¿Me podrías definirlo?

De esa manera podría crear definiciones de cosas con los usuarios, uno a uno y de esa manera para un usuario tendrías una definición, sin embargo podrías usar esa misma definición para la definición general, cogiendo lo común que cada uno dice o al menos la unión. O podría ser como un nCaptcha. De esa manera estamos enseñando a las maquinas hacer y saber las cosas.
Dicho lo anterior, el principal problema parece venir de que no se sabe trabajar con lo desconocido, y eso es lo que la maquina debe saber preguntar. Como saber sobre lo desconocido.
Si usas un sistema estático, creo que resultaría sencillo, porque al final, si tienes el conocimiento representado con un numero finito de propiedades, pp1, pp2, ... ,ppN, entonces las preguntas serian de acuerdo a esas propiedades. Digo sistema estático a un sistema donde la cantidad de propiedades que se trabajan son fijas y son las mismas.
Por ejemplo:

Dime la descripción, dime el nombre, etc.


Todas estas preguntas es sobre lo desconocido. Como es estático, se podría hacer un estudio mas detallado de cuales propiedades depende una de otras, cuales preguntar primero, etc.

Ahora si se trabaja con un sistema dinámico, o sea, que la cantidad de propiedades no es fija, sino que ira variando. Entonces se debería preguntar por las mas frecuentes, por las propiedades que aparezcan en todos los objetos, o por lo menos en los que mas, y así de alguna manera puedes terminar clasificándolo en una categoría. Por ejemplo:
Una clase podría ser los objetos que tienen descripción, en este sentido todo lo que existe en el mundo tiene una descripción, una definición y un nombre, a eso se le denomina objeto, ahora si además de eso tiene una propiedad tamaño, entonces se puede decir que es medible, y de la propiedad tamaño debería existir un conjunto de reglas que podamos inferir solo desde esa propiedad. La idea aquí, es que dada una propiedad se infiera todo el conocimiento de ella independiente del objeto (como si fueran estructuras algebraicas). De esa manera, si el usuario especifica que ese concepto tiene esa propiedad, ya puedes inferir conocimiento.

¿Que mas pasa la propiedad tamaño? Es que tamaño puede ser que se modifique, puede ser fija, puede cambiar en la instancia o puede tener varios tamaños. Luego se irán haciendo clustering, de acuerdo a sus propiedades sin valores (a su clase). Pero la clase también se puede definir por instancias, por ejemplo:

Tengo clase persona. Y la instancia de la edad es menor que 15 años se considera un niño y no un adolescente. Entonces ahí se tiene una clase niño que depende de los valores de la instancia. Pero creo que esta forma de clasificar (por valores de instancias) seria el ultimo a tomar en cuenta.
Se empieza hablar sobre las construcciones de las base de datos y los errores que tienen la gente a introducir datos, es verdad, que a la hora de concebir el modelo debería concebirse la semántica, como se expone en el video, si esta la fecha de contratación y esta la fecha de nacimiento, es real que debería haber entre ellos una diferencia de al menos 18 años (edad a la cual se permite trabajar) , para así evitar errores. La idea principal es que deberían haber relaciones verificables entre los datos como la expuesta anteriormente. Pero si algo no cumple con el patrón (la edad es menor que 18 años) también debería poder agregarse, pero con el objetivo de que sea como excepción warning de la regla, ya que, podría darse que alguien muy talentoso que tuviera solo 15 años y pudiera trabajar en la empresa, sin embargo podría ser también un error, entonces el usuario que entra los datos, se le avisa que algo parece no estar bien, en este caso la fecha de nacimiento con la fecha en que empezó a trabajar, si el operador decide insertar los datos igualmente, este dato pasaría a tener un warning diciendo que es una excepción de la regla.

Se habla también del completamiento de contenido por el conocimiento, como el ejemplo del niño y la mama. Creo q seria incorrecto ese completamiento. Ya que podría tener otra interpretación diferente a la “que se cree que será el sentido comun”. Porque lo que significa evidente para ti, no tiene porque ser claro para mi. Los ejemplos que pone son muy sencillos, y al parecer, la única respuesta es esa, pero puede ser que no. Que después de tanto conocimiento la respuesta sea mucho mas completa y compleja. Y no resultaría evidente.(18:10)

Se habla también del completamiento de información de las base de datos, lo mismo que hicieron con lo de rellenar o ver si tenia datos inválidos.

Algunas de las estrategias es que Cycs tiene muchas micro definiciones.
Se habla también que la cantidad de conceptos no es muy importante, principalmente porque hay algunas definiciones (pocas), que abarcan mucho conocimiento, que funcionan como axiomas (34:36).
Hay una regla que creo que se asume muy bien, que dice: “Si dos objetos no se sabe su relación taxonómica entonces se consideran disjuntos”. Porque al final una clase puede ser tan especifica como se quiera, se habla de clases y de instancias de clases pero al final son lo mismo, lo que las clases son instancias sin valores. (video en 35:30)
Si existen dos clases que no se conocen (dos taxones, dos ramas de la taxonomía), entonces se asume que son disjuntas. Y en realidad lo son, porque en su nivel de especificidad se hacen diferentes. Pero que pasa si una es una instancia de la otra.? No pasa nada porque también se puede ver como subconjunto pero también como diferentes grupos como lo son clases y lo son las instancias.
Open CYC es una ontología abierta. Y podemos usarla tanto para investigación como para comercialización.

Estas son unas notas, perdonen si no todas las ideas estan muy esclarecidas y si el cambio de las mismas sea muy brusco.