April 24, 2017

MobCur v1.0

MobCur is a shorthand for "Mobile Currency", which is a simple proxy app that connects to the Bitso API that retrieves current prices (in Mexican Pesos) for Bitcoin and Ethereum.

Version 1.0 is a very simple app, it shows the current price, a small 5 minutes candlestick graph, the last 100 transactions, and both sides of the order book.

Later on, if time allows, I will expands its capabilities for other currencies and exchanges, as well as a AppleTV version of it.

I hope you enjoy.

May 27, 2016

OAuth 1.0a for ETrade API using Haskell

Lately, I have been interested in creating a market quotes receiver which later on, using a DB and ML algorithms, will analyze the market movements and provide suggestions for better investments. But initially, I had to connect to an API provided, for which I found ETrade, which is an Online Broker stablished in the USA which has a REST API to request quotes, account data or even place orders to the Stock Exchange.

I have been long time fan of Haskell, but I had never engaged with a long term project to learn more about the language, the platform and all its possibilities, although I have a book pending to continue writing about Haskell FRP for Game development, this project seems like a good time/learn investment for long term goals: apply category theory, learn to trade stocks, explore Machine Learning algorithms and many more.

For all that, I started doing authentication to the platform, considering that I had to email ETrade customer service to request a Auth public/private key, then later with those in file, I created this script which will perform all necessary steps to retrieve a access token, which would allow me to query everything within the Sandbox: so here is the code:

March 22, 2016

Confidencialidad

Bajo este rubro, la idea es mantener los mensajes e información secretos, confidenciales. Por ejemplo, utilizando los personajes de la comunicación, hacer que Ana o Juan se comuniquen sin que Eva o María descifren la información que comparten.

Para conseguir confidencialidad, la mayoría de los sistemas utilizan algún tipo de cifrado de tal manera que, si el texto es entremezclado, se aplica una función inversa que recupere el mensaje como originalmente fue creado.

March 17, 2016

Autorización

El video anterior se hablaba de los métodos para descubrir con quién se estaba comunicando, ahora bien, el objetivo primordial de la autorización es determinar que las actividades que cierta entidad reconocida son legítimas, en otras palabras, que las acciones a ejecutar en un sistema son validas para los permisos que se tengan como usuario del sistema.

Un ejemplo sencillo como el siguiente: se tiene a un usuario autentificado en el sistema (Ana), una vez se tiene una sesión válida, ella quiere ejecutar un archivo en una sección solo “autorizada” para administradores, entonces el Sistema Operativo lleva a cabo una verificación por medio de la “Lista de Control de Acceso”, en la cual se comparan los permisos de Ana para comprobar si forma parte del grupo “administradores” y así permitirle ejecutar dicho programa.

March 10, 2016

Autenticación

En futuras entradas, vamos a utilizar a los siguientes personajes para explicar como se establece comunicación entre partes:

Ana & Juan - Chicos buenos
Eva - Chismosa pasiva
María - Chismosa activa
Tomas - Ana & Juan confían en él

Autenticación

Nos permite verificar la identidad de una persona ante un sistema computacional. Para esto es necesario asegurar que la comunicación entre Ana & Juan es verificada sin que terceras partes (Eva o María) sustituyan la identidad de alguno. Básicamente podemos clasificar a las formas genéricas en tres:

- Algo que “Sabes” (por ejemplo, contraseñas).
- Algo que “Tienes” (por ejemplo, token).
- Algo que “Eres” (por ejemplo, biométricos).

March 7, 2016

Objetivos de Seguridad

La seguridad se debe tratar desde una perspectiva holística, en otras palabras, es necesario cumplir varios requisitos antes de considerar un entorno de Tecnologías de la Información “seguro”.

Muchísimos detalles pueden resultar en imprevistos inesperados que afecten la continuidad de un servicio, en su mayoría relacionados con tecnología. De forma genérica, es posible clasificar en tres: entorno físico, tecnología, políticas y procedimientos. Es típico contar con estos elementos si lo que se busca como prioridad seguridad de un sistema.

November 5, 2015

PuzzleGony

This is the first app I have developed in years as freelancer, a very simple game targeted for Apple Devices: Mac, iOS and Apple TV

November 22, 2013

Word capitalization with Haskell


We have this problem, given a string of words, capitalize just the first letter, but the main trouble here is the lack of a common pattern to distinguish between one and another, for example:

"helloanyonethere" -> "HelloAnyoneThere"
"himartin" -> "HiMartin"
"hellorange" -> "HelloRange"
"thereach" -> "TheReach"

Well, the trouble can be addressed using Haskell, list and the always opportune recursion. The input information would be a dictionary that contains all possible words and the string to analyze; the output should be an string with the capitalized letters.

November 20, 2013

Pentagonal Numbers in Haskell


As part of my refresh on algorithms, data structures and programming, I found this interesting mathematic problem:

Pentagonal numbers are generated by the formula, Pn=n(3n−1)/2. The first ten pentagonal numbers are:
1, 5, 12, 22, 35, 51, 70, 92, 117, 145, ...
It can be seen that P4 + P7 = 22 + 70 = 92 = P8. However, their difference, 70 − 22 = 48, is not pentagonal.
Find the pair of pentagonal numbers, Pj and Pk, for which their sum and difference are pentagonal and D = |Pk − Pj| is minimised; what is the value of D?

Then, I decided to elaborate a program in Haskell that would find the number D. Of course, you can find the code in Github.

November 8, 2013

Unbalanced Balances...


Once again, I found a challenge in a very common webpage that said the following:

You have a room-full of balances and weights. Each balance weighs ten pounds and is considered perfectly balanced when the sum of weights on its left and right sides are exactly the same. You have placed some weights on some of the balances, and you have placed some of the balances on other balances. Given a description of how the balances are arranged and how much additional weight is on each balance, determine how to add weight to the balances so that they are all perfectly balanced.

There may be more than one way to balance everything, but always choose the way that places additional weight on the lowest balances.

The input file will begin with a single integer, N, specifying how many balances there are.
Balance 0 is specified by lines 1 and 2, balance 1 is specified by lines 3 and 4, etc...
Each pair of lines is formatted as follows:

WL &lt balances &gt
WR &lt balances &gt

WL and WR indicate the weight added to the left and right sides, respectively. &lt balances &gt is a space-delimited list of the other balance that are on that side of this balance. &lt balances &gt may contain zero or more elements.

November 2, 2013

First Haskell Published Program: Arithmetic Progression


I find Haskell a challenging language, one that let you express yourself in different ways as procedural or object oriented programming allows you to do it. I knew about it quite a few months ago, but I have never had the time to concentrate to develop any example using it. As I found in the Facebook challenge example, I considered was a good opportunity to create a program with the current knowledge of Haskell (minimal) and still learn a lot using what I take for granted in other languages (C++ or Objective C).

At first, it is really a change of paradigm to start thinking about functions instead of variables that you declare at the beginning and use them as the program executes. Here those do not exist in the same way, as it does for loops (while or for) and the list are fundamental for data manipulation, you will notice my tries to force the language to behave as a procedural language, which I am aware it is not the best practice, but for the first steps I consider it is ok.

The statement of the test is the following:

October 29, 2013

Deferred Lighting: The backdoor, Part 2


In the first part of this article, we covered the a little theory of what this technique means as well as we set the foundations of code that started its execution on main. Now, the functional parts that are needed to create magic are going to be explained as follows.

When the Renderer class is allocated, also the constructor method is called, and here many preparations take place; in the following order: load each necessary CG shader, initialize the sphere lights (8) and place them across the heightmap, create the projection matrix and the root scene node to render objects, load the splash screen as a mesh, and set some configuration of the GCM. It is important to have considered the mesh "Sphere", this object will be the one in charge of draw into the scene the values of each light, in other words, the light will affect only on the area this sphere is colliding with, nothing else, process that differs from a ray tracing procedure. The code for what was explained before is here: