This file contains 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
global $wp; | |
$current_url = home_url(add_query_arg(array(),$wp->request)); |
This file contains 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
StringBuilder str = new StringBuilder("Hey"); | |
int len = str.length(); | |
for (int i = 0; i < len; i++) { | |
str.append(str.substring(len - 1 - i, len - i)); | |
} | |
str.delete(0, len); | |
System.out.println("string: " + str); |
This file contains 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
String originalString = "This is Mstoic Blog"; | |
String reversedString = ""; | |
for (int i = 1; i <= originalString.length(); i++) { | |
reversedString += (originalString.charAt(originalString.length()-i)); | |
} | |
System.out.println("Reversed: " + reversedString); |
This file contains 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
$('.xenForm').find('fieldset').each(function() { | |
$(this).find('input[value="delete"]').prop("checked", true); | |
}); |
This file contains 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
android:fillViewport="true" |
This file contains 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
@TargetApi(Build.VERSION_CODES.LOLLIPOP) | |
public String getForegroundApp(Context context) { | |
String currentApp = "NULL"; | |
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) { | |
try { | |
Class.forName( "android.app.usage.UsageStatsManager" ); | |
UsageStatsManager usm = (UsageStatsManager) context.getSystemService(Context.USAGE_STATS_SERVICE); | |
long time = System.currentTimeMillis(); | |
List<UsageStats> appList = usm.queryUsageStats(UsageStatsManager.INTERVAL_DAILY, time - 1000 * 1000, time); | |
if (appList != null && appList.size() > 0) { |
This file contains 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
KeyguardManager myKM = (KeyguardManager) getApplicationContext().getSystemService(Context.KEYGUARD_SERVICE); | |
if( myKM.inKeyguardRestrictedInputMode()) { | |
// Phone is locked | |
return; | |
} |
This file contains 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
// See all the settings pages | |
// https://developer.android.com/reference/android/provider/Settings | |
try { | |
context.startActivity(new Intent(Settings.ACTION_FINGERPRINT_ENROLL)); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} |
NewerOlder