yihong0618 和朋友们的频道
- Підписники
- Перегляди допису
- ER - коефіцієнт залучення
Триває завантаження даних...
Триває завантаження даних...
在上海花12块就能给一个男人带来快乐,打工人的快乐很简单, 视频播放量 1629218、弹幕量 2443、点赞数 132131、投硬币枚数 70636、收藏人数 12901、转发人数 3106, 视频作者 小岳来了24, 作者简介 好好生活,好好活着,相关视频:上海出租房里,43块带你体验打工人下班最真实的快乐,哨塔森林,防火木墙,战壕推进!这场游牧将化为镀金城市!【帝国时代4】,在魔都上海,花35块带你感受打工人最真实的快乐,[MV]河南说唱之神-工厂,再氪7万硬刚土豪战无双!挑战霸服咸鱼之王2.0!,有关于我入职后睡了一觉惊动了集团高层(上篇),62块让这个不当舔狗的男人快乐了一整晚,月赚19800,一分不攒就是花,100块让这个男人快乐了一整晚,年轻那会哪有这个待遇!,今晚宵夜 一盘酱牛肉配上白酒,男人的快乐就是这么简单
-, 视频播放量 390447、弹幕量 3031、点赞数 24975、投硬币枚数 9070、收藏人数 2607、转发人数 1906, 视频作者 导演小策, 作者简介 作品:《广场往事》《朱一旦的枯燥生活》(1-229集)《C座802》(截止到无旦道) 《马小策梦游系列》 ,相关视频:【朱一旦】181 我的编剧跑路了,不要“做”挑战?(第十八期),恋爱7年 迎来了新篇章,有能力的人有权享受世界,[MV]河南说唱之神-工厂,怎么第一巡按钮就亮了?,回村三天,二舅治好了我的精神内耗,【MSI准时哔哔】BLG vs PSG 定时发送,一刀不剪!,最佳拍档!,发现肚脐眼了嘛? 今天穿凉鞋还涂了粉粉的脚指甲哦~
One of my colleagues, @ninoseki san, designed and implemented the VSCode extension module to manage Python dependencies. It is an OSS project!
https://t.co/JWHSsmIaNQCheck it out :)
推荐个书:《思想本质》,但我更喜欢副标题:《语言是洞察人类天性之窗》 平克四部曲之一。禁忌语的使用,在传播中的作用
Streamed Live on Twitch:
https://twitch.tv/tsodingPanim Playlist:
https://www.youtube.com/playlist?list=PLpM-Dvs8t0VYH2HouIXMjFFuz7G1FrXiBReferences: - 3Blue1Brown Channel:
https://www.youtube.com/3blue1brown- Tsoding - Musializer -
https://github.com/tsoding/musializer- Tsoding - Tula -
https://github.com/tsoding/tula- Easings -
https://easings.net/Support: - BTC: bc1qj820dmeazpeq5pjn89mlh9lhws7ghs9v34x9v9 - Pay for my VPS:
https://zap-hosting.com/en/shop/donation/2038e94867b5e65cab2e72abf8ad956c/data-
attributes like this:
<a
data-pswp-height="3024"
data-pswp-width="4032"
href="https://niche-museums.imgix.net/pioneer-history-19.jpeg?w=1200&auto=compress"
class="gallery-photo">
<img
src="https://niche-museums.imgix.net/pioneer-history-19.jpeg?w=400&blur=200&px=16&auto=format">
</a>
My database was only storing the URL to those images, not their widths and heights. In order to generate the correct HTML I needed that extra information.
Niche Museums hosts photos in an S3 bucket behind Imgix, which means I can resize the photos on demand using the ?w=
and ?h=
query parameters.
It also means I can get back JSON for the EXIF data of the images by appending ?fm=json
.
https://niche-museums.imgix.net/pioneer-history-18.jpeg?fm=json
There's a lot of information in there, but the most important bits for solving this problem are:
{
"Orientation": 3,
"PixelWidth": 4032,
"PixelHeight": 3024
}
For my first attempt, I assumed that PixelWidth
and PixelHeight
represented the width and height of the image, respectively.
This almost worked... except for some photos which were displayed in portrait mode, for which the two values appeared to be swapped.
The answer turned out to be in the Orientation
parameter. GPT-4 helped me understand the following:
The values you mentioned (1, 3, 6, and 8) represent the most common orientations: ⦁ 1: Normal (0° rotation) ⦁ 3: Upside-down (180° rotation) ⦁ 6: Rotated 90° counterclockwise (270° clockwise) ⦁ 8: Rotated 90° clockwise (270° counterclockwise)So I need to flip the width and height values if the orientation is 6 or 8. I ended up doing that using this SQL query:
select
'https://niche-museums.imgix.net/' || filename as url,
case
when Orientation in (6, 8) then PixelHeight
else PixelWidth
end as width,
case
when Orientation in (6, 8) then PixelWidth
else PixelHeight
end as height
from raw_photos;
✏️ That raw_photos table
I skipped a step here: how did I load the data into that raw_photos
table in the first place?
First I wrote a Python script to retrieve the JSON metadata for every photo. This dumped them into a photos-metadata/, each one with a name like IMG_0859.jpeg.json
.
That script now runs in GitHub to catch metadata for newly added photos - a form of Git scraping.
Next, I wrote a sqlite-utils to load all of those JSON files into my SQLite database. That script also creates a photos
view that implements the above case
SQL logic.
I initially wrote this as a shell script, but it was a LOT slower than doing it in Python:
for json_file in photos-metadata/*.json; do
sqlite-utils insert browse.db raw_photos \
--pk=filename \
--replace \
--alter \
--
醉后不知天在水,满船清梦压星河