One suboptimal database query can effectively paralyse whole application. Tracking down such bottleneck is one thing but speeding it up is not a trivial task. This article is intended to show how one can analyse and refactor slow database query. In all examples I was using MySQL Workbench and Sakila example database. DB’s structure is […]
Ext Js Pathfinder progress report #7
Today I took care of basic support for windows. They are not very interesting when it comes to interacting with. The only way to do something with them beside moving them around is to close them using icon in the right upper corner. This is not as trivial as it might seem because using window.close() […]
Dive into Python’s asyncio, part 5 – protocols
Protocols are asyncio’s primitives supplied as convenient base classes to quickly set up clients or servers using TCP/UDP (+ subprocesses). These are especially helpful when we need to implement low level handling of protocol of some sort. I believe they are inspired by Twisted’s protcols. Simple example of TCP echo server protocol may be (taken […]
Ext Js Pathfinder progress report #6
Ext JS has plenty of components. There are main categories, quite familiar to many people like buttons and less-expected descendants such as split buttons. Split button is a creature that hides a menu – when user clicks an “arrow part” of split button, the menu is revealed. To handle such things, I provided two handy […]
Dive into Python’s asyncio, part 4 – simple chat with Sanic
Let’s roll with something practical, namely a simple chat application using Sanic framework mentioned in previous post. Sanic supports websockets out of the box thanks to the websockets library. It’s super easy to write a handler function by using decorator (#1): @app.websocket(‘/feed’) # 1 async def feed(request, ws): while True: data = await ws.recv() await […]
Ext Js Pathfinder progress report #5
Just a quick update. I solved problems with failing tests after switching to my own example Ext JS page. Apparently, PhantomJS doesn’t like protocol mismatch – I served my page using HTTP, but Ext JS assets were served using Sencha’s CDN with HTTPS. <link rel=”stylesheet” media=”screen” href=”https://cdn.sencha.com/ext/gpl/4.2.1/packages/ext-theme-classic/build/resources/ext-theme-classic-all.css”> <script src=”https://cdn.sencha.com/ext/gpl/4.2.1/ext-all.js”></script> Removing protocol part from links and […]
Dive into Python’s asyncio, part 3 – web framework
Few days ago while I was reading fullstackpython.com I came across new pythonic micro web framework based on asyncio – Sanic. Coolest thing about Sanic is that it leverages asyncio providing better performance and more efficient hardware utilization. Although it’s not feature complete yet, there are people claimimg to be using it in production and […]
Ext Js Pathfinder progress report #4
Today’s note is short. I successfully managed to transition on a custom example page to run tests against. This resulted in much faster execution, however tests are failing due to failure of finding ‘Ext’ object. Unfortunately, reason remains unknown. Possibly, I will be migrating to headless Chrome or Firefox, since PhantomJS’ maintainer stepped down a […]
Dive into Python’s asyncio, part 2
All examples were tested under Python 3.6. The only asyncio rule After reading part 1 you should already know, that a heart of asyncio is an event loop. There is exactly one rule – do not block the event loop! Never ever. Fortunately, it’s quite simple to avoid this. Use only co-operative libraries for blocking […]
Ext Js Pathfinder progress report #3
3rd progress report is under way. So far Ext Js Pathfinder can interact in a limited way with textfields and buttons. But what is it good for, if it lacks a handy set of assertions? Writing ‘classic’ assertions in testing websites usually amounts to few things: asserting site’s title is equal to some expected value […]