Posts

Introducción a Golang

Image
Versión en inglés / English version El lenguaje de programación Go, también conocido como Golang , fue diseñado en 2007 (y su primera versión lanzada en 2012) en Google con el objetivo de mejorar la productividad y eficiencia del desarrollo en backend. Los creadores de Go estaban motivados por problemas recurrentes encontrados en su uso de C++ para dicho desarrollo. Por lo tanto, las metas principales de Golang como lenguaje son: Tipado estático y eficiencia en tiempo de ejecución (como C++). Legibilidad y usabilidad (como lenguajes más modernos, como Python o Javascript). Un concepto de usabilidad fuertemente adoptado por Go es la el manejo automático de dependencias, como NodeJS lo hace vía Node Package Manager (npm). Golang usa el comando `go get` para ello. Alto desempeño en networking y multiprocesamiento: Se busca aprovechar al máximo las arquitecturas multiprocesador, favoreciendo el escalado horizontal (mejorar agregando máquinas). El gopher (ardilla terrestr...

Introduction to Golang

Image
Spanish version / Versión en Español The Go programming language, also known as Golang , was designed in 2007 (and first released in 2012) at Google in order to improve backend code productivity and efficiency. Its creators were motivated by problems they faced using C++ for systems programming. Therefore, Golang's main goals as a language became: Static typing and run-time efficiency (like C++). Readability and usability (like newer languages such as Python or Javascript). One usability concept deeply embraced by Go is automatic dependency management, like NodeJS does using Node Package Manager (npm). Golang uses the `go get` tool to automatically solve dependencies. High-performance networking and multiprocessing: The goal here is to take as much advantage of multiprocessor architectures as possible, and favor horizontal scaling (i.e. improve just by adding machines). The blue gopher is Go's mascot package main import "fmt" func main() { f...

Upgrading Lodash from 3.x to 4.x

Spanish version / Versión en Español There are many breaking changes from version 3.x to 4.x; all changes are detailed in the Lodash changelog . There is also a list of deprecated functions , with a regex you can use to detect usages in your code. However, since it is not an exhaustive list, I will list the changes I encountered when performing my own migration, to help anyone undergoing the same process. Direct renames This section includes functions in which only the name changed, i.e. the arguments and return value are the same. 3.x 4.x contains includes first head rest tail invoke invokeMap padLeft padStart padRight padEnd Direct renames if not using thisArg This section includes functions in which the only change is dropping "thisArg". If you are not using it, you can just rename. If you are using thisArg in 3.x, it can be dropped if you are using iteratee to acce...

Actualizando Lodash de 3.x a 4.x

Versión en inglés / English version Hay varios cambios que rompen código de la versión anterior al pasar de Lodash 3.x a 4.x; todos los cambios están detallados en el registro histórico de cambios de Lodash . Además, hay una lista de funciones obsoletas ( deprecated ) , con una expresión regular para encontrar usos de las mismas en tu código. Sin embargo, dado que ambos recursos no son exhaustivos, listaré los cambios que encontré al realizar mi propia migración, a fin de ayudar a quien atraviese el mismo proceso. Cambios de nombre directos Esta sección incluye funciones donde sólo el nombre cambió, vale decir, los argumentos y retorno son los mismos que en 3.x. 3.x 4.x contains includes first head rest tail invoke invokeMap padLeft padStart padRight padEnd Cambios de nombre directos (en caso de no usar thisArg) Esta sección incluye funciones en donde el único cambio es quitar el...

Set up AOMG IP camera for external monitoring

Image
Spanish version / Versión en Español This setup was done with a specific IP camera: AOMG OG-IPC3J19P-I3(A), but it can easily be extended for any other similar IP camera. This particular one has a wired Ethernet interface, so it requires a physical ethernet cable to the router. Physical connection We're going for this kind of setup: So, we need to connect the camera to a power outlet using its provided power adapter, and to the router via an Ethernet cable. Make sure it's CAT5 or better if it will be outdoors (this camera model is suited for outdoor use, so don't worry about that). To check that the camera has power, cover its lens with your hand and check if its red leds light up. It has no on/off switch, so that's the only wall to tell if it is on. Local configuration The first step is getting the camera's IP address ; this is usually specified in the manual, but in case you misplaced it, or a power failure reset the camera's settings, t...

Configurar cámara IP AOMG para monitoreo externo

Image
Versión en inglés / English version La siguiente configuración fue realizada con una cámara IP específica: AOMG OG-IPC3J19P-I3(A), pero puede generalizarse fácilmente a cámaras similares. Ésta en particular tiene una interfaz Ethernet cableada, por lo cual requiere un cable Ethernet físico conectado al router. Conexión física Queremos una configuración como la siguiente: Por lo tanto, necesitamos conectar la cámara a 220 usando su transformador, y al router vía un cable Ethernet. Asegúrese de que dicho cable sea CAT5 o superior si la instalación va a ser al aire libre (este modelo de cámara es adecuada para uso exterior, así que no se preocupe por eso). Para verificar que la cámara está encendida, cubra su lente con la mano y verifique si se encienden los LEDs rojos del modo infrarrojo. La cámara no tiene interruptor de encendido/apagado, así que esa es la única forma de ver si está encendida. Configuración local El primer paso es obtener la dirección IP de la c...

NuGet scripting in VS 2017

Image
Spanish version / Versión en Español If any of you ever published a .NET project as a NuGet package and needed some custom scripting to run when the package was installed, this used to be possible using the install.ps1/uninstall.ps1 mechanism . However, support for this was dropped in Visual Studio 2017, which bundles NuGet 4.x. The Init.ps1 script is still supported, but it runs every time the solution is opened, which might not be appropiate for most use cases. Another problem with the new VS 2017 NuGet way of doing things is that the .nuspec file, which was used to define metadata and files to package, is now gone; metadata is now handled via the project's properties, in the new Packaging section: In turn, this information is saved in the .csproj project file: The problem with this is, how to define which files to package inside the resulting .nupkg file using only .csproj? There is an alternate approach to NuGet scripting which involves embedding MSBuild ...