Category Archives: /dev/null

Isekai

After three and a half months work, I finally resigned so that I can have some break. Reviewing this period, I found it boring and plain for the most of the time. Although occasionally eating outside or having a voice call online with friends, I spent the rest of my time alone, wondering if this is how life would be in the following 10 or 20 years, or would it last to the final end?

One of my friend on Facebook recommended a comedy anime, KonoSuba (この素晴らしい世界に祝福を!), to me. And it indeed is an amazing comedy. But meanwhile, I somehow felt more depressed.

The main character, Satou Kazuma, was a neet and otaku, dead less than 80 seconds in the anime, thus he entered a different world (isekai, 異世界) beginning his adventure journey mainly with other 3 girls. They became really good friends and Kazuma fell in love with Megumin afterwards.

There are also some other anime featuring afterworlds as its story's background, such as Angel Beats and Zombie Land Saga. And I think the main characters in these stories share something in common: they didn't have a happy nor even normal life when they were alive, or encountered unexpected accidents and had some pities when they passed away. But the most attractive thing for me is that, they have a better life with great friends in isekai. They can hangout with friends and meet up each other on a daily basis, in contrast with the highly likely lonely life in my next many years.

So in my perspective, it can't be more wonderful if such isekai exists. Yet knowing that they are all fiction worlds makes me feel depressed in someway. And in reality, if one passes away, then they physically no longer exists. Even if there is something like reincarnation, one cannot possibly remember anything from their former life. (What about cyborg? That can be an entirely different topic though. I once wrote some of my thought about it. I, self, mind, immortality and death)

Arduino 的小板子 PORTENTA H7

这两天 Arduino 出了一个新的小型嵌入式开发板,Portenta H7 https://store.arduino.cc/usa/portenta-h7

性能上的话,CPU 是一个 Cortex M7@480MHz + Cortex M4@240MHz ,两个核心用 RPC 机制通信,可以跑 MicroPython / JavaScript,还有 TensorFlow Lite

个人觉得亮点 1) 是有双频 Wi-Fi(虽然最大速率只有 65Mbps),可以当成 AP / STA,这样一来的话,2.4GHz 和 5GHz 的 Wi-Fi 抓包和嗅探应该是可以了。

亮点 2) 的话就是终于可以直接用 Type C 了,并且还支持 DisplayPort。

最后亮点 3) 就是 Portenta 系列会有 2 个 80 pin 的高密度连接口,扩展性似乎比以前我用过的 Arduino 系的板子的好不少。

不过 $99 的基础款只有 2MB 内存,16MB 的 NOR Flash 存储空间。官网上倒是说最大可以配置 64 MB 的内存和 128 MB 的 QSPI Flash,不过并没有给价格。

就算是这样,99 美元也蛮贵的了,完全可以买一个 Raspberry Pi 4 Model B 4GB 版了,当然,tradeoff 就是 Raspberry Pi 相对而言没有这么小。这个怎么选就看使用场景了

略有一点点种草,要是什么时候有闲钱和时间倒是想试试看这个

Ex Machina 「机械姬」里的小彩蛋

今天在 Netflix 上看了 Ex Machina 「机械姬」这部电影,又是一部与强人工智能「Artificial General Intelligence」相关联、讨论 Consciousness, Self-awarenesses, Mind, Embodiedment 的电影~

话说自从跟着玲做了某项目之后,貌似看到的电影几乎都是关于这些的(((o(*゚▽゚*)o))),仿佛打开了新世界的大门!

不过这篇 post 只是先记录一下在电影中看到的小彩蛋~

当男主 Caleb 决定救出 Ava 的时候,Caleb 拿了 Nathan 的门禁卡去修稿安保程序,然而开了电脑之后却开始拿 Python 3 输入 Sieve of Eratosthenes 算法!(不是,Celeb 你想去救 Ava 我懂,但是你偷了 Nathan 的卡打开了电脑,就是为了拿 Python 写个 Sieve of Eratosthenes 算法求质数吗╮( ̄▽ ̄"")╭

不过蛮好奇有什么输出,于是我等着 Caleb 输入完之后,我照着敲了一遍~代码如下(^O^)

Continue reading Ex Machina 「机械姬」里的小彩蛋

站名牌產生器(((o(*゚▽゚*)o)))

這個站名牌產生器算是超久之前寫的程式了,站名牌的樣式仿自 http://data.but.tw/eki/。在那個網站上還有超多別的城市的地鐵站名牌,然而這個網站並不能生成 SVG 格式的向量圖,其生成的圖片在清晰度上也有所欠缺,於是我就仿照著其中 6 個站名牌做了一點微小的工作~

雖然並不是鐵道廚,但是有些站名牌的確還蠻好看的,於是就做了一個 macOS 下可以生成站名牌 SVG 向量圖,以及可以儲存成縮放任意倍數 PNG 圖片的程式~要是有誰想改成網頁版的話,那就更好了233333

程式碼的話就在這裡啦 ➜ #/eki

下面再放幾張生成好的圖片吧~

Continue reading 站名牌產生器(((o(*゚▽゚*)o)))

A Simple Approach to Add Invisible Watermark with OpenCV

摸鱼摸鱼,今天试试用简单的频域隐写水印~

其实隐写水印的方法也有不少了,这里是其中一个简单的方法,使用的是离散傅立叶变换,相比起小波变换的版本,这里的鲁棒性没有那么强,但也还是挺好玩的,下次有时间可以试试看小波变换的方法233333

在频域增加水印的好处是肉眼不易看见,而且对于一般的裁剪、拉伸、涂抹有较强的抵抗性~比如下面的图像就加上隐写的水印,但是与左侧的原图几乎没有视觉上的差异。

在将两张图转换到频域上之后,则一眼能看到右侧图上的水印~

Continue reading A Simple Approach to Add Invisible Watermark with OpenCV

Add Image Zoom In/Out Feature with medium-zoom.js

啊,这篇 post 大概是个笔记~

其实很久之前就想把放大缩小图片的功能加到博客上来的,然而一直以来都在摸鱼,前段时间帮玲做了一个摄影的的博客,于是就正好找找看有没有合适又好用的 JS 项目

在一番搜索和试用 Demo 之后,只有 https://github.com/francoischalifour/medium-zoom 最符合需求,同时使用起来非常便利,几行代码就可以给博客加上图片放大缩小的功能

Continue reading Add Image Zoom In/Out Feature with medium-zoom.js

Moving to WebP Image with Fallback to PNG

Currently, I'm writing my notes of Rust learning, and it usually comes with many screenshots even in a single post. Though PNG file could serve the original / or best quality, the size of which is considerably large. So it takes a few seconds to load despite using Cloudflare CDN.

WebP has been released years ago by Google, and I'd considered that before. However, in the early days, it only works in Google Chrome. Lacking support in other mainstream browsers was a main barrier for me to adopt it.

And now many browsers support WebP image, and WebP format has also been updated in these years. It could serve nearly the original quality but half or even sometimes less than one third the size of corresponding PNG file.

Yet it's surprised to me that Safari hasn't adopted WebP format, which means I have to provide a fallback. Well then, given that I'm also planning to speed up page load by deferring images, the extra thing would be checking WebP support.

Continue reading Moving to WebP Image with Fallback to PNG

Magic Image(3)——Implementation in Python3 with Either OpenCV3 or PIL

It has been 3 years since the last update on Magic Image, https://await.moe/2016/09/magic-image2-mathematical-model/, which talked about the mathematical model of creating the mix image.

And to be honest, the Python implementation actually wrote 4 months ago, but it only support OpenCV then. And today, out of personal interest, I added PIL support. Now it could run with PIL only. (But if it detects the existence of OpenCV, that would be preferred)

Continue reading Magic Image(3)——Implementation in Python3 with Either OpenCV3 or PIL