Enable PHP8.2 Jit on Ubuntu

With the realease of PHP 8, Just-In-Time compilation (JIT) has been supported. However JIT is not enabled by default. So this post will talk about how to enable JIT with PHP 8.2.

After install PHP, we have the version of 8.2 like this:

PHP 8.2

Next, install the opcache extension by:

1
2
sudo apt update -y
sudo apt install php8.2-opcache

Then, to enable JIT, i was expecting that the configuration of JIT was also in the php.ini. I change it as below:

1
2
3
4
5
6
7
8
$ sudo vim /etc/php/8.2/fpm/php.ini

...
[opcache]
opcache.enable=1
opcache.jit=1255
opcache.jit_buffer_size=100M
...

Read More

计算机视觉(3)计算机中的颜色表示

前面的文章:

RGB

RGB格式是图像处理时使用最广泛的一种格式,它是一种基于亮度混合的additive colour model。关于RGB,有一个叫Tri-stimulus的实验,一个人坐在黑色的房间里,面前的桌子上方有带有特定颜色的纸,先用白光照在纸上观察,接着再改用红、绿、蓝三色光同时照在纸上观察,会发现纸的颜色变了。RGB颜色通常用3个8位的数值表示,范围是0-255。

Read More

Learn Prolog

Recently, I got in touch with the Prolog in my coursework (EEEM0005). It is not easy! Prolog is a very old programming language which I only see it in the TIOBE programming language rank (a boring index), but I was attracted by its simple structure and strange programming grammar at begining.

1
2
3
4
5
6
parent(pam, bob).
parent(tom, bob).
parent(tom, liz).
parent(bob, pat).
parent(bob, ann).
parent(pat, jim).

Above all six facts (also called clauses) represent a parent relationship:

Read More

记一次在Lloyds银行存钱的奇葩经历

一大早骑车去Lloyds银行存钱,本想着能很快搞定,结果钱被ATM“吃”了,也算是一次特殊的经历~

Lloyds银行ATM存钱一次最多只能50张,不管什么面值。今天存钱带了100张5英镑,也没有提前分成2份,存的时候我直接拿出一半塞了进去,结果机子出问题,提示机子出了问题无法识别我的钱,让我联系工作人员。我之前存超出的钱直接吐出来了,这次结果机子出问题。工作人员过来说我塞的钱超过50张了,让我等一会,她去叫同事开机子把钱拿出来。

这个同事等级应该比较高,需要她输入密码。之后,她过去把银行入口处的大门给关了,想出去的人无法出去,我想这是为了防止钱被抢了,不让人跑,整个过程大概持续了5分钟(一个人也别想跑,嘿嘿嘿)。

钱取出来后,工作人员让我去柜台办理,当时排队的人也少,很快就轮到我了。柜台办理和国内有些不同,这边像刷卡消费一样,插入POS机输入PIN码,之后就可以把卡收起来了,然后把要存的钱给他,拿到收据走人。办理流程也就3分钟。哈哈,以后直接去柜台了。最后给工作人员点个赞。