System directories
Method | Result |
---|---|
Environment.getDataDirectory() | /data |
Environment.getDownloadCacheDirectory() | /cache |
Environment.getRootDirectory() | /system |
External storage directories
System directories
Method | Result |
---|---|
Environment.getDataDirectory() | /data |
Environment.getDownloadCacheDirectory() | /cache |
Environment.getRootDirectory() | /system |
External storage directories
// 檢查Java程式碼是否可以被debug的方法 | |
public boolean isApplicationDebuggable(String paramString) { | |
return (0x2 & this.context.getPackageManager().getApplicationInfo(this.context.getPackageName(), 128).flags) == 2; | |
} | |
// 檢查App是否安裝在模擬器內的方法 | |
public boolean IsInstallEmulator() { | |
try { | |
if(!Build.FINGERPRINT.startsWith("generic") && !Build.FINGERPRINT.startsWith("unknown") && !Build.MODEL.contains("google_sdk") && !Build.MODEL.contains("Emulator") && !Build.MODEL.contains("Android SDK built for x86") && !Build.MANUFACTURER.contains("Genymotion")) { | |
if((Build.BRAND.startsWith("generic")) && (Build.DEVICE.startsWith("generic"))) { |
// Opera 8.0+ | |
var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; | |
// Firefox 1.0+ | |
var isFirefox = typeof InstallTrigger !== 'undefined'; | |
// Safari 3.0+ "[object HTMLElementConstructor]" | |
var isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || (typeof safari !== 'undefined' && safari.pushNotification)); | |
// Internet Explorer 6-11 |
sonarqube: | |
restart: always | |
image: sonarqube | |
ports: | |
- "9000:9000" | |
- "9092:9092" |
<?php | |
function removeEmoji($text) { | |
return preg_replace('/([0-9|#][\x{20E3}])|[\x{00ae}|\x{00a9}|\x{203C}|\x{2047}|\x{2048}|\x{2049}|\x{3030}|\x{303D}|\x{2139}|\x{2122}|\x{3297}|\x{3299}][\x{FE00}-\x{FEFF}]?|[\x{2190}-\x{21FF}][\x{FE00}-\x{FEFF}]?|[\x{2300}-\x{23FF}][\x{FE00}-\x{FEFF}]?|[\x{2460}-\x{24FF}][\x{FE00}-\x{FEFF}]?|[\x{25A0}-\x{25FF}][\x{FE00}-\x{FEFF}]?|[\x{2600}-\x{27BF}][\x{FE00}-\x{FEFF}]?|[\x{2600}-\x{27BF}][\x{1F000}-\x{1FEFF}]?|[\x{2900}-\x{297F}][\x{FE00}-\x{FEFF}]?|[\x{2B00}-\x{2BF0}][\x{FE00}-\x{FEFF}]?|[\x{1F000}-\x{1F9FF}][\x{FE00}-\x{FEFF}]?|[\x{1F000}-\x{1F9FF}][\x{1F000}-\x{1FEFF}]?/u', '', $text); | |
} | |
?> |
<?php | |
/** | |
* @param string $text The string to search in. | |
* @param string $search The target string to search | |
* | |
* @return int The start index of the search string | |
*/ | |
function getStringStartIndexByBoyerMoore($text, $search) { | |
$textLength = strlen($text); |
class DebugHelper | |
{ | |
/** | |
* @var int | |
*/ | |
static $lastTime = 0; | |
/** | |
* @var int | |
*/ |
class DbHelper | |
{ | |
/** | |
* WKB is Well-known binary. | |
* | |
* @param Point $point | |
* | |
* @return string | |
*/ | |
public static function convertPointToWKB(Point $point): string |
<?php | |
// ------------------------------------------------------------------------------------- | |
// Add your JSON in the $input to generate Swagger-PHP annotation | |
// Inspired by: https://github.com/Roger13/SwagDefGen | |
// HOWTO: | |
// php -S localhost:8888 -t . | |
// http://localhost:8888/swagit.php | |
// ------------------------------------------------------------------------------------- |