Get all files in Directory
var FileSearchRes = Directory.GetFiles(@Path, "*.*", SearchOption.AllDirectories);
Returns an array of FileInfo, representing all the files in the specified directory.
Get Files with specific extension
var FileSearchRes = Directory.GetFiles(@Path, "*...
6.0
Default SET format is MMDDhhmm[[CC]YY][.ss], that's (2 digits each)
For example, to set July 17'th 10:10am, without changing the current year, type:
adb shell 'date 07171010.00'
Tip 1: the date change will not be reflected immediately, and a noticable change will happen only after the syst...
Put your dbname.sqlite or dbname.db file in assets folder of your project.
public class Databasehelper extends SQLiteOpenHelper {
public static final String TAG = Databasehelper.class.getSimpleName();
public static int flag;
// Exact Name of you db file that you put in as...
By going to Settings >> Keymap A window will popup showing All the Editor Actions with the their name and shortcuts. Some of the Editor Actions do not have shortcuts. So right click on that and add a new shortcut to that.
Check the image below
Problem:
If after the AsyncTask starts there is a screen rotation the owning activity is destroyed and recreated.
When the AsyncTask finishes it wants to update the UI that may not valid anymore.
Solution:
Using Loaders, one can easily overcome the activity destruction/recreation.
Example:
...
When a Google Map is displayed in lite mode clicking on a map will open the Google Maps application. To disable this functionality you must call setClickable(false) on the MapView, e.g.:
final MapView mapView = (MapView)view.findViewById(R.id.map);
mapView.setClickable(false);
com.android.dex.DexException: Multiple dex files define Lcom/example/lib/Class;
This error occurs because the app, when packaging, finds two .dex files that define the same set of methods.
Usually this happens because the app has accidentally acquired 2 separate dependencies on the same library....
public class PlaySound extends Activity implements OnTouchListener {
private SoundPool soundPool;
private int soundID;
boolean loaded = false;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
su...
Having more than one element with the same ID is a hard to troubleshoot problem. The HTML parser will usually try to render the page in any case. Usually no error occurs. But the pace could end up in a mis-behaving web page.
In this example:
<div id="aDiv">a</div>
<div id...
A spring bean can be configured such that it will register only if it has a particular value or a specified property is met. To do so, implement Condition.matches to check the property/value:
public class PropertyCondition implements Condition {
@Override
public boolean matches(ConditionC...
Find meaningful names for computation units.
Use for comprehensions or map to combine computations together.
Let's say you have something like this:
if (userAuthorized.nonEmtpy) {
makeRequest().map {
case Success(respone) =>
someProcessing(..)
if (resendToUser) {
...
HTML5 is not based on SGML, and therefore does not require a reference to a DTD.
HTML 5 Doctype declaration:
<!DOCTYPE html>
Case Insensitivity
Per the W3.org HTML 5 DOCTYPE Spec:
A DOCTYPE must consist of the following components, in this order:
A string that is an ASCII case-inse...
There is no format specifier to print boolean type using NSLog. One way to print boolean value is to convert it to a string.
BOOL boolValue = YES;
NSLog(@"Bool value %@", boolValue ? @"YES" : @"NO");
Output:
2016-07-30 22:53:18.269 Test[4445:64129] Bool value YES
...
You can animate complex changes to your collection view using the performBatchUpdates method. Inside the update block, you can specify several modifications to have them animate all at once.
collecitonView.performBatchUpdates({
// Perform updates
}, nil)
Inside the update block, you can pe...
Before starting with the example I'd recommend to create a Singleton with a delegate class member so you could achieve a use case of uploading a file in the background and let the user keep using your app while the files are being uploaded even when the app is the background.
Let's start, first, we...
Pressing C-h a will run the emacs function apropos-command which makes emacs prompt for words (or a regexp) to search for. It will then show a buffer containing a list of names and descriptions related to that topic, including key bindings for each of the functions available via keystrokes.
Pressin...
C-h k runs the function describe-key, which looks up the function mapped to the key strokes provided, and presents a description of the function which will be run when these keys are pressed.
C-h c runs the function describe-key-briefly, which only displays the function name mapped to given key seq...
C-h f runs the function describe-function, which displays information on the usage and purpose of a given function. This is especially useful for functions that do not have a mapped key binding that can be used for documentation lookup via C-h k.
The Data.Vector module provided by the vector is a high performance library for working with arrays.
Once you've imported Data.Vector, it's easy to start using a Vector:
Prelude> import Data.Vector
Prelude Data.Vector> let a = fromList [2,3,4]
Prelude Data.Vector> a
fromList [2,3,4]...
Vectors can be map'd and fold'd,filter'd andzip`'d:
Prelude Data.Vector> Data.Vector.map (^2) y
fromList [0,1,4,9,16,25,36,49,64,81,100,121] :: Data.Vector.Vector
Reduce to a single value:
Prelude Data.Vector> Data.Vector.foldl (+) 0 y
66