Thoughts on the fading away of the age of IE

2023-07-22 software industry
Nowadays, as it pleased most frontend engineers, making web pages/applications compatible with IE Browser is not required almost everywhere. Internet Explorer, especially the lower versions, is inconsistent with W3C standards, barely has developer toolchains, and therefore very hard to debug. But the anti-modern frontend legacy browsers didn’t easily die. If you had checked browser distribution in recent years, you would notice that IE always had a reasonable proportion, not much, but also not in a trend towards zero in a short period. Continue reading

The curious cases of json_extract

2020-04-25
json_extract is a function for extract data from a JSON document both in MySQL and MariaDB. The function normally works fine, for example set @j = '{"num": 42, "list": [1, 2, 3], "obj": {"name": "Edward Stark"}}'; select json_extract(@j, '$.num') as num, json_extract(@j, '$.list') as list, json_extract(@j, '$.obj') as obj; +------+-----------+--------------------------+ | num | list | obj | +------+-----------+--------------------------+ | 42 | [1, 2, 3] | {"name": "Edward Stark"} | +------+-----------+--------------------------+ But when it comes to a single JSON string, the results of json_extract is not always as expected. Continue reading

Contextvars and Thread local

2019-04-12
Here in the post, I will share some examples about the contextvars (new in Python 3.7) and thread local. Default Value In the module level, use ContextVar.set or directly setattr for a thread local variable, won’t successfully set a default value, the value set won’t take effect in another thread. To ensure a default value, for contextvars import contextvars context_var = contextvars.ContextVar("context_var", default=0) for thread local, a sub class of thread. Continue reading

The Tiny Chips from Chinese Hackers: When Falsifiability meets Public Perception

2018-10-28 technique
During the 2018 Chinese National Day Holidays, Bloomberg Business Week reported that Chinese hackers planted microchips into motherboards supplying for data center servers of tech giants Apple and Amazon. The original Bloomberg post is available at https://www.bloomberg.com/news/features/2018-10-04/the-big-hack-how-china-used-a-tiny-chip-to-infiltrate-america-s-top-companies, and Amazon, Apple, Super Micro and the Chinese Government all have denied the hack. As I followed the related posts, I found despite there may(or may not) be a hack on the motherboard chips, surely the event happening and growing is a big hack on the public perception. Continue reading

The Ponzi Software Development Scheme

The metaphor Ponzi Software Development Scheme, came to me after I have been read about a post from CACM, The Death of Big Software. The traditional big softwares will die away, because they are easily growing to become too hard to maintain, and will be replaced by cloud or microservices architecture based softwares. But will cloud or microservices save big software projects from failure? I rather say, no silver bullets, neither cloud nor microservices. Continue reading

Mongodb(via MongoEngine) join query with aggregate

2017-01-09
Since Mongodb 3.2 and MongoEngine 0.9, we can use $aggregate command to perform join queries on multiple collections in a database. This post would be a simple tutorial for join queries on Mongodb(via MongoEngine in Python) with examples. Models Setup Let’s consider models defined as below: import random import mongoengine class User(mongoengine.Document): meta = {"indexes": ['rnd']} name = mongoengine.StringField() rnd = mongoengine.FloatField(default=random.random) class Group(mongoengine.Document): meta = {"indexes": ['rnd']} name = mongoengine. Continue reading
Newer posts