Archivos ini en PHP
Programacion
Al no tener gran conocimiento de PHP, pensé que el "parsing" del archivo de inicialización lo tendría que hacer "a patín", con un poco de código. Pero me encontré con una función llamada "parse_ini_file()", la cual facilita mucho esta tarea.
(Aquí el post, con código resaltado)
Imaginemos que tenemos este archivo de configuración (prueba.ini):
[conexion]
; Estos datos son para la conexion y este es un comentario.
servidor = localhost
usuario = juanito
[sistema]
estilo = simple
Para obtener la información de cada variable únicamente se hace lo siguiente:
$info = parse_ini_file("prueba.ini");
// La información quedará guardada en un arreglo donde el índice será el nombre de la variable, por lo tanto podemos obtenerlo de la siguiente forma:
// Si queremos imprimir la informacion del servidor sería:
echo $info['servidor'];
// Si queremos imprimir el estilo del sistema
echo $info['estilo'];
?>
Si agregamos un parámetro más a la función, separa por áreas del archivo de inicialización.
$info = parse_ini_file("prueba.ini", true);
// La información quedará guardada en un arreglo multidimensional donde el primer índice será el nombre del "área del archivo ini" y el segundo el nombre de la variable, por lo tanto podemos obtenerlo de la siguiente forma:
echo $info['conexion']['servidor'];
// Si queremos imprimir el estilo del sistema
echo $info['sistema']['estilo'];
?>
Permalink: http://www.mononeurona.org/users/entry/thot/603
New York
Mi pensar
Despues de estar un dia en New York han habido ciertas cosas que resaltar:
- La variedad cultural aqui es impresionante, se puede ver gente de diferentes culturas unidas en esta ciudad.
- Hay edificios bastante altos (pero no es algo que me impresione mucho).
- El "skyline" de Manhattan en la noche (en un crucero) se ve realmente impresionante.
- Y finalmente las instalaciones de google, y la forma en que trabajan... eso si que es realmente impresionante.
Por el momento creo que es todo, de no ser por mi pinche pie lastimado :( estaria disfrutando mucho mas el viaje.
Permalink: http://www.mononeurona.org/users/entry/thot/590
Detallitos en Mononeurona
General
Lo primero, es que manda un chingo de spam, por la falta de captcha en los comentarios a los blogs. Y pues creo que ya se les volvió costumbre estar poniendo en mi blog :S, y seguramente en el de muchos otros de la comunidad.
Otra cosa que se me hizo bien extraña es un "post fantasma" que lo marca en el lector de RSS:

Supongo que han de querer estar castrando por ahí. O quién sabe. Aarkerio seguramente sabe que está pasando.
Permalink: http://www.mononeurona.org/users/entry/thot/584
Menús desplegables en JAWS
Programacion
Algo que me di cuenta con JAWS, fue la falta de un tema que permitiera menús desplegables. Se puede hacer un poco a lo tosco, metiendo en la plantilla del diseño de la página un código HTML estático que despliegue el menú. Pero eso no tiene gracia. Tomando en cuenta que JAWS tiene un gadget que permite la creación de menús de una forma fácil.
Pero la buena estructuración de los componentes de JAWS hacen de esto una tarea relativamente sencilla. Todo esto únicamente con CSS, :) por supuesto.
Para poder lograrlo únicamente tenemos que hacer lo siguiente:
Primero necesitamos una parte de la hoja de estilo que permita los menús desplegables, podemos usar el siguiente código:
{
background-color: #a30000;
color: #000000;
}
#menus
{
width: 100%;
height: 20px;
}
.menu {
font-family: arial, sans-serif; width:990px; position:relative; margin:0; font-size:11px; margin:0px 0 0px 0; z-index:100;
}
.menu ul li a, .menu ul li a:visited {
display:block;
text-decoration:none;
color:#000;
width:150px;
height:20px;
text-align:center;
color:#ffcc00;
background:#a30000;
line-height:20px;
font-size:11px;
overflow:hidden;
}
.menu ul {padding:0; margin:0;list-style-type: none; }
.menu ul li {float:left; margin-right:1px; position:relative;}
.menu ul li ul {display: none;}
.menu ul li:hover a
{color:#ffffff;
background:#183884;
}
.menu ul li:hover ul{display:block; position:absolute; top:20px; left:0; width:151px;}
.menu ul li:hover ul li a.hide
{
background:#a30000;
color:#ffffff;
}
.menu ul li:hover ul li:hover a.hide
{background:#183884;
color:#ffffff;
}
.menu ul li:hover ul li ul {display: none;}
.menu ul li:hover ul li a
{display:block; background:#a30000;
color:#ffcc00;}
.menu ul li:hover ul li a:hover
{background:#183884;
color:#ffffff;}
.menu ul li:hover ul li:hover ul {display:block; position:absolute; left:151px; top:0;}
.menu ul li:hover ul li:hover ul.left {left:-151px;}
Nota: Este estilo funciona para navegadores que no son IE. Se supone existe un "IE Hacking" para este menú desplegable, pero se lo quité desde hace tiempo y no recuerdo que le debería agregar :S. Osea que si alguien necesita adaptarlo a IE, nada más tiene que investigar el IE Hacking.
Con el estilo anterior y este código HTML podemos crear un pequeño menú desplegable.
<div class="menu">
<ul>
<li><a class="hide" href="#">Menu 1</a>
<ul>
<li><a href="#">Item 1-1</a></li>
<li><a href="#">Item 1-2</a></li>
<li><a href="#">Item 1-3</a></li>
</ul>
</li>
<li><a class="hide" href="#">Menu 2</a>
<ul>
<li><a href="#">Item 2-1</a></li>
<li><a href="#">Item 2-2</a></li>
<li><a href="#">Item 2-3</a></li>
</ul>
</li>
</ul>
</div>
</div>
Cómo se puede ver la estructuración es bastante sencilla, un div llamado menus, un div de clase menu los cuales agrupan a todo. Y simples listas anidadas para la creación de los menús y submenús en general.
Ahora tenemos que modificar el template de salida del gadget "Menu" para que permita una salida HTML como el ejemplo anterior. Y el template quedaría de esta forma:
<div id="menus">
<div class="menu">
<ul>
<!-- BEGIN section -->
<!-- BEGIN single -->
<li><a href="{url}">{title}</a></li>
<!-- END single -->
<!-- BEGIN withitems -->
<li><a class="hide" href="{url}" title="{title}">{title}</a>
<ul>
<!-- BEGIN item -->
<li><a href="{url}" title="{title}">{title}</a></li>
<!-- END item -->
</ul>
</li>
<!-- END withitems -->
<!-- END section -->
</ul>
</div>
</div>
<!-- END menu -->
Y con esto ya tenemos listo un menú desplegable en JAWS, y podremos usar el gadget Menu para organizarlo :).
Happy Coding!!!
Permalink: http://www.mononeurona.org/users/entry/thot/580
No portes software a Windows
Software Libre
Por lo menos, no "portes" mi software a Windows.
Mientras la GNU GPL expresamente me prohibe negarte la libertad de portar software protegido por esta licencia a Windows, siento que haces un gran daño a el mundo si lo haces. Déjame explicarte.
Windows es un entorno propietario. Ellos no te dan el código fuente, y hacen todo lo que está en sus manos para limitar tu libertad. Incluso tratan de limitar lo que puedes hacer con el software que le compraste legalmente a ellos. Así que ayudándolos en cualquier forma es malo para el mundo, porque esto alienta a otras personas para tratar de limitar la libertad de otros (Esto funcionó muy bien para Microsoft, así que debe ser una buena idea, correcto?).
No deseo que nada de mi trabajo sirva de pretexto para que otros ayuden a compañías como Microsoft que tratan de limitar las libertades de las personas.
Esta es la razón por la que desarrollo mi software en una plataforma completamente libre. Así puedo saber que funciona en una plataforma completamente libre.
Muchas personas que usan Windows no se preocupan por su libertad. Ellos se preocupan por la calidad del software y por esta razón tratan de reemplazar todo el software propietario de Microsoft con mejores alternativas libres. Esta es la única razón de la existencia de cygwin.
Sin embargo, dando a las personas una forma de trabajar alrededor de los bugs en Windows haces que ellos estén más tiempo con Windows. Esta es la razón por la que considero "portar" software a Windows como un sabotaje. Esto no ayuda a personas que usan Windows, al contrario, hace que ello estén más tiempo con Windows. A mientras ellos se mantengan así, ello pondrán presión en otros que también usan Windows. Esto solo ayuda a Microsoft.
Mientras este texto se enfoca en Microsoft, otras compañías son igualmente malvadas. Por ejemplo, portando la "diet libc" a Solaris, podría ayudar a Sun, y a nadie más. Así que no lo hagas.
Por lo mismo, no modificaré nada de mi software para que trabaje mejor con plataformas de desarrollo propietario como Visual C++, aún cuando tenga que sacrificar gran cantidad de rendimiento por no explotar sus características. Y te pido que hagas lo mismo.
Notas Esta es una traducción de esta página de Felix Von Leitner. La cual se me hace una muy buena explicación sobre por qué no migrar software a Windows.
La palabra "portar" se refiere a cambiar un software de plataforma.
Permalink: http://www.mononeurona.org/users/entry/thot/578
art4linux
Software Libre
"An online linux community for art and theme lovers; those who create art for linux and those who adore it. A large collection of themes for KDE, Gnome, desktop wallpapers, icons, cliparts, forums and other arts for Linux, BSD, etc."

Now, there isn't a pretext for a pretty desktop in your favorite linux distribution.
Permalink: http://www.mononeurona.org/users/entry/thot/570
WUbuntu
Programacion
Here is a web application that show a simulation of this distribution.
This application don't have functionality, but it can be useful to educational purposes.
For example: "windows' users" can see a preview of Ubuntu in their web browsers.

What do you think?
Permalink: http://www.mononeurona.org/users/entry/thot/569
Control the computer with your brain.
Programacion
This progress is opening a very interesting research's line, this will allow have a interaction with the computer with the brainwaves. Imagine the amazing possibility that actions like chat o send a email we can do without move a finger. Furthermore, the advantage that the people with every discapacity can operate a computer.
Here is a video demonstration of this technology.
En this article say this:
"Nagle, a 26-year-old quadriplegic, was hooked up to a computer via an implant smaller than an aspirin that sits on top of his brain and reads electrical patterns. Using that technology, he learned how to move a cursor around a screen, play simple games, control a robotic arm, and even - couch potatoes, prepare to gasp in awe - turn his brain into a TV remote control. All while chatting amiably with the researchers"
This kind of technology is advancing so fast.
- Last year, Sony patent a game system that send "sensations" to your brain without implants.
- Niels Birmauer, a neuroscientist from Germany, make a device that read brainwaves through your skin. without implants.
A very interesting possibility that show us Stu Wolf (a top scientist of DARPA): The next step will be "enable network-telepathy". In other words, your thinking will flow over the network, to travel, why not, to other brain. If you think that the instant messaging is addictive, just wait for the "instant thinking".
I want to add a personal comment, many times I have readed about of the posibility that the humanity will have the ability of the telepathy (For example: "The Foundation" Isaac Asimov), The most times, the way to do that is spiritual/mental but not by science or technology. I'm a science's lover, and I'm happy that the science is one way to find this ability.
(Reference)
Permalink: http://www.mononeurona.org/users/entry/thot/568
Global Politics in exactly 17 sec. :P
Polaca
I know that my english teacher, is from USA. But I want that she is not blind to the politics of plundering that use her country. Some examples of this kind of politics only in America, where USA takes part direct or indirectly (to show all the examples, I think is impossible):
- The wall in the north of México.
- The death of Sandino.
- The economic sanctions to Cuba.
- The creation of a rebellion in Guatemala (in the 70's) to put a president proyankee.
- The robbery of half of the Mexican territory. (When Santanna was the president of Mexico).
- The death of the "Che Guevara".
In all the world there are many examples of the "USA style". Vietnam, Irak, Afganistan, etc. But I think that is unnecessary to comment it.
Permalink: http://www.mononeurona.org/users/entry/thot/562
Mis próximos posts en Inglés :(
Actualizacion a mi Pagina
Además, necesito juntar "60 horas" de práctica de inglés para que me dejen presentar examen.
Por lo tanto mis siguientes posts serán en inglés. Si tengo tiempo también pondré su traducción al español.
Por favor, cualquier error que encuentren (de gramática, de sintaxis, puntuación o en la forma de expresar la idea), pongan un comentario para hacer la correción pertinente. Se los agradecería infinitamente.
English:
Personally, I don't like the English language, unfortunately for my career (Computer Engineering) this language is indispensable. Furthermore, I need practice English language sixty hours. This is necessary for the right to sit a exam.
For that reason the next "posts" will be in English language. If I have time, i will write the spanish translation. Please, if you find a mistake (grammar, syntax, punctuation or a bad expression of the idea), write a comment, and I'll make the correction.
I will thank for it infinitely.
Permalink: http://www.mononeurona.org/users/entry/thot/560










