摘抄 思念

创建时间:2010年10月4日(星期一) 晚上9:41

 

最是那春雨迷蒙,最是那秋雨缠绵,往往是最思念的时候。
最是那清风习习,最是那雪花纷飞,往往是最思念的时候。
思念常常像一根银色丝线。因某个场景,某句诗词,或一曲悠扬的音乐,都能偶然地不经意地触动那根思念的神经。于是,思念就如丝线一样丝丝缕缕,绵绵不绝地从内心深处缓缓抽出,斩也斩不断,理也理不清。
思念故乡耀眼的菜花黄,夺目的桃花红,明净的梨花白;还有那笔直的白杨,飞扬的柳絮,翩跹的蝴蝶。
翻开相册,读着留言,最是思念远方的朋友。思念校园里朗朗书声,思念操场上跑步的影子,思念我们借着月光偷摘苹果时的惶恐,思念我们踏雪觅春时的浪漫,思念诗林词苑的唐风宋雨,思念醉倒在数理化中的五彩迷雾。思念那时的我们激情昂扬地谈论人生,虽天真却不乏清浅的哲理,我们敬仰古往今来的英雄豪杰,崇尚风流倜傥、风花雪月的骚人墨客,我们幻想着爱情的浪漫与纯洁,天长与地久。
离家的时候很是想家。想家的温暖,想家里小米饭诱人的清香,想父母的白发和絮叨,想爱人的挚爱和抚慰,想孩子的可爱与天真,想他们是否吃好了睡香了。
没有了亲人和朋友的信息,很是思念。无奈之余,我求佛,求佛保佑他们平平安安,保佑他们万事都舒心顺意。愿我的祝福能为他们添香,能为他们送去福音。
无风的时候思念风,无花的时候思念花,无雪的时候思念雪,无月的时候思念月,无雨的时候思念雨。思念小桥流水,思念大漠孤烟;思念浩瀚大海,思念涓涓小溪;思念那座城市里的人文和气息,还有那一草、一木、一人。
思念,深藏在内心最静谧的角落。在寂寞的长夜,在辗转反侧的时候,悄悄地轻轻盈盈地拨动了那根思念的琴弦,哀哀怨怨,凄凄婉婉,或激昂或低沉,那种喜悦和苦涩,只有深深思念的人才能体会得到。思念是遥望“征鸿飞过,万千心事难寄”的无奈;是“望断斜阳人不见,满袖嘀红”的凄怆悲绪,不知天涯君知否?思念是“此物最相思,愿君多采撷”的红豆情结。
思念最怕繁星闪烁、皓月当空;最怕雨打梧桐、风吹窗棂;最怕伤感的音乐划过心头,留下斑驳的酸酸涩涩和丝丝隐痛。此时,你看炊烟不升、彩云不游、桃花不开、蝴蝶不飞,满眼尽是萧瑟的凄风和苦雨,麻木地敲打着冰冷的门窗。
思念如潮水,悄然漫过胸口,湿润着心房和眼眸;思念如带雨的花瓣,在湿漉漉的心房里绽放着清香和甘甜;思念如洞箫之暗哑,吹响声声悲切,使人泪眼滂沱;思念如丝织的春雨、如夏日的清风、如静美的秋叶、如飘逸的雪花;思念如萋萋芳草,“野火烧不尽,春风吹又生”;思念如杜鹃嘀血:“不如归去,不如归去”;思念如忧愁的宋词:“花自飘零水自流,一种相思,两处闲愁。此情无计可消除,才下眉头,却上心头。”
思念至亲至爱的人是幸福的,被至亲至爱的人思念也是幸福的。那“此时无声胜有声”的思念,像袅袅轻烟飘到千里之外的思念人的心里,便会产生“心有灵犀一点通”的默契。这时,你便是世上最幸福的人了。
思念是一种情感的浓缩,是爱情、友情、亲情牵挂的浓缩,是被想念、依恋、相思提炼而凝结成的精华思绪。它痛苦着酸涩着、幸福着愉悦着思念和被思念的人。
现在,面对浅浅笑靥的弯弯月儿,面对惶惶惚惚闪烁着梦幻一般的橘黄色灯光,我不想掩饰我思念的心绪。我在思念远方的友人,你可否也在月色下散步、灯光下翻书?可否也如我思念你一样而在思念我呢?

Unlock Bell’s Carrier Lock on iPhone

For “SIM Not Supported Error” when using a SIM card other than Bell/Virgin Mobile

 

Send you device purchase agreement to

[email protected]

Their process time is usually 10-60 minutes.

 

Customer service can’t really handle this.

Yes, there’s no lock after 2018, but the store usually lock their expensive iPhone models and unlock the carrier for you after the purchase. They do forget about the unlocking step quite often.

Disable mouse zooming in Firefox

Why?

The scroll wheel on my MX master 3 doesn’t really work well with MacOS. Zooming is triggered by mistake quite often.

Windows:

  • about:config
  • mousewheel.with_control.action
  • change the value to 1

Reference: https://support.mozilla.org/bm/questions/1253302

OSX

  • about:config
  • mousewheel.with_meta.action
  • change the value to 1

In MacOS, meta key is the Command key. (Source)

The value 0 means “Do nothing”, 1 means “Scroll contents”, 2 means “Go back or forward in the history”, 3 means “Zoom in or out the contents”

More Info about the config

 

Enable MySQL/MariaDB SSL for PDO/Laravel

Server side setup

Refer to this manual from MariaDB
https://mariadb.com/kb/en/securing-connections-for-client-and-server/

require_secure_transport = ON could be added to the my.cnf file to enforece SSL for all connections (including those from localhost & unix socket)

One way SSL

Without CA verification

PDO

$pdo = new PDO('mysql:host=db.example.com;dbname=image', 'laravel', 'laravel',array(
    PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => false));

Laravel (config/database.php)

// under mysql => options
'options' => extension_loaded('pdo_mysql') ? [
        PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => false
 ] : []

PLEASE NOTE: array_filter in this original config file is REMOVED. Because entries with empty() value will be filtered, so that MYSQL_ATTR_SSL_VERIFY_SERVER_CERT will be removed.

MYSQL_ATTR_SSL_CA is set just to enable SSL (like mysql -h …. -u … -p –ssl)

With CA verification

PLEASE BE AWARE, the cert in this mode is domain validated. The MySQL server should use a cert with matched common name, ‘db.example.com’ for example. the use of domain name for the host is preferred.

Same to without verification, but set MYSQL_ATTR_SSL_VERIFY_SERVER_CERT to true. (Or just remove the attribute, since it’s true by default)

Two way (mutual) SSL

PDO::MYSQL_ATTR_SSL_CA => "/path/to/ca-cert.pem",
PDO::MYSQL_ATTR_SSL_CERT => "/path/to/client-cert.pem",
PDO::MYSQL_ATTR_SSL_KEY => "/path/to/client-key.pem",
PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => false

MYSQL_ATTR_SSL_VERIFY_SERVER_CERT could be true or false, it depends.

Common Errors

PHP ‘illegal hardware instruction’ on MacOS

I’m using MacOS 10.15 using PHP 7.4.11 from homebrew.
This error basically happens when PDO SSL setup/verification failed.
For example:

PDO::__construct(): SSL operation failed with code 1. OpenSSL Error messages

Or maybe

PDO::__construct(): Peer certificate CN=Common name' did not match expected CN= domain’

I believe it’s a platform specific issue.

PDO attribute not received by Laravel

Mentioned already.
array_filter will filter out all attributes with value of null/false/0/”” …
Remove it when you have to use those values.

Fixing a “Damaged App” from App Store

Background:

  • OSX (From Apple, or Hackintosh)
  • The App was purchased from the App Store with the current iCloud ID

The problem:

  • Unable to open a previously purchased App

The error:

“Magnet” is damaged and can’t be opened. Delete “Magnet” and download it again from the App Store.

It could be any paid app, in my case, ‘Magnet’.

There exist a similar but common error caused by unsigned/modified third party apps (blocked by Gatekeeper)

App Is Damaged and Can’t Be Opened. You Should Move It To The Trash

This is NOT what my guide is talking about.

The Cause

The error basically means Apple is unable to verify the App purchased on this machine.

The MAC address of your en0 is part of the verification. Because all Macs come with a built-in Wifi/Ethernet Adapter.

Run this in your terminal to list all network interfaces.

networksetup -listallhardwareports

What exactly happened to my is, my hackintosh motherboard comes with two built-in Ethernet adapters. I disabled one (en0) from the BIOS few days after the OSX is installed.

How to fix

If you encountered the same error message, try the following:

(Software issue, basically sync your current en0 MAC address with iCloud)

  • Follow this guide from 1Password (also work for other apps from the App Store)
  • If that doesn’t help, move on:

(Hardware issue. in most cases, en0 not found)

  • list all network interfaces, find en0
  • If en0 is not found, enable it from BIOS (if you disabled it before)
  • If you didn’t remove/disable any network hardware, rename your primary interface to en0, here are some useful resources
  • After that, follow the guide from 1Password again when necessary (when it’s still not working)

If none of those work:

Go to network settings > tiny gear icon > Set service order
Open a terminal and run:

cd /Library/Preferences/SystemConfiguration/
sudo rm NetworkInterfaces.plist
sudo rm preferences.plist
Restart machine

Credit for this: Jeremy Wininger

1089. Duplicate Zeros

Given a fixed length array arr of integers, duplicate each occurrence of zero, shifting the remaining elements to the right.

Note that elements beyond the length of the original array are not written.

Do the above modifications to the input array in place, do not return anything from your function.

Example 1:

Input: [1,0,2,3,0,4,5,0]
Output: null
Explanation: After calling your function, the input array is modified to: [1,0,0,2,3,0,0,4]

Example 2:

Input: [1,2,3]
Output: null
Explanation: After calling your function, the input array is modified to: [1,2,3]

Note:

1 <= arr.length <= 10000
0 <= arr[i] <= 9

Solution:

class Solution {
    public void duplicateZeros(int[] arr) {
        int count  = 0;
        for (int i = 0; i < arr.length; i ++){
            if (arr[i] == 0){
                count ++;
            }
        }
        
        int offset = count;
        for (int i = arr.length - 1; i >= 0; i --){
            if (i + offset < arr.length){
                arr[i+offset] = arr[i];
            }
            if (arr[i] == 0){
                offset --;
                if (i + offset < arr.length){
                    arr[i+offset] = arr[i];
                }
            }
        }
    }
}

 

88. Merge Sorted Array

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.

Note:

The number of elements initialized in nums1 and nums2 are m and n respectively.
You may assume that nums1 has enough space (size that is equal to m + n) to hold additional elements from nums2.

Example:

Input:
nums1 = [1,2,3,0,0,0], m = 3
nums2 = [2,5,6], n = 3

Output: [1,2,2,3,5,6]

Constraints:

-10^9 <= nums1[i], nums2[i] <= 10^9 nums1.length == m + n nums2.length == n Solution.

class Solution {
    public void merge(int[] nums1, int m, int[] nums2, int n) {
        // index for m
        int im = m -1;
        // index for n
        int in = n -1;
        // index for result
        int ir = m + n -1;
        
        for (;ir >= 0; ir --){
            
            if (im < 0){
                // If one of the array is all cleared, use the other
                nums1[ir] = nums2[in--];
            } else if (in < 0){
                nums1[ir] = nums1[im--];
            } else if (nums1[im] > nums2[in]){
                // Otherwise, pick the greater one.
                nums1[ir] = nums1[im--];
            } else {
                nums1[ir] = nums2[in--];
            }
        }
        
    }
}