Writing to myself

Escribiendo para mi mismo

What Does Happen When You Use Your Credit Card?

[Versión en Ingles]

I will keep this short.

You might already know I am an engineer and I work for a merchant service company, I create/maintain point of sale systems (POS) specifically PayAnywhere and phoneSWIPE, those ones that charge your credit/debit card (you usually see them in fancy restaurants, retail stores or on festivals where people user their smartphone to take the payment), don’t confuse them with the old terminals (those ones that have a keypad and small LCD screen, even tho, I work with them too). But this is just a small portion of a big diagram, so I thought I could tell you how a payment charge works.

Card Payment Industry is getting bigger, as you can see, we are moving from keeping cash to keep cards our wallets, I personally don’t hold any cash with me (not even for parking). You see more stores having signs of American Express, Visa or MasterCard which usually denotes the fact they these places can take those cards. Recently, retailers and card companies in the US went through a big migration (October 2015) from letting you swipe your card to the infamous insert your chip card in order to reduce fraud in the system (and I will said late in the game, due countries like Mexico, Canada and Europe did it first), companies like Apple, Google and others created products like Apple Pay, Android Pay to mention a few.

So to start, lets say you go and buy a hot chocolate, no whipped cream, no caramel, not marshmallows, just the hot chocolate from your favorite Coffee Shop for $4.00 USD (this is how I usually ask for it and I’m writing this from a coffee shop). You give your credit/debit card to the cashier so he/she can swipe it on the terminal or POS and a few seconds later it will be approved and you will have your beverage.

Now, lets brake this example as follow:

  • You as the customer or Cardholder have a contract with a bank, usually referred as Issuer,
  • The Issuer (Chase, Bank of America, etc) is a financial institution that provided you a credit/debit card and it is responsible to approve that hot chocolate you ordered,
  • An issuer bank is a member of a Card Association such as Visa, MasterCard, American Express, Discover, etc. And the bank most of the time provides only products from the association they belong to (like multiple credit cards all Visa or all American Express), these associations have rules on how their products are used (like for example the info you see on the receipt when you paid with your Visa card),
  • The Coffee Shop you went to is considered a Merchant and this is where the POS lives and the latter is in charge of creating the Payment Message.
  • A payment message is the core element (as my anatomy teacher used to refer to the most important element of a human body system) and contains your information, the retail information, the amount to be charge as well some extra info as the currency code (for example, you are in Europe but your card is from Mexico, so your banks needs to know the currency code this transaction was proceeded with), among others. This payment message is transmitted to other entities such as the Acquirer and eventually the same gives it back to the POS as an approved or declined message.
  • The acquirer is a financial institution for merchants, usually they provide the merchant with the infrastructure needed to accept card payments, and most importantly, they credit the merchant with the amount you paid ($4.00 USD). By the way, we could refer to the acquirer too as the processor, gateway or even ISO (Independent Sales Organization).
  • Now, the acquirer is not responsible to approve the transaction, although, he could bounce the payment message back if somehow the message is not formatted as expected (like when the POS has been compromised), so the acquirer sends this message to the card association network and the network sends the payment message to the issuer bank, the issuer then will identify you and verify if you have the funds available to approve the transaction.
  • Then you the customer might be required to sign the receipt (referred as Cardholder Verification Method) then you will get your chocolate and might receive a notification too from you bank (if you have the app on your phone) or will notice on the banking website about such transaction.

Now, this is one scenario of many, some other places might ask you to select between debit or credit and type your PIN if needed, others might ask you to insert the card, or ask you if you want cash back, etc.

Interestingly enough, the merchant don’t get the $4.00 USD you as a customer paid for that chocolate but that is a topic for another time.

Javier Azuara

¿Qué pasa cuando usas tu tarjeta de crédito?

[Spanish Version]

Esto será corto.

Quizá sepas que soy Ingeniero y trabajo en una compañía que provee servicios a comerciantes. Yo creo y mantengo puntos de ventas (POS) specificamente PayAnywhere and phoneSWIPE, aquellos que cargar tu tarjeta de crédito/débito (usualmente los ves en tiendas, restaurantes o algunas ferias donde la gente usa sus teléfonos mobiles para tomar el pago), no los confundas con las terminales viejas (aquellas con un teclado numérico y pantallas LCD, aunque también trabajo con ellas). Pero esto es solo una pequeña porción de un gran diagrama, así que pensé que podría decirles como funciona un cargo bancario.

La industria de pagos con tarjetas esta creciendo y como puedes ver, nos estamos moviendo de tener efectivo a mantener tarjetas en nuestras billeteras, personalmente no uso efectivo ni para el estacionamiento. Cada vez uno ve más tiendas teniendo pequeños stickers de Visa, American Express or MasterCard, lo cual denota que esos lugares aceptan esas tarjetas. Recientemente, tiendas y compañías en los estados unidos migraron (octubre 2015) al uso de tarjetas con chip para disminuir fraudes en el sistema (y añadiré que fue tarde en el juego cuando otros países como México, Canada y países de Europa lo hicieron años atrás), compañías como Apple y Google crearon productos como Apple Pay, Android Pay por mencionar algunos, entonces va para largo.

Para empezar, digamos que vas a tu tienda de café favorita y pides un chocolate sin crema, no caramelo y no malvaviscos por $40 MXN (así es como lo pido usualmente y estoy escribiendo esto desde un café), das tu tarjeta de crédito/débito para que el cajero la pase por la terminal y segundos después verás un mensaje de aprobado y listo a disfrutar de la bebida.

Ahora, examinemos el ejemplo:

  • Tú como el cliente or cuenta habiente tienes un contrato con un banco, usualmente referido como Banco Proveedor,
  • El banco proveedor (Banamex, Santander, Bancomer, etc) es una institución financiera que te dio la tarjeta y es el responsable de aprobar la venta que hiciste,
  • Los bancos proveedores son miembros de alguna asociación de marcas de tarjetas de crédito como Visa, MasterCard, American Express, etc. Y usualmente los bancos solo ofrecen productos de esa marca (todas sus tarjetas sean de Visa o MasterCard), estas compañías tiene reglas de como sus productos son usados (por ejemplo cierta información que ves en el recibo es requerida por ellos),
  • La tienda de café a la que fuiste es considerado un comerciante y ahí es donde el sistema de punto de venta reside y este es el encargado de generar el mensaje de pago,
  • Un mensaje de pago es el elemento principal del sistema y contiene tu información (para identificarte con el banco), información del comerciante y algunos extras como la moneda usada en la transacción (útil cuando compras un souvenir en Asía en tus vacaciones pero tu tarjeta es de México), este mensaje es transmitido a otras entidades como el procesador y eventualmente lo regresa al punto de venta como aprobado o declinado.
  • El procesador es una compañía que provee servicios para comerciantes, entre ellos, brindar la infraestructura para aceptar los pagos y más importante aún, le pagan al comerciante la cantidad que tu pagaste por el chocolate.
  • El procesador no es el responsable de aprobar el pago, sin embargo este podría declinarlo si el mensaje no tiene el formato correcto (suponiendo que el POS halla sido hackeado), entonces el procesador manda el mensaje a la asociación de marcas de tarjetas de crédito correspondiente y este al banco proveedor, este último te identifica como us cuenta habiente y verifica que tengas los fondos para pagar la bebida.
  • Finalmente, si todo fue aprobado, quizá tengas que firmar el recibo (usualmente referido como método de verificación del cuentahabiente) y podrías recibir una notification de tu banco (si tienes la app en tu teléfono).

Todo este rollo es solo un escenario de muchos, algunos lugares quizá te pidan elegir entre Débito o Crédito e ingresar tu NIP si es necesario, algunos otros, que insertes la tarjeta por que tiene chip o incluso si quieres efectivo.

Algo interesante es que el comerciante no se queda con los $40.00 MXN que tu pagaste, pero esa es otra historia.

Javier Azuara

Why You Should See Arrival Movie

Yesterday, I had the chance to watch Arrival for a second time and I have to admit while on the first time, I missed a lot of things (maybe due I was tired by then), but now, it left me thinking about 3 things (which I will describe soon), do not worry about spoilers as I won’t be touching the movie itself.

In short, Arrival is about how we as human perceive the world we live in and how we interact or react to the others/unknown, where language has a big role to do on the process.

Language has become a crucial tool to interact with people in our everyday life, we have verbal conversations, we text to people, and we do this using a handful or group of vocabulary, we use such words with a set of rules we have learnt since we were kids and depending on the language you speak, you know you have to follow the pattern “Subject-Verb-Object” AKA SVO for Spanish and English (just to mention 2) or “Subject-Object-Verb” AKA SOV for Japanese (again just one example) to form sentences. Some languages don’t have or care about female, male or plural words - I’m looking at you english -, while others have several forms of speech to be used according to the situation (this is usually called diglossia) such as Arabic. Base on this, it is not hard to conclude our thinking process; the way we generate ideas is deeply linked to our language, some people have asked me: “Javier, do you think in English or Spanish nowadays?”, to what I usually respond, it depends to who Im talking with, when talking to my family (in Spanish), I know I have to quantify time differently than English, when speaking in English I know sometimes I can convey an idea using fewer words. And this is how language shapes the world we are (#1).

Now, imaging yourself in a place where you are the only person who does not speak at all or partially speak the language from there. Communication is a 2 party process, and when one of the parties have difficulties to understand the other, frustration arise. I have countless examples like, should I say “Baseball ball or just baseball”, since coming from Spanish we usually say “Pelota de Baseball” where baseball is a foreign word we have incorporated in our vocabulary; the famous “Bare with me” vs “Bear with me”, once I got the right one, I removed the other one from my work/office vocabulary. These are tiny examples, but understanding each other (#2) is crucial, take the next example, during the cold war, Soviet premier Nikita Khrushchev gave a speech in which he uttered a phrase that interpreted from Russian as “we will bury you.” It was taken as chilling threat to bury the U.S. with a nuclear attack and escalated the tension between the U.S. and Russia. However, the translation was a bit too literal. The sense of the Russian phrase was more that “we will live to see you buried” or “we will outlast you.” Not a friendly comment, and for this kind of incidents interpreters have a whole career in the UN.

Learning a new language might not be an easy task and could be an ordeal depending on the one you want to focus (for example, Japanese is taking me way longer), but aside of the obvious benefits such as having a nice time traveling or getting a competitive advantage for that job you want, it can change the way you see the world ($3), you are just not learning the language but the culture its coming from, adding Japanese as an example, they have formal/polite and informal speeches, words can change depending if you are talking with your friends or your coworkers, when you are in a coffee store, people speaks to you in the polite form. You become closer to the people who speaks the language, understand why they do things in certain ways. It could even rise your empathy. Someone once told me before my trip to Japan, that it did not start when I landed there, it started from the very first time I embraced the idea to learn the language, and thus the culture, so the entire process became my journey.

So, I will leave you with this, go watch Arrival, I think it is an starting point of unification between 2 parties base on a bridge called language, all of the 3 things I mentioned are encompassed in the movie. Why it is important to overcome the differences? Why it is important to interact with people from different backgrounds? What do we get from it? How can we do it? And in the process, why not broad your horizon and learn a new language, most of the people in the world speak 1 language from a top 10 list.

And before I forget, you can check the movie info here.

Javier Azuara

Hi, Im Javier & I'm a Chronic Worrier

[Versión en Ingles]

And one of the worse ones.

How many times have you been worried about events such as “waiting for the finals outcome”, “waiting for that medical diagnosis” or “taking a flight to go your next summer vacations”? Every person experience uneasy feelings through their life, but some people does this excessively and when this happens, we called it anxiety.

Past Christmas, I had the chance to go my home country, the big difference this time was, It took me 4 flights (Detroit -> Los Angeles -> Atlanta -> Mexico -> Tampico) to get there. Due my nature I was thinking “I have 4 chances of dying”. This is the level of anxiety I have.

Pretty much like everything, something done excessively is bad and anxiety is not free of this. In fact, anxiety at normal levels is good, make us take action in danger situations, like a defense mechanism.

The best way I can define anxiety is not being able to tolerate the outcome of events, but just to certain events. The everyday questions like “what if”, always looking for the worse possible case scenarios, this can greatly exhaust you.

So, what does a person with anxiety do then? We live in a world full of this, well, we do one or more of the following:

  • Keep yourself busy, “I just have to think about it”, then you look for several activities, the main problem with this is, when alone, anxiety comes back.

  • Control everything, How many times have you heard something like “If I don’t do that, it won’t be done properly”. There is no doubt delegation is a problem for people with anxiety (but this is another topic).

I think one of the main reasons why people (like me) is afraid of flying is, we don’t have control during the flight (being there put us in an intimate level with our vulnerability), obviously this thinking has no foundation, we think that if we were not involve in the process, things can go wrong. However, things can still go wrong even if we were there from the very beginning.

Another example is, being on the copilot seat when the other person is driving over 100 km/h, but when we drive the same speed or more, we are in control.

  • Avoid the trigger at any cost, if you are afraid of flying, we choose to travel by car, if your thing are not the highs or speed, then no rollercoaster and the list keep growing. Avoiding the triggers seems to be the best idea ever, but in fact is the opposite. Usually when you go back to the trigger, it comes stronger.

So, why do we do this if this does not give us proper results? The answer is easy, we get instant gratification from it (another topic). These strategies create an illusion of progress.

What is the definite solution? There is no one, no solution will provide a 100% assurance everything will be perfect (error and accidents happen). What we can do is act (buying that flight ticket, hike that mountain) base on decisions that comes from stablished knowledge, measuring the risks if possible, accepting things won’t be covered 100%.

Javier Azuara

Hola, Soy Javier y soy un preocupón

[Spanish Version]

Y uno de los peores.

Cuántas veces te has encontrado teniendo incertidumbre en ciertas situaciones tales como “esperando los resultados de un examen escolar”, o quizá los “resultados de unos exámenes de diagnostico” o “al abordar un avión para ir tus vacaciones de verano”, entre otras. Todas las personas experimentamos preocupación a lo largo de nuestra vida, pero algunas personas lo hacemos de manera excesiva, y cuando esto sucede, generamos ansiedad.

En la navidad pasada, tuve la oportunidad de ir a México, la gran diferencia esta vez fue, me tomó 4 vuelos diferentes (Detroit -> Los Angeles -> Atlanta -> Mexico -> Tampico) para llegar a mi destino. Y bueno debido a mi naturaleza, por mi cabeza pasaba que tenia 4 oportunidades de morir. Ese es el nivel de ansiedad que tengo.

Como en todos los aspectos de la vida, todo en exceso es malo y la ansiedad no esta exenta de esta regla. De hecho, cuando la experimentamos en niveles normales, es benéfica, nos ayuda a actuar en situaciones de peligro, como si fuera un mecanismo de defensa ante diferentes escenarios.

La mejor manera en que puedo definir la ansiedad es #la intolerancia que una persona tiene a la incertidumbre# y debo aclarar a ciertas situaciones, por que eso es lo que siento. El no saber al 100% el resultado sobre los eventos que vienen. La constante interrogante del “que tal y sí” o “what if” en su versión ingles. La desmoralización y agotamiento de solo ver los aspectos que pueden salir mal a ciertos eventos o catastrofismo.

Qué hace una persona que es intolerante a la incertidumbre si vivimos en un mundo lleno de la misma? Bueno, hacemos una o más de lo siguiente.

  • Te mantienes ocupado, “Solo tengo que dejar de pensar en eso” y buscas infinidad de actividades para no pensar en ello, el problema es que cuando finalmente tienes que relajarte, aquello que evitas pensar, vuelve.

  • Controlas todo, cuantas veces has escuchado una frase como “Si no lo hago yo, esa chingadera no sale bien”, Sin duda la delegación es un problema, y esto se liga a la desconfianza (pero esa es otra historia).

Creo que una de las razones por las cuales las personas tienen miedo a volar en aviones, es por que no tienen control de lo que pasa durante el vuelo (al menos en mi caso es así, nos pone en contacto con nuestra vulnerabilidad), tenemos este pensamiento sin fundamento que si no estuvimos involucrados en el proceso de construcción, pilotaje, etc, las cosas pueden salir mal, sin embargo las cosas pueden salir mal aún cuando uno estuviera involucrado durante todo el proceso.

O, tenemos ansiedad cuando estamos en el asiento de copiloto por que el chofer maneja arriba de 100 km/h, pero cuando uno maneja a esa misma velocidad o más, estamos en control.

  • Evitamos aquello que nos preocupa, si tienes miedo a viajar en avión, evitas hacerlo, si te dan miedo las alturas y velocidad, evitas subirte una montaña rusa, y la lista puede crecer. Evitar hacer cosas puede parecer la mejor manera de manejar la ansiedad, pero en realidad es la peor manera. Por que cuando ocurre el evento que te provoca ansiedad, muchas veces regresa con más fuerza.

Y por qué hacemos todo esto si al parecer no da resultados definitivos, la respuesta es, estas estrategias nos dan una gratificación inmediata (otra tema). Proveen una ilusión de que el problema se esta solucionando.

Qué es lo que realmente funciona? Primero hay hacernos a la idea de que no hay una solución or decisión aprueba de todo (accidentes o errores pasan). Lo que si podemos hacer es tomar decisiones basadas en conocimientos establecidos y midiendo los riesgos, una vez hecho esto, actúa (compra tu boleto de avión, ve y escala esa montaña) y acepta que puedes estar preparado hasta cierto porcentaje pero no al 100%.

Javier Azuara

The "I Have Got Nothing to Hide" Argument

I’m sure you have heard about Apple position on creating a backdoor for the FBI, that could potentially create a precedent on how similar cases can be handle in the future if they do it. And while reading about the topic, there is people oppose to it and there other that are ok with it, some people even use the argument “I have got nothing to hide”.

Straight to the point, I found an amazing document that dismantle such argument, asking questions like, what are the boundaries of its usage? what is the underlying meaning of it? what are the flaws? and most importantly, what is privacy and how actions/comment like these affect it.

Download

The document is from:
Author: Daniel J. Solove
Associate Professor at Yale Law School

Enjoy!
Javier Azuara

Coding Etiquette

I know, right? This used to frustrate me a lot, but hey! its not the end of the world.

Prior this entry, there has been some attempts on the team I work with to come up with guidelines or rules to use in our development process. Rules tend to force and condition a specific behavior, and even when the team has agreed to use them, its difficult due such guidelines - the common ones - ask for a change on how developers write their code, at the end, its a give and take that not every team member might be happy with.

On the other hand, an etiquette describes a code of behavior in a specific social context. If we land this in our professional environment, it is expected from a senior developer to have similar habits and standards to maintain an order that will be beneficial in the development process. As I previously mentioned, an etiquette does not force a behavior as oppose to a rule (so developers can still choose not to follow them), but it sets expectations level for everyone in the team.

Straight to the business, these are the etiquettes I think every development team should use - there might be more, and i will add them once they come to my mind:

Reusability

Have you heard about the principle “Don’t Repeat Yourself” (DRY)? It states that specific components should only occur once in your system. Having this in mind, if you are in the need to add a new component AKA method, class, etc, consider the following steps/questions:

  • Is there something similar already to what I want to add?
  • If Yes, then - does it do what I need?
  • If No, then - can I update it?

And we can continue with more questions like this. The goal is to avoid having repeated components that might be doing the same. Remember duplication in code is a bad practice.

Commenting

Commenting your code can be a good tool to avoid things like “When I wrote this, only God and I understood what I was doing. Now, God only knows”.

If the method you are implementing has or will have a big bunch of code, consider breaking the logic into steps, if those steps require some kind of assumption, do not hesitate to add it as a comment (it might be an assumption for you but not for others).

The goal is not to comment every single line of code but to comment a series of steps that achieve a particular objective.

This will help other developers to understand why things were done like that, and in the event of adding new code, information like that will be helpful to define where to inject it.

Lastly on this point,

  • Comment anything that is unusual on a normal flow, for example, if you want to avoid calling the super implementation of a selector, be sure to add the comment.
  • If a method is purposely left empty, add the comment.
  • If you find something subject to be improved (or moved, deleted, etc), or when you added or saw a hacky fix that needs immediate refactor, add a //TODO:

Naming Conventions

Usage of proper naming conventions is considered a good practice. We prefer “Camel Case” naming convention (capitalizes the first character of each word except the first word).

For variables:

Name your variables keeping in mind the purpose they will be used. If your need to store the width value of a specific view, avoid using names such as “x” and consider “searchBarWidth” instead, if this becomes problematic the use of “width” does the job too.

Most developer prefer the usage of a prefix that describes the class name. For example:

1
2
MKMapView *mapStores;
UILabel *lblTitle;

For methods:

Name your methods keeping in mind the main objective to be achieved within them.

As an example, if you need to create an action where the first object from the list needs to be selected, do something like this:

1
2
[sender selectFirstItem];
[sender selectFirstCategory];

instead of

1
[sender selectFirst];

Another example can be, if you need to create a method to dismiss the current view controller, you can do:

1
[sender dismissController] 

instead of

1
[sender cancel];

For methods with multiple parameters, consider the following example. If you need an action where we need to add a payment to a receipt, you can do:

1
[sender addPayment:toReceipt:];

Avoid adding the word “and” in the parameter names.

1
[sender findItemWithType:andPk:];

For completion blocks, words likes “onComplete”, “onSuccess”, “onFailure”, “doAfter” are acceptable.

For UnitTesting methods, always start with the word “test”.

Giving Feedback on Pull Request

This can be considered a difficult task since there is the need to draw a line on things that needs to be changes for approval and things that are acceptable but don’t block the approval.

Consider the usage of the following phrases when writing your feedback:

  • “Must Fix”: Meaning no approval until its changed.
  • “Suggestion”: Approval is not compromised but its under developer discretion to change the code.

What scenarios will make us use the previous phrases? For that, ask yourself the next questions:

  • Does it achieve the goal?
    • If Yes, then most likely you will be just adding suggestions.
    • If No, then a must fix should be requested.
  • Does this approach increase the project technical debt?
    • Don’t hesitate to express that something needs to be changed due reusability is not achieved as it should be.
  • Is there any database change?
    • Be careful with this one, and most likely you will request a must fix.
  • Does this code brake existing unit tests?
    • If so, its an easy answer, you should request a myst fix.

Writing Unit Test

Think of unit test as a safety net you add to the logic you just implemented in a given task. If there is new code injected in the same area where the unit test are working, you can know if the behavior has change prior any manual testing.

It is a good practice to have the following things in mind while writing unit tests:

  • They should be defined before any code change is made, if you do the opposite, most likely you will have to go back a touch the code to make the test pass.
  • Gherkin language (Given, When, Then, etc) is useful to describe what you are testing.
  • Test should be testing small independent bunch of code.
  • More than one assertion is acceptable if they are related. If not, only one per test.

Technical Debts & Refactoring

In every codebase you might find code that meets the following criteria:

  • Is out of date and requires immediate change, but if you proceed, it might and most likely affect other areas.
  • Due a time constraint you decided to implement a patch knowing you need to come back later.
  • There is a better or newer way of doing something.

When doing such discovery, raise the voice and have a technical debt created for you for future implementation (you should reach the lead developer for this), don’t do the change if you are unsure of the impact it might cause.

Letting other people know about the discovery can have additional benefits such as:

  • Doing the change right away due there was no severe impact on it.
  • Understanding why it was done that way (specially when no comments were added).

Small General Etiquettes

The following ones are project specific or language specific.

  • Line Length: 120 (not strict limit).
  • Use default spacing (4 spaces).
  • The usage of constructor or initializer methods is well received.
  • Any new string added to the project should use NSLocalizedString macro.
  • When submitting Pull Request, remove commented code and discard any changes that is unrelated to your fix/implementation (specially with storyboards).
  • The usage of pragmas to organize code is well received.

Conclusion

Working in a team might be not be an easy task, specially for people like me obsessed with order. As you can see, these etiquettes do not ask developers to change how they use spaces in methods declarations, semicolons in conditionals, block the usage of ternary operator, etc. But they do ask for a common behavior when working in a team, to keep things as objective as possible. And again, in a professional environment, habits like this should already exists on the individual, specially in those ones with a lot of experience.

Javier Azuara

Is Donald Trump Immigration Reform Crazy? [Thoughts From a Mexican Guy]

[Version Ingles]

I’ve been hearing a lot of comments about Donald Trump’s immigration plan - about how he would actually give back the jobs “we” (I highlight this since I think we are the least problem this country has in my opinion) foreign workers are taking from Americans - and after reading his proposal here are my comments.

Putting aside all the hard comments about Mexico, he proposes: raising fees for VISAS, increasing wages for workers with H1Bs, penalties for cities that refuse to hire Americans first, increasing penalties for people who overstay after their permit is expired, even mandatory return for people who has committed any criminal activity.

Now, Im not a politician, but if you ask me if this is crazy, I would say no. Additionally, are the Americans ready for this? Thats is a different topic I wont even comment. Actually, there is one thing I agree from his proposal, he says “A nation that does not serve its own citizens is not a nation.”, and that is completely true and it was the most shocking part from the text. In fact, It is not about his reform what I really want to talk about - It is about why people leave their countries.

People decide to leave their countries for several reasons, among them you can find: to reunite with family, because of a conflict such as the Syrian Civil War (where people can’t go back due the danger in their hometown or the fear of being killed), and because they are looking for better opportunities. The last one is the one that made me leave my country.

And this is where I agree with the above, I believe a nation should provide their citizens an environment where all opportunities are equals and accessible to everyone, a place where the empowerment elevator is not broken, and not allowing specific type of business or people to use it to their advantage, a place where salaries are competitive enough that makes citizens think they do not need to go other places for stability, security and personal fulfillment.

Sorrowfully, I think Mexico as a nation is not doing a great job to achieve the goal. And I said as a nation due Im not blaming only the current and past governments, but the citizens too (citizens like me that decided to leave), citizens that does not get involve on who/how they are governed. And I think too, this is not exclusive to Mexico, other foreigns in their attempt to achieve the American Dream are ready to give it all.

So, when I read & hear comments regarding Trump’s immigration plan, I can only think, I would do the same for my country, I would create the right place to achieve what I mentioned above (and you might say now - Javier, It’s just politics - or - Your are becoming a gringo - plus - you should not say anything). But the reality is that since I pay taxes, I have the right to express my opinion and even complaint if I want.

Now, where is all this coming from? Well, those who have the luck and misfortune (yes, as ambivalent it can sound) to live outside their country, tend to love it more, and that is my case.

Javier

[Spanish Version]

He escuchado muchos comentarios acerca del plan de Donald Trump - sobre cómo el podría devolver los empleos que nosotros los inmigrantes hemos arrebatado de los americanos - y después de leer su propuesta, he aquí mis comentarios.

Dejando aún lado los comentarios fuertes sobre México, se propone subir las cuotas para obtención de VISAS, incrementar salarios para los portadores de H1B (no entiendo como esto podría ser beneficioso pero bueno), penalizar a ciudades que se rehusen a contratar a americanos primero, incrementar las penalizaciones para las personas que se queden aún después de que si permiso halla expirado, además de deportar a personas criminales, entre otras.

No soy político, pero si me preguntas si esta reforma parece una locura, yo diría que no lo es. Adicionalmente, están los americanos preparados para asumir este cambio - este es un tema que no me atrevería a tocar ahora. De hecho, hay una sola cosa con la cual si coincido con su reforma migratoria, y es “Un nación que no sirve/provee a sus ciudadanos, no es una nación”, y es completamente cierto. En realidad, no es acerca de la reforma de Trump el tema del que quiero hablar pero el por qué las personas deciden dejar su país.

La gente decide migrar a otros países por varias razones, entre ellas, por que se quieren reunir con su familia, por que existe un conflicto como la [Guerra Civil de Syria] (https://en.wikipedia.org/wiki/European_migrant_crisis) (donde los refugiados no pueden regresar a su país por el temor a morir), y otros por que están en busca de oportunidades (razón por la cual decidí salir).

Y aquí es donde estoy de acuerdo con Trump, creo que una nación debiera proveer a sus ciudadanos el ambiente ideal donde las oportunidades sean iguales y accesibles apara todos, un lugar donde el elevador del poder no este descompuesto, permitiendo así, que industrias especificas o personas lo usen a su favor, un lugar donde los salarios sean lo suficiente competitivos para que las personas no tengan la necesidad de ir a otros lugares a buscar estabilidad, seguridad y satisfacción personal.

Con pena, creo que México como nación no esta dando la talla en esta materia, y enfatizo “nación” por que no solo culpo a los pasados y actuales gobernantes, pero también a los ciudadanos (como yo que han decidido irse), a ciudadanos que no se involucran por saber quién, cómo los están gobernando. Y pienso también que esto no es exclusivo de México, otros nacionales en su intento de lograr el sueño americano, están dispuestos a darlo todo.

Entonces, cuando leo y escucho comentarios acerca de la reforma de Trump, solo puedo pensar que, you también haría lo mismo por mi país, para crear el lugar adecuado para lograr el objetivo antes descrito (y aquí es cuando algunos dirán - Javier, es política, todo es mentira - o - Callate gringo - además de - tu eres el menos indicado para hablar). Pero la realidad es que desde que pago impuestos, tengo el derecho de expresar mi opinión e inclusive quejarme si quiero.

Por ultimo, de dónde viene todo esto? Bueno, aquellos que tienen la dicha y el infortunio de vivir fuera de su país, tienden a amarlo y apreciarlo de más, y ese es mi caso.

Javier

Daring for the First Time - My Thoughts About HIV

There has been a long time since I haven’t touch this place, and now I feel inspired, so here I got with a topic that believe it or not, it is important to me.

Like it or not, HIV (AIDS) is deeply related to the gay community, where more than 50,000 new cases are registered in the US and around 2,000 - 5,000 in Mexico every year, most of these cases are diagnosed in men that have sex with other men (MSM).

Now, the million dollar question is, how is this related to me? Well, first, Im gay, second, I have people that I appreciate and love that have been diagnosed with HIV and third, Im afraid, very afraid. Im a catastrophic thinking guy - I remember once I stopped going to the movies due I believe that way, I would avoid a crossfire - I know its stupid but, thats me - so I tend to think in the worst case scenario in every situation.

But Im upset too, upset of watching such numbers increase, upset of the disease itself since It found its niche in the most popular transmission way which is sex, upset of other gay men (not generally speaking) taking the topic so slightly, upset of me not being able to release such topic.

Not only Im upset, but Im grateful too, grateful of being surrounded of people that cares about me, grateful to the people who has listened to me complaining and releasing my anxiety about the topic, even once one said “I felt like swords crossing my heart when you talk about that”, grateful of being lucky so far, grateful of being afraid and upset because it helps me being alert.

If the HIV topic causes all these emotions to me, so, why talk about it now and not before? Well, I recently watched one interview to this awesome lady (Tina Roth Eisenberg) and one of the things I got from her is that “If something is bothering you, you either do something or let it go”. And since the second option has not work for me - for a long time now - and no therapist seems to please me either - Im very hard with people by the way - well, Im here writing about it, exposing my vulnerability, daring to talk about it, daring for the first time.

Will this help me? I have no idea, but certainly its better than running away. Its time to take the bull by the horns. I need to take action and I have decided to get involve in the topic, instead of just turning around and ignore it. Im checking my options, what, where, how, when are the questions now. The reality is that HIV exists and its here and we have to deal with it regardless if you want to prevent it or live with it.

Javier Azuara

More info? - (US Stats & Mexico Stats)

Create & Share a Business Card in Passbook

While in the #WWDC2015, meeting new developers, recruters, media is imperative, reason why, you will be finding yourself sharing business cards.

I met one developer, who had an unusual way to share his card, and that way was using Passbook, I inmediately asked him to share how he did it and in my time in the conferences, beside putting attention to them, I was working on my own digital card.

Unfortunately, I found myself checking other sources to complete the task, so I decided to compile the information and share it here.

First and most importantly, you will need an apple developer account (this should be no issue anymore due on #WWDC2015, it was announced that there will be no cost to get one). Go a head a create one, then come back.

Passbook technology works around a file which its format is .pkpass, when either the mail or mobile safari detects this file, it will render the pass correctly, once you click on it, it will handle the rest for you (presenting the view to add it into the pass library).

Creating .pkpass file

Before doing anything, lets create a new directory to put all the things we will be creating.

Having said the above. The following image describes the skeleton of the pass.

image

As you may already saw, we can localize passes creating the appropiated directory structure, but that is something we wont do now. There are 2 files missing on that image, they are the manifest.json file and the actual signature file (which we will create soon).

Now, how is this translated to the actual pass? The following image describes that.

image

The actual content information resides inside the .json file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

{
  "formatVersion"         : 1,
  "passTypeIdentifier"    : "<INSERT_PASS_IDENTIFIER>",
  "serialNumber"      : "0",
  "teamIdentifier"        : "<INSERT_TEAM_IDENTIFIER>",
  "barcode" : 
  {
  "message"   : "<INSERT_BARCODE_MESSAGE>",
  "format"    : "PKBarcodeFormatAztec",
  "messageEncoding"   : "iso-8859-1"
  },
  "organizationName"  : "<INSERT_ORGANIZATION_NAME>",
  "description"       : "<INSERT_DESCRIPTION>",
  "logoText"          : "<INSERT_TEXT_THAT_GOES_NEXT_TO_LOGO>",
  "foregroundColor"   : "rgb(1, 0, 0)",
  "backgroundColor"   : "rgb(0, 0, 1)",
  "generic"   : 
  {
  "primaryFields" : 
  [
    {
      "key"       : "name",
      "label"     : "NAME",
      "value"     : "<INSERT_VALUE>"
    }
  ],
  "secondaryFields" : 
  [
    {
      "key"       : "position",
      "label"     : "POSITION",
      "value"     : "<INSERT_VALUE>"
    }
  ],
  "auxiliaryFields" : 
  [
    {
      "key"       : "email",
      "label"     : "EMAIL",
      "value"     : "<INSERT_VALUE>"
    },
    {
      "key"       : "twitter",
      "label"     : "TWITTER",
      "value"     : "<INSERT_VALUE>"
    }
  ],
  "backFields" : 
  [
    {
      "label"     : "EMAIL",
      "key"       : "emailBack",
      "value"     : "<INSERT_VALUE>"
    },
    {
      "label"     : "TWITTER",
      "key"       : "twitterBack",
      "value"     : "<INSERT_VALUE>"
    },
    {
      "label"     : "GITHUB",
      "key"       : "githubBack",
      "value"     : "<INSERT_VALUE>"
    },
    {
      "label"     : "WEB",
      "key"       : "webBack",
      "value"     : "<INSERT_VALUE>"
    }
  ]
  }
}

Remember I mentioned you need an Apple Developer Account, the .json file requires “passTypeIdentifier” & “teamIdentifier”. You can get the second one under Account Information area in the developer portal. The first one will be the next thing to do.

Feel free to play with the values on the .json file, you can change it entirely with the ones you have in mind. Now lest put this on hold and create all the boring stuff we need from the dev portal.

Head to the Developer Portal

Go to Certificates, Identifiers & Profiles in the dev center and click on Pass Type IDs, now add a new one - you should see something like this.

image

For this example be sure to use the following format “pass.com.yourdomain.appname” as the website mentions. Go a head an register the pass. Once created, go back to the pass.json file and update the “passTypeIdentifier” value with the one you just added.

Click on the recently created ID and you will have the option to edit. Then you will create the certificate to be used. In order to do that, follow the instructions from the dev center. Once you are done, download the certificate and add it into the passbook folder we created at the beginning and do not forget to add it into the keychain too.

image

Going back to the Pass directory

Early, I did mention we needed to create a manifest.json file, the purpose of this file is to describe what is inside the pass package. Below you will find and example of it.

1
2
3
4
5
6
7
8
9
{
 "thumbnail.png":"2a25d4de25819de588c42fb3f49888e94b6e83b9",
 "thumbnail@2x.png":"e29426fdd44a8e0c50eb4e38daefc607c773ec9e",
 "logo.png":"e7710517855699946da011df94f78264fdf20e57",
 "logo@2x.png":"8b6b2d7ce29d014a6ea36d452fbc3695b77c0ca7",
 "icon.png":"e7710517855699946da011df94f78264fdf20e57",
 "icon@2x.png":"8b6b2d7ce29d014a6ea36d452fbc3695b77c0ca7",
 "pass.json":"6c5791fc47b132fe627c6b5a168b57f22bc1c3a7"
}

Where did those weird characters come from? Those characters are their checksums, you can get them using Terminal using the following command (head to the passbook directory using terminal).

1
openssl sha1 pass.json

The result will be something like this:

1
SHA1(pass.json)= 6c5791fc47b132fe627c6b5a168b57f22bc1c3a7

Create the file and put it next to the pass.json file. Its obvious you have to do the same with the rest of the files/assets.

IMPORTANT: If you happen to update either the assets or the pass.json file. You need to update the manifest.son file. Do not forget about this.

The other file we need to create is the actual signature. Why do we need a signature? Ask Apple!

In order to do it, we will need the certificate we created before on the dev center. Open KeyChain Access, find the certificate you created following the format “pass.com.yourdomain.appname” and export it as a .p12 file - for this example, I named it pass.p12 - (you will be prompted to add a password - we will use it in a few seconds).

Next, go back to Terminal app and type the following command:

1
openssl pkcs12 -in pass.p12 -clcerts -nokeys -out passcertificate.pem -passin pass:<INSERT_PASSWORD_HERE>

The result of this command will be a file named passcertificate.pem. Now, lets export the key using the next command and the result will be passkey.pem:

1
openssl pkcs12 -in pass.p12 -nocerts -out passkey.pem -passin pass: -passout pass:<INSERT_PASSWORD_HERE>

We are almost done, we need one more certificate, this time its WWDR certificate, head to KeyChain Access and look for “Apple Worldwide Developer Relations Certification Authority” and export it as a .pem file - for this example I choose the name WWDR.pem - finally, we have all needed to create the signature file. Head back to the Terminal App and type the following command:

1
openssl smime -binary -sign -certfile WWDR.pem -signer passcertificate.pem -inkey passkey.pem -in manifest.json -out signature -outform DER -passin pass:<INSERT_PASSWORD_HERE>

This will create a signature file. From here, we just need to zip the files, but lets make sure we have everything, the following image describe what should be on the package.

image

Simply, select all those files and compress them, replace the .zip file extension to be .pkpass and you will have your pass ready to share.

Sharing your Business Card Pass

There are 2 ways to share your pass, for the sake of this example we will use the email approach. As I mentioned at the beginning, iOS will handle everything if you use Mail or Mobile Safari.

Simply, send you an email to your self or any other people attaching the .pkpass file and if successfull, the apps will render the pass properly. You should see something like this.

image

Now, you can go even further and use the barcode message to be the URL were people can download the pass when they scanned, you will be resposible to create the endpoint and endup with something like this.

image

Javier Azuara

WWDC 2015 the Line Experience

WWDC 2015 has just finished and there were a lot of new experiences I got from the event, such as the keynote, the lunch sessions, the after parties, etc, but one among them is with no doubt the so called “Line” experience. For those who does not know what the Line is, its basically, arriving early to get the best seats you can for the keynote presentation.

At the beginning, I was hesitant do it, and I was always avoiding the topic with my friend and coworker Nader. But we reached a moment were we needed to decide if we should do the line or not. In order to make such decision, we stopped in the Moscone center at Sunday at 18:00. The first thing we saw was a bunch of unknown people already doing it (around 25, most of them very young guys).

At that moment we knew those guys were not playing, the worst thing its that we were not prepared to do such task. Then we meet Kevin (the CEO of https://en.neurs.com/ - check the website), we ten head to Target City (just next to the Moscone Center), in there we packed some beach chairs, water bottles, some monster beverages and blankets - yes, the night was going to be cold - and went back.

Even doing the line, I was completely thinking - “Im very old for this” - followed by - “I feel embarrassed doing this” - but I would not deny very deeply inside me I was still an Apple fanboy who was willing to commit and get the best seat possible.

Time was passing and unknown people became known people, like Jupiter - who is from Toronto and had the scholarship to attend the event, working on a watch kit app -, Douglas - very serious guy, working on an app to add parental control for kids -, several guys from Australia which I do not remember their names - I apologize for this -, Daniel Di from Italy - who gave me his business card as a pass in Passbook -, among other guys, but the one who really impressed me was Clint Wilde, who is just 18 years old and already has his app feature on the app store “Splash Canyons” on the game category, at that age I was doing something completely different, I could not resist and felt jealous about the fact.

Splash Canyons

Several people walking at the middle of the night started to: “Why are you doing this?” - one guy said - “What is this line for?” - other people in their cars were asking - We even got food for free, rumors are that the Apple was delivering the food to the people on the line, but im not sure about this.

Undoubtedly, something inside me was emerging, and that was the joy of pursuing what you want, following your plan, completing the idea you have, overcoming the obstacles your project might have. Something I lost years ago, I started surrender to first big obstacle my next billionaire idea had. I stopped researching deep enough to find a solution. I always say its not about the idea itself but the execution of it. I guess I need to follow such statement and just not reproduce it like a copy machine.

While these conversations were happening, the line was getting bigger, from 1 block length to 2, 3 & 4 blocks, by 05:00 I stopped putting attention to it. I saw community, people from the same country were creating their own group, people from Germany, Brazil, Australia, Italy, Argentina were the accents and languages I did recognize. Sadly, at that time, I did not see any group from Mexico (not until the Bash were I found Mexican people).

By 07:00 - 07:30, Moscone Center opened their gates and as you might imagine, this is were the game started, people ignored the line and started to walk or running. We then were directed to a new line making several stops to reach the 3rd floor, while this was happening, new people was in the first at the front, but I continued to see familiar faces. We wait and saw how the press had special treatment to reach the Presidio (An area inside Moscone where the Keynote is). I did not like this treatment, I felt like cattle, I felt disappointed, used and most importantly, I needed to go to the bathroom but I was unable to do it. Apple did not hesitate to start taking video and pictures, they wanted the best picture, capture the excitement, but we were tired, exhausted, we just wanted to get to the holy grail.

We finally reach the Presidio, even when we were told not to run, people did it, like if they were running for their lives, chased by zombies. People who we just met, changed behaviors like in a jungle, but instead of survive, we wanted the best seats. We did it, we got the seats in the middle column, 4th row. We were happy, we knew something was coming and we get what we wanted.

Javier Azuara