Restrict access to phpMyAdmin by IP

Under an Ubuntu system phpMyAdmin adds an Apache vhost that makes it publically available at http://yoursite.com/phpmyadmin . By accessing http://yoursite.com/phpmyadmin have maximum chances to get hacked your database. Under Ubuntu, the phpMyAdmin apache conf file is located at: /etc/apache2/conf-available/phpmyadmin.conf Simply add the following order, allow, deny directives …

AutoCompleteTextView: Remove soft keyboard on back press instead of suggestions

We can achieve that by override-ing onKeyPreIme in your custom AutoCompleteTextView. public class CustomAutoCompleteTextView extends AutoCompleteTextView { public CustomAutoCompleteTextView(Context context) { super(context); } public CustomAutoCompleteTextView(Context context, AttributeSet attrs) { super(context, attrs); } public CustomAutoCompleteTextView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Override …

Video height issue when set src from local storage

Hi, When you set video src from local storage, then please don’t load again that video tag. see below example for reference. $(‘#my-video’).html(”); var srcPath = cordova.file.documentsDirectory + FileName; $(‘#my-video’).html(‘<source src=’+srcPath+’ type=”video/mp4″></source>’ ); $(‘#my-video’).load(); so you need to remove last line, then your code would …

How do I format a double into a string (with only two decimal places)?

double d1 = 123456.78; double d2 = 567890; Locale fmtLocale = Locale.getDefault(Category.FORMAT); NumberFormat formatter = NumberFormat.getInstance(fmtLocale); formatter.setMaximumFractionDigits(2); formatter.setMinimumFractionDigits(2); System.out.println(formatter.format(d1)); System.out.println(formatter.format(d2)); System.out.println(fmtLocale.toLanguageTag());