Choose File Dialog [closed]

You just need to override onCreateDialog in an Activity. //In an Activity private String[] mFileList; private File mPath = new File(Environment.getExternalStorageDirectory() + “//yourdir//”); private String mChosenFile; private static final String FTYPE = “.txt”; private static final int DIALOG_LOAD_FILE = 1000; private void loadFileList() { try { mPath.mkdirs(); } catch(SecurityException e) { Log.e(TAG, “unable to write … Read more

How do you manage your gists on GitHub? [closed]

Check out GistBox. It supports searching, editing and labels. Here’s a screenshot: There’s also a demo video at: http://www.youtube.com/watch?v=VLgyY6lqpsQ GistBox Clipper (a Chrome extension) also provides the ability to save <pre> tags and arbitrary text on any web page. Edit: Unfortunately, GistBox is becoming Cacher cacher.io – the free plan will only include: 15 private … Read more

Shortcut to create properties in Visual Studio?

You could type “prop” and then press tab twice. That will generate the following. public TYPE Type { get; set; } Then you change “TYPE” and “Type”: public string myString {get; set;} You can also get the full property typing “propfull” and then tab twice. That would generate the field and the full property. private … Read more

Get human readable version of file size?

Addressing the above “too small a task to require a library” issue by a straightforward implementation (using f-strings, so Python 3.6+): def sizeof_fmt(num, suffix=”B”): for unit in [“”, “Ki”, “Mi”, “Gi”, “Ti”, “Pi”, “Ei”, “Zi”]: if abs(num) < 1024.0: return f”{num:3.1f}{unit}{suffix}” num /= 1024.0 return f”{num:.1f}Yi{suffix}” Supports: all currently known binary prefixes negative and positive … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)