Archive of

旧文搬运:《吴法宪回忆录-岁月艰难》读后

这篇博文是(2011年)从新浪博客迁过来的。新浪的编辑还有点人味,这篇没有彻底给删掉,给搁回收站了。转到这儿,看看点点是不是开明一点。

这本书是阮一峰在他的2010年终总结博客里推荐的。

读这本书之前,我对吴法宪的了解仅限于以往看到听到的一些官方说法,四人帮的帮凶什么的。对这本书一开始也没大重视,一个大老粗,文字能好到哪里去呢?不过既然阮一峰会推荐,这书肯定有可取之处。

本着看闲书的态度找到这本书的电子版,扔到kindle里,准备有一搭没一搭的看。

这书篇幅挺大,有八十余万字。一周前开了头,看了十来页,我就知道这本书我一定会全部读完了。

…more

旧文搬运:我的电子书

本文最初发表在今天已经死掉的点点博客。

我的第一个移动读书设备是黑莓8310。在那小小的屏幕上我读完了厚厚的一本《代码大全》。

后来买了吹的牛哄哄的号称读PDF多好多好的歌美S6000。屁,操作之慢让我忍不住想起我那只扔在一边的N73手机,阅读时间短不说,电量指示还超不准。读着读着,不定啥时候突然就没电了。

扔一边了,真可惜了8个G的容量。

然后就买了kindle3。刷了多看系统,这次看PDF真的爽了。更爽的是待机时间,充一次电能看两个礼拜。老早就听说这玩意屏不结实,所以入手大半年来,一直小心着小心着,生怕它那脆弱的小屏坏掉。然而,前几天悲剧还是发生了:要和儿子出去玩,我把kindle装包里,包跨在我胳膊上。我为了帮他找鞋子就趴在地上往沙发底下瞧,鞋子是找到了,可起身才发现包在我膝盖底下。啊呀呀,叫也没用,kindle3屏幕果然坏掉。在等待换屏的日子里,顺理成章儿子的iPAD成了暂时的替代。

原来iPAD也是看书利器。虽然最初沉甸甸地,好象有点受不了。可连着带了几天之后发现竟然有些适应了。反应敏捷,操控一流,彩色,大屏,十几小时的阅读时间,除了一点点反光让人稍微不爽,在习惯了iPAD的重量之后,我竟然有些爱不释手了。

要不要就此让那个kindle3成为往事?嗯,这事儿我看行。

2011/06/20

One day or day one. It is your decision

我想为我的 One Day Telegram 频道找一个合适在头像, 东搜西搜, 发现了这样一句格言:

One day or day one. It is your decision. 或者说 One day or day one. You decide.

这里 One day 指将来某天,暗示一种不确定的等待或者拖延。有一天我会做,等条件成熟了我就做。而 day one 指采取行动的第一天,意味着立即开始,不再等待。

选择权在你,是明日复明日,还是择日不如撞日,今天就开始行动。 愿大家都成为“今天就开始行动”一族。

[solution] mcr.microsoft.com/dotnet/aspnet:8.0-alpine couldn't recognize windows time zone ID

ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT false
RUN apk add --no-cache icu-libs tzdata

Reference

By the way, my devops colleague told me if you can, changing the windows time zone id with its standard equivalent is the more preferred way. He said "its not good to set that environment variable to false"

How to Skip a Collection Run in Postman Based on Response Conditions

When working with Postman to automate API testing, you might encounter scenarios where you want to conditionally skip the execution of subsequent requests in a collection. This can be useful if a certain condition isn't met in your API responses. Here's a guide on how to achieve this using Postman's scripting capabilities.

Scenario

Imagine you have a collection where the first request returns a response like this:

{
    "content": "True",
    "statusCode": 200,
    "message": "Global value got from DbConfig!"
}

You want to skip all subsequent requests if the content field is "False".

Step-by-Step Guide

  1. Set Up Your Collection: Ensure your collection is organized with the request you want to evaluate placed at the beginning.

  2. Write a Post-Request Script: In the test script section of the first request, you'll write a script to check the content field and decide whether to continue the collection run.

    // Parse the response
    let response = pm.response.json();
    
    // Check the content value
    if (response.content === "False") {
        pm.execution.setNextRequest(null); // Skip the remaining requests
    }
    

    This script checks if the content is "False". If it is, pm.setNextRequest(null) stops all subsequent requests from running.

  3. Test the Flow: Run your collection to see the logic in action. If the condition is met (i.e., content is "False"), the collection run will halt after the first request.

Explanation

  • pm.response.json(): This method parses the JSON response from your request.
  • pm.setNextRequest(null): This function is used to stop further requests in the collection run. If the condition isn't met, the collection continues with all remaining requests in their original order.

Benefits

  • Efficiency: Avoid unnecessary API calls when certain conditions aren’t met, saving time and resources.
  • Control: Gain greater control over your testing workflows by dynamically determining execution paths.

Conclusion

Using pm.execution.setNextRequest(null) in a test script provides a straightforward way to control the flow of your Postman collection runs based on specific conditions in your API responses. This technique can be a powerful tool in optimizing your automated testing processes.

Feel free to customize the logic to fit your specific needs!