Buscar en Mind w/o Soul

Mostrando entradas con la etiqueta programación. Mostrar todas las entradas
Mostrando entradas con la etiqueta programación. Mostrar todas las entradas

miércoles, mayo 12, 2010

Features or not features

Diseño sencillo vs diseño con muchas funcionalidades.

"Features are good. They set Firefox apart from others, and attract users. What bothers users is features that don’t have a mature user interface. The solution should be to fix the interface, not drop the feature."


http://robert.accettura.com/blog/2005/09/04/features-vs-usability/
http://i.bnet.com/pdf/174974-Defeating_Feature_Fatigue_.pdf
http://berkeleymath.com/Documents/Defeating%20Feature%20Fatigue.pdf

jueves, marzo 25, 2010

Hierarchical State Machines for GUIs

Event-driven programming is widely used in [[graphical user interfaces] because it has been adopted by most commercial widget toolkits as the model for interaction. The design of those toolkits has been criticized for promoting an over-simplified model of event-action, leading programmers to create error prone, difficult to extend and excessively complex application code:

Such an approach is fertile ground for bugs for at least three reasons:

1. It always leads to convoluted conditional logic.

2. Each branching point requires evaluation of a complex expression.

3. Switching between different modes requires modifying many variables, which all can easily lead to inconsistencies.

Instead of a low level action-reaction, Miro Samek proposes a better approach using finite State Machines to control the interaction logic necessary to define the state changes to incoming events. Hierarchical State Machines have also been proposed as a high-level model for reactive programs. The UML language in particular provides a complete specification to represent state machines.

Some alternate implementations:

http://accu.org/index.php/journals/252

http://www.eventhelix.com/RealtimeMantra/HierarchicalStateMachine.htm


miércoles, marzo 17, 2010

Programación visual (con Tersus y Qt)

La programación visual permite controlar el ordenador de forma automática usando un lenguaje gráfico.

Los cambios que queremos hacer en nuestros archivos se indican como una secuencia de pasos de transformación de datos. Cada paso es una caja, y el orden de los pasos se representa con flechas.

Tersus Model Screenshot.PNG


Qt es una herramienta de programación, que dispone de un lenguaje declarativo llamado QML para crear interfaces de aplicación sin tener que detallar todos los pasos que tiene que seguir el ordenador.
http://labs.trolltech.com/page/Projects/Graphics/Kinetic/DeclarativeUI

lunes, septiembre 28, 2009

State of the art MIP solvers

"Leading-edge" Optimizadores para restricciones y programación entera - linear integer programming:
Modelador en Java OptimJ (http://www.ateji.com/)

Microsoft Solver Foundation

martes, septiembre 15, 2009

Librería Python para Reactive Programming

Trellis es un módulo Python para gestionar "programación reactiva" con facilidad:


The Trellis solves all of these problems by introducing automatic callback management, in much the same way that Python does automatic memory management.

(Instead of worrying about subscribing or "listening" to events and managing the order of callbacks, you just write rules to compute values. The Trellis "sees" what values your rules access, and thus knows what rules may need to be rerun when something changes -- not unlike the operation of a spreadsheet.)

martes, junio 30, 2009

Hash: Password checkword

Métodos y código/programas javascript para generar códigos hash a partir de claves.

Puede servir para programar una extensión Firefox para la usabilidad de formularios de login (mostrando la checkword para comprobar si ha habido errores al teclear)

http://wijjo.com/PasswordHasher
http://hashapass.com/
http://wijjo.com/passhash/passhash.html

sábado, junio 06, 2009

Metáfora para programación

Tradicionalmente se ha equiparado los programas de ordenador con las recetas de cocina.

Otra metáfora quizá más expresiva para referirse a la programación en general y a la programación de interacción en particular, es el mundo de la moda y la alta costura. Los programadores tienen mucho de artistas que utilizan una base muy técnica para hacer creaciones, que deben ser prácticas a la vez de atractivas.

lunes, mayo 18, 2009

Some intuitions on Monads

Remember your first lesson in structured programming, when the teacher insisted there where 3 operations for program structure: the conditional (if), loop (while), and sequence (;) operators. Conditionals choose between two alternate control sequences; loops repeat a sequence; and 'sequence' itself defines the order in which simple operations are chained together.

Did you mutter to yourself then, "how can 'sequence' be an operator and not just, well, how the program is laid out in the file?" Well, fact is you really can think of sequence as an explicit operator. And monads are a way to overload that operator, in the OOP sense of operator overloading.

If you have defined a monad in a functional program, you can use it to build a sequence of operations, just like you would in an imperative program. But you can actually change the meaning of the composition in the sequence: every step of your program, the logic in the monad is activated and it decides how (and if) it should perform the next step.

See this example from Monads in Ruby (with nice syntax!):
def with_failable_rbinding(first_divisor)
with_monad Failable do
val1 =xx fdiv(2.0, first_divisor)
val2 =xx fdiv(3.0, 1.0)
val3 =xx fdiv(val1, val2)
val3
end
end
Here you have a do-block containing a sequence of divisions composed using the special monadic assignment =xx. Everything executed within the block is handled by the Failable monad, wich is programmed to return a special non-numeric Failure value when a division by 0 is performed:

puts fdiv_with_binding(1.0)
=> Success(0.666666666666667)
puts fdiv_with_binding(0.0)

=> Failure(cannot divide by zero)


For every side effect in traditional imperative programming (control of errors, concurrency, input/output, commit/rollback of the whole application state, non-determinism... and some more) you can get some specific logic added for it, anytime, for free, without any syntactic complexity other than the sequence operation. Better yet, you can change the allowed side effects without actually changing a single line of your imperative procedure, just by redefining the logic encapsulated in the monad that glues the statemens in the procedure together.

See some more of my intuitions on monads here.

miércoles, febrero 04, 2009

Proyecto Euler - programación y matemáticas

About Project Euler


Leonhard Euler (1707-1783)

What is Project Euler?


Project Euler is a series of challenging mathematical/computer
programming problems that will require more than just mathematical
insights to solve. Although mathematics will help you arrive at elegant
and efficient methods, the use of a computer and programming skills
will be required to solve most problems.


The motivation for starting Project Euler, and its continuation, is to
provide a platform for the inquiring mind to delve into unfamiliar
areas and learn new concepts

martes, diciembre 30, 2008

Functional vs Imperative Programming

In imperative programming, procedures are structured around data transformations. In functional programming, functions are structured around data dependencies.

The tricks you learn to program the imperative way are different to those you use for funtional programming, that's why it's difficult for IP programmers to do the switch to FP. Not because FP is inherently more difficult, but because you lose your expertise and start again as a beginner.

miércoles, diciembre 10, 2008

BBDD ultraeficiente para C++


DataDraw - datadraw.sourceforge.net
DataDraw is an ultra-fast persistent database for high performance programs written in C. It's so fast that many programs keep all their data in a DataDraw database, even while being manipulated in inner loops of compute intensive applications. Unlike slow SQL databases, DataDraw databases are compiled, and directly link into your C programs. DataDraw databases are resident in memory, making data manipulation even faster than if they were stored in native C data structures (really). Further, they can automatically support infinite undo/redo, greatly simplifying many applications.

martes, septiembre 23, 2008

Principios del javascript

Consejos de expertos profesionales
10 Essential Principles of the Javascript Masters - NETTUTS
JavaScript is one of the most widely used languages in web development. It's simple, yet very powerful, and the number of ways that it can be used are almost limitless. That's why it's so important to gather advice from those who have gone before you. Here are 10 tips from well-respected web developers within the JavaScript community.

jueves, agosto 14, 2008

3D library to ease refactoring OpenGL drivers

With the controversy over the recent release of OpenGL 3.0, people is debating wether OpenGL is dead or it isn't. In this situation, a new low-level library called Gallium3D promises to ease development of drivers for OpenGL (or any other 3D API) by acting as an efficient middleware between the API and the metal. Gallium3D seems to be gaining traction within the community with talks at several FOSS conferences (e.g. FOSDEM and aKademy).

martes, agosto 12, 2008

Wiki + hoja de cálculo

Proyecto para el wiki MoinMoin. Base para un lenguaje de programación basado en flujo de datos.

Wiki + Spreadsheet at Labix Blog
The underlying concept is very simple: spreadsheets are a way to organize text, numbers and formulas into what might be seen as a natively numeric environment: a matrix. So what would happen if we loosed some of the bolts of the numeric-oriented organization, and tried to reuse the same concepts into a more formatting-oriented environment which is naturally collaborative: a wiki.

Framework para browser RIAs

Aplicaciones AJAX, licencia Apache - framework library

IT Mill - Rich Internet Applications
IT Mill Toolkit comes with a large collection of RIA components, suited for all types of applications. Each component is thoroughly tested in real-world applications to ensure high quality.Some of the components included in IT Mill Toolkit

miércoles, agosto 06, 2008

Universal UNDO in Python scripts

Cómo programar comando Undo en Python

Implementing a Selective Undo Framework in Python
I've implemented in Python the undo algorithm found in ``Undoing Actions in Collaborative Work: Framework and Experience'' by Prakash and Knister [cite PK94]. Their approach helps structure the objects that make up a ``document''. Those same objects are well suited for use in an embedded language like Python: with them you can write scripts that can be undone! I've implemented standard file operations as a simple concrete example of using the framework.