| Constant | Description |
|---|---|
| none | There is no content type. The text is not editable. |
"^(?<!\\d)(?:20\\d{2}(?:(?:0[13578]|1[02])31|(?:0[1,3-9]|1[0-2])(?:29|30))|20(?:0[48]|[2468][048]|[13579][26])0229|20\\d{2}(?:0?[1-9]|1[0-2])(?:0?[1-9]|1\\d|2[0-8]))(?!\\d)$".toRegex()出處
https://stackoverflow.com/questions/29307768/using-regex-to-match-date-format-in-yyyymmdd
https://stackoverflow.com/questions/51224/regular-expression-to-match-valid-dates
| # encoding: utf-8 | |
| def company_serial_no_checker(serial) | |
| # 共八位,全部為數字型態 | |
| at_least_8_digits = /^\d{8}$/ | |
| return false unless at_least_8_digits.match(serial) | |
| # 各數字分別乘以 1,2,1,2,1,2,4,1 | |
| # 例:統一編號為 53212539 |
★ Note: StateFlow support is a preview feature that requires version
7.0.0-alpha04or higher of the Android Gradle plugin.
😨
https://developer.android.com/topic/libraries/data-binding/observability#stateflow
Why android:fullBackupOnly default value is false?
Cheok Yan Cheng 問道:
In https://developer.android.com/guide/topics/manifest/application-element,
android:fullBackupOnly
>This attribute indicates whether or not to use Auto Backup on devices where it is available. If set to true, then your app performs Auto Backup when installed on a device running Android 6.0 (API level 23) or higher. On older devices, your app ignores this attribute and performs Key/Value Backups. The default value is "false".
If the action is produced further down the UI tree, like in a RecyclerView item or a custom View, the ViewModel should still be the one handling user events.
For example, suppose that all news items from NewsActivity contain a bookmark button. The ViewModel needs to know the ID of the bookmarked news item. When the user bookmarks a news item, the RecyclerView adapter does not call the exposed addBookmark(newsId) function from the ViewModel, which would require a dependency on the ViewModel. Instead, the ViewModel exposes a state object called NewsItemUiState which contains the implementation for handling the event:
data class NewsItemUiState(
val title: String,
val body: String,
val bookmarked: Boolean = false,
val publicationDate: String,
val onBookmark: () -> UnitYou can use these commands and rules to search for exploitation attempts against log4j RCE vulnerability CVE-2021-44228
This command searches for exploitation attempts in uncompressed files in folder /var/log and all sub folders
sudo egrep -I -i -r '\$(\{|%7B)jndi:(ldap[s]?|rmi|dns|nis|iiop|corba|nds|http):/[^\n]+' /var/logWindows 版
for /f "tokens=*" %i in ('git ls-files') do @(
for /f %j in ('git log --oneline "%i" ^| find /c /v ""') do @echo "%j", "%i"
) >> git-ls-files-log-count-commits.txthttps://stackoverflow.com/questions/53954114
Fatal Exception: java.lang.SecurityException: Not allowed to bind to service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms }
at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1741)
at android.app.ContextImpl.bindService(ContextImpl.java:1651)
at android.content.ContextWrapper.bindService(ContextWrapper.java:705)
at com.google.android.gms.common.stats.ConnectionTracker.zza(ConnectionTracker.java:41)
at com.google.android.gms.common.stats.ConnectionTracker.zza(ConnectionTracker.java:10)
at com.google.android.gms.common.stats.ConnectionTracker.bindService(ConnectionTracker.java:43)https://stackoverflow.com/questions/4414171
這問題歷經十年
解決方案也有變化...
比較優雅的做法是使用:
https://developer.android.com/reference/android/arch/lifecycle/ProcessLifecycleOwner.html
ProcessLifecycleOwnerwill dispatchON_START,ON_RESUMEevents, as a first activity moves through these events.ON_PAUSE,ON_STOP, events will be dispatched with a delay after a last activity passed through them. This delay is long enough to guarantee thatProcessLifecycleOwnerwon't send any events if activities are destroyed and recreated due to a configuration change.
