In past article I’ve talked generally about blockchain technologies, in this article we will look into Ethereum from user perspective. We will build local playground, where we can test many functions of Ethereum(Ethers transfers, using and writing smart contracts and more) without spending real Ethers (and thus real money). This guide in intended for users with Linux OS. Continue reading Ethereum local playground
All posts by admin
Blockchain madness
Some technologies I really notice only when they hit me directly into the face. That’s the case of blockchain – I have been looking into Bitcoin several years back and found it quite interesting (especially from cryptographic perspective – as interesting usecase for applied cryptography), but never expected that it’ll reach such extensive grow in popularity as we have seen in past half year or so. This forced me to looked again into these technologies and get bit more detailed understanding about blockchain technologies, why it’s so popular now and particularly look at recent development and on next big player in this area Ethereum project.
In this article I’ll share some initial thoughts of mine about blockchain, what I think it is and why it matters. In later article(s) we’ll look into Ethereum from purely practical perspective. We will build a local playground for Ethereum, where we can try immediately some basic functions of the system. Continue reading Blockchain madness
In RUST We Trust
Having been programing recently mostly in dynamic untyped languages (aka Python and JavaScript) I though that it would be nice to try something else, bit different – meaning compiled and statically typed. Last adventures in this area were with OCAML, which I used for few learning projects couple years ago( like this one). OCAML is very nice language indeed, and learning exercise was very valuable for me (especially getting more accustomed to functional programming style), but apart of that learning experience I did not follow it further (mainly due limited ecosystem of OCAML).
Looking recently to languages and technology survey on Stackoverflow where Rust is leading the list of most “loved” languages (meaning developers who used the language like it and want to use it for their next projects) with head start on second one (SmallTalk) . This caught my attention and looking quickly at Rust site I decided to give it a try. Below are my first experiences learning this language. Continue reading In RUST We Trust
Run and monitor tasks via WebSocket with ASEXOR
Many modern web applications require more then just displaying data in the browser. Data may need to be processed and transformed in various ways, which require intensive processing tasks on server side. Such processing is best done asynchronously outside of web application server, as such tasks can be relatively long running. There are already many existing solutions for asynchronous task scheduling, some of them are quite sophisticated general frameworks like Celery, Kafka, others are build in features of application servers ( like mules and spoolers in uWSGI). But what if we need something simpler, which can work directly with Javascript clients and is super simple to use in a project. Meet asexor – ASynchronous EXecuOR, a small project of mime. Continue reading Run and monitor tasks via WebSocket with ASEXOR
Comparison of JSON Like Serializations – JSON vs UBJSON vs MessagePack vs CBOR
Recently I’ve been working on some extensions to ASEXOR, adding there direct support for messaging via WebSocket and I use JSON for small messages that travels between client (browser or standalone) and backend. Messages looks like these:
messages = [ {'call_id': 1, 'kwargs': {}, 'args': ['sleep', 0.1]}, {'call_id': 1, 't': 'r', 'returned': 'd53b2823d35b471282ab5c8b6c2e4685'}, {'call_id': 2, 'kwargs': {'utc': True}, 'args': ['date', '%d-%m-%Y %H:%M %Z']}, {'call_id': 2, 't': 'r', 'returned': '77da239342e240a0a3078d50019a20a0'}, {'call_id': 1, 'data': {'status': 'started', 'task_id': 'd53b2823d35b471282ab5c8b6c2e4685'}, 't': 'm'}, {'call_id': 2, 'data': {'status': 'started', 'task_id': '77da239342e240a0a3078d50019a20a0'}, 't': 'm'}, {'call_id': 1, 'data': {'status': 'success', 'task_id': 'd53b2823d35b471282ab5c8b6c2e4685', 'result': None, 'duration': 0.12562298774719238}, 't': 'm'}, {'call_id': 2, 'data': {'status': 'success', 'task_id': '77da239342e240a0a3078d50019a20a0', 'result': '27-02-2017 11:46 UTC', 'duration': 0.04673957824707031}, 't': 'm'} ]
I wondered, if choosing different serialization format(s) (similar to JSON, but binary) could bring more efficiency into the application – considering both message size and encoding/decoding processing time. I run small tests in python 3.5 (CPython and PyPy) (see tests here on gist) with few established serializers, which can be used as quick replacement for JSON and below are results (updated Dec 2nd 2017 thanks to comment below, as situation changed a bit with new libraries versions): Continue reading Comparison of JSON Like Serializations – JSON vs UBJSON vs MessagePack vs CBOR
Lessons Learned From Current Web Application Development
Mybookshelf2 (MBS2) is basically in beta stage and provides all functionality available in previous version and more. As I went through programing the new application using several new technologies, I’ve realized few things, which I’d like to share here. Continue reading Lessons Learned From Current Web Application Development
Easy SQL Schema Migration for SqlAlchemy and Flask
While SqlAlchemy (and Flask-SqlAlchemy) provides an easy way to create DB schema from scratch, migration of an existing schema is bit more challenging. As soon as you change attributes in your declarative ORM models, the underlying DB schema is to be changed for application to work. If you need to keep data , you’ll need to modify DB schema with some DDL commands (ALTER TABLE …) and this functionality is not part of SqlAlchemy nor Flask-SqlAlchemy. Continue reading Easy SQL Schema Migration for SqlAlchemy and Flask
Mybookshelf2 Alpha Version is available
Mybookshelf2 enters the stage, when code can be considered of alpha quality. Basic functionality is there, so it could be tried and I plan to move my ebooks collection to it soon. MBS2 is packed with new technologies and comparing to previous version (Mybookshelf) it can be considered a completely new application.
So what’s new? Concerning functionality not much, but a lot happened internally. For me it’s more about testing and playing with new technologies then managing ebooks (which is still important of course). Maybe some of currently used technologies are bit of overkill (like using WAMP protocol), but nevertheless they play important part in the application. Continue reading Mybookshelf2 Alpha Version is available
NetworkManager Script to Set HTTP Proxy
While Gnome and it’s derivatives support automatic proxy detection, it do not work well for all programs, particularly for command line programs. I’ve found that using simple script in /etc/NetworkManager/dispatcher.d works better for me, which sets and unsets fixed proxy works better. NM dispatcher scripts are run each time network connections change (network up, down, VPN connect etc.) and received two parameters ( interface name and status) and bunch of environment variables. Continue reading NetworkManager Script to Set HTTP Proxy
Asyncio Proxy for Blocking Functions
File operations and other IO operations can block asyncio loop and unfortunately python does not support true asynchronous disk operations (mainly due to problematic state of async disk IO in underlying os – aka linux – special library is need for true asynchronous disk operations so normally select (or other IO event library) always reports file as ready to read and write and thus file IO operations block). Current solution is to run such operations in thread pool executor. There is asyncio wrapper library for file object – aiofiles, but there are also many blocking functions in other python modules – like os, shutil etc. We can easily write wrappers for such methods, but it can be annoying and time consuming if we use many of such methods. What about to write a generic proxy, which will assure that methods are executed in thread pool and use this proxy for all potentially blocking methods within the module. Continue reading Asyncio Proxy for Blocking Functions