Archive of

网友语录 - 第32期 - 注意力是宝贵的,造谣不值得看,段子也没那么值得看

这里记录我的一周分享,通常在周六发布。


米福根 讨好,融洽,满足期待非常耗能,也是我不甘去做的。但是怎么能在社会关系中避开形形色色的耗能陷阱呢?

我有一个经验是:雪中送炭时出把力,就可以对锦上添花的事说不了。毕竟雪中送炭不经常发生,而锦上添花是没完没了的。

前两天我突然被组长拎进一个危机会议,察言观色一番后,觉得虽然不关我的事,还是需要帮自己组说两句话。那时嘴里还嚼着口香糖,只好先关了摄像头,拿走口香糖,整理表情,再打开摄像头,举手发言。

散会后组长过来:你的发言很好,下个月他们来访,你晚上一起参加饭局吧?

我斩钉截铁地:不去。


#laugh 洋鸟消夏录 人的头颅里可能有一座水库,以我的鼻涕推测。


泽林 每次在湖边看落日的时候都会重新思考住在看不到落日的地方是值得为现在的人生支付的代价吗。

image

“生活方便”这个咒语困住了我


泽林 落日不稀奇嘛,稀奇的是随性所至就可以悠闲地看到的落日呀。


闻不闻于生灭之际 这个孩子跟艾文不一样,艾文有大把和自然在一起的时间,这个孩子没有。与自然在一起就是生命力和创造力的来源


Journalism 101: "If someone says it's raining & another person says it's dry, it's not your job to quote them both. Your job is to look out the fucking window and find out which is true."


Journalism is printing what someone else does not want printed. Everything else is public relations.

-- George Orwell


接触是消除偏见的最好方法。


steedhorse 只有知识能把知识串起来,坚持学习不会变笨。


如月中天 @[email protected] ... 注意力是宝贵的,造谣不值得看,段子也没那么值得看。

…more

Useful Oracle SQL syntax features for column updates

  1. Multiple Column Updates using IN clause:
UPDATE table_name
SET (col1, col2, col3) = 
    (SELECT val1, val2, val3 FROM source_table WHERE condition)
WHERE condition;
  1. MERGE statement for conditional updates/inserts:
MERGE INTO target_table t
USING source_table s
ON (t.key = s.key)
WHEN MATCHED THEN
    UPDATE SET t.col1 = s.col1, t.col2 = s.col2
WHEN NOT MATCHED THEN
    INSERT (col1, col2) VALUES (s.col1, s.col2);
  1. Using DEFAULT values in updates:
UPDATE employees
SET (salary, commission) = (DEFAULT, DEFAULT)
WHERE department_id = 90;
  1. Updating with RETURNING clause to get modified values:
UPDATE employees
SET salary = salary * 1.1
WHERE department_id = 20
RETURNING employee_id, salary INTO :emp_id, :new_salary;
  1. Using row constructor expression:
UPDATE table_name
SET (col1, col2) = (SELECT * FROM (VALUES (val1, val2)));
  1. Conditional updates using CASE:
UPDATE employees
SET salary = CASE 
    WHEN department_id = 10 THEN salary * 1.1
    WHEN department_id = 20 THEN salary * 1.2
    ELSE salary
END;
  1. Using WITH clause (Common Table Expression) in updates:
WITH avg_sal AS (
    SELECT dept_id, AVG(salary) avg_salary
    FROM employees
    GROUP BY dept_id
)
UPDATE employees e
SET salary = (
    SELECT a.avg_salary 
    FROM avg_sal a 
    WHERE e.dept_id = a.dept_id
)
WHERE condition;

These syntaxes are particularly useful when:

  • You need to update multiple columns at once
  • The update values come from another table or subquery
  • You want to perform conditional updates
  • You need to track what was updated
  • You're dealing with complex data transformations

Remember that while these features provide more elegant solutions, it's important to:

  1. Test performance with your specific data volumes
  2. Ensure the business logic is clear to other developers
  3. Consider maintainability of the code
  4. Check if indexes are being used effectively

Update your flutter app icons with a custom one

1. Prepare Your Icon Image

  • Create a square PNG image (preferably 1024x1024 pixels) for best quality

2. Use the flutter_launcher_icons Package

Add the package to your pubspec.yaml:

flutter pub add flutter_launcher_icons

3. Configure the Icons

Add this configuration to your pubspec.yaml file:

flutter_launcher_icons:
  android: true
  ios: true
  remove_alpha_ios: true
  image_path: "assets/icon/app_icon.png"  # Path to your icon image
  adaptive_icon_background: "#FFFFFF"  # For Android adaptive icons (optional)

4. Run the Package

Run this command in your terminal:

flutter pub get
dart run flutter_launcher_icons

done!

网友语录 - 第31期 - 想要的东西要争取,不想要的东西要拒绝,感到不爽的事情要反击

这里记录我的一周分享,通常在周六发布。


为什么敢一直挑衅你?因为你一直表现的很软蛋。国家外交如此,个人交往也是。不要老拿实力当借口,当没有决心时,有实力也等于没实力


成功者因它成功,失败者因它失败。它是谁?它是你的习惯


mtfront 今天和朋友聊到了一些传统行业的人觉得厌班的一个原因是工作太 repetitive。只在科技行业干过的我确实完全没有意识到自己确实每天都在处理新的 challenge ,完全不会觉得工作 repetitive 这件事(厌班有别的理由)。

之前一直觉得科技行业不配 getting paid this much,因为做的东西也就是一些草台班子糊弄根本不高级没什么技术含量。但压根没想过可能很多别的工作真的是非常机械重复。从处理新的 challenge 这个角度来看,或许可能 maybe 这些草台班子 bullshit job 里还是有一丝丝含金量的?(not saying it's worth the pay though)

(很多解决方案不需要高级技术一样能甚至更好的解决用户的痛点。有价值的是解决方案不是科技含量。传统行业单调重复的解决方案很可能是不怕苦不怕累的机器人,但那个解决方案会直接导致大量工人失业,会更痛。是坏事也是好事。因为它会逼迫失业的人另找出路,而有些出路的结果会很好。)


郑芝麻『世界就是这样。哭什么呢,举杯吧各位!』 奥斯卡最佳女配得主尹汝贞说。

她的嗓音粗哑,问她是否被人嘲笑过?。 她说:“有过,但他们现在都去世了。那些嘲笑你的人迟早会挂的,又何必在意?!!”


Advice from a tree

  • Stand tall and proud
  • Go out on a limb
  • Remember your roots
  • Drink plenty of water
  • Be content with your natural beauty
  • Enjoy the view
…more

Introducing changesummary: A Git Change Summary Script

The changesummary script is a powerful tool for developers to quickly understand the key changes made between two Git commits. It leverages AI to analyze the diff and provide a concise summary of the modifications.

Functionality

The script takes one or two arguments: the start commit hash and an optional end commit hash. If the end commit hash is not provided, it defaults to HEAD.

Usage

To use changesummary, simply run it in your Git Bash terminal:

./changesummary <start_commit_hash> [<end_commit_hash>]

Example

./changesummary abc123 def456

Result:

The key changes between the specified commit hashes are:

* Renamed `TrmWithRiaSettlementPricingTask` to `TrmWithRiaDetailsPricingTask` and refactored its logic into a base class `TrmConfigPricingTaskBase`.
* Removed `RiaRawRateDataDecorator` and updated `TrmWithRiaDetailsPricingTask` to use `RiaRate` instead of `RiaRawRate`.
* Updated the `RequiredData` enum to remove `RiaRawRate` and updated the `TrmWithRiaDetailsPricingTask` to require `RiaRate`.
* Updated error codes and messages to reflect the changes.

These changes simplify the pricing task logic and improve maintainability.

Benefits

  • Provides a quick and meaningful summary of changes, saving time during code reviews.
  • Helps in understanding the impact of changes made between commits.
  • Easy to integrate into existing Git workflows.
  • Flexible comparison range with optional end commit hash.

By using changesummary, developers can streamline their code review process and focus on the most important changes.

here's the source code:

#!/bin/bash

# Check if commit hash is provided
if [ -z "$1" ]; then
    echo "Error: Commit hash is required as an argument."
    exit 1
fi

convert_to_uppercase() {
    # Enable case-insensitive matching
    shopt -s nocasematch
    
    if [[ $1 =~ ^(HEAD|FETCH_HEAD|ORIG_HEAD|MERGE_HEAD)(\~[0-9]+|\^[0-9]*)* ]]; then
        # Convert to uppercase
        echo "${1^^}"
    else
        # Return original string
        echo "$1"
    fi
    
    # Reset case-sensitivity to default
    shopt -u nocasematch
}

start_hash=$(convert_to_uppercase "$1")
end_hash=$(convert_to_uppercase "${2:-HEAD}")

# Define static prompt text
static_prompt=$(cat <<-END
Analyze the following code diff. Generate a concise summary (under 100 words) of the **key changes** made between the specified commit hashes. Present the changes in a bullet-point list format, focusing on the main modifications and their impact.
Code changes:
END
)

# Define model and system message variables
model="meta-llama/llama-4-maverick:free"
system_message="You are a programmer"

# Execute git diff and pipe its output to the AI model
git diff -w -b $start_hash..$end_hash | jq -R -s --arg model "$model" --arg system_content "$system_message" --arg static_prompt "$static_prompt" \
    '{
        model: $model,
        messages: [
            {role: "system", content: $system_content},
            {role: "user", content: ($static_prompt + .) }
        ],
        max_tokens: 16384,
        temperature: 0
    }' | curl -s --request POST \
        --url https://openrouter.ai/api/v1/chat/completions \
        --header "Authorization: Bearer $OR_FOR_CI_API_KEY" \
        --header "Content-Type: application/json" \
        --data-binary @- | jq -r '.choices[0].message.content'