委刊項(campaign)通常指的是一個有計畫、有組織的廣告活動或宣傳活動。 這些活動通常是為了達成特定的市場目標或促進產品或服務的銷售而設計的。 一個廣告委刊項可能包括多種媒體形式,如電視、網路、報紙、廣播、社交媒體等,並且會有特定的時間框架和預算。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type ReadCacheProxy[Input, ViewModel any] struct { | |
| ReadCache func(input *Input) (output *ViewModel, err error) | |
| ReadDatabase func(input *Input) (output *ViewModel, err error) | |
| WriteCache func(output *ViewModel) error | |
| Key string | |
| Locks *sync.Map | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| commit_msg_file=$1 | |
| commit_msg=$(cat "$commit_msg_file") | |
| date_regex="^[0-9]{4}-[0-9]{2}-[0-9]{2}" | |
| if ! echo "$commit_msg" | grep -qE "$date_regex"; then | |
| echo "Error: commit message must start with a date in YYYY-MM-DD format." | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from dataclasses import dataclass, field, ClassVar | |
| from typing import Callable, Union, Optional, Any | |
| from enum import Enum | |
| Pattern = Union[Enum, str, int] | |
| Message = Any | |
| MessageHandler = Callable[[Message], None] | |
| MessageDecorator = Callable[[MessageHandler], MessageHandler] |
mongo shell
db.variousInstance.aggregate([
{
$match: {}
},
{
$sort: {createAt: -1},
},
{
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // main.go | |
| package main | |
| type Duck interface { | |
| Quack() | |
| } | |
| type Cat struct { | |
| Name string | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function RabinKarpSet(string s[1~K], string patterns[1~N]) | |
| //用hash table or Cuckoo Filter 來儲存敏感詞彙相關資料 | |
| set hsSet := emptySet | |
| //前置處理 | |
| foreach p in patterns | |
| insert hash(p[1~M]) into hsSet | |
| hs := hash(s[1~M]) | |
| //匹配運算 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type T struct { | |
| } | |
| var p *T | |
| func New() *T { | |
| if p == nil { | |
| p = new(T) | |
| } | |
| return p |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //問題1用到的struct | |
| type IssuesSearchResult struct { | |
| TotalCount int `json:"total_count"` | |
| //為什麼使用 struct pointer 作內嵌欄位 | |
| //不能直接定義為 | |
| //Items []Issue ? | |
| Items []*Issue | |
| } | |
| //問題1用到的struct |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| "sync" | |
| ) | |
| var mu sync.Mutex | |
| var count int |
NewerOlder