Tutorial by Examples: e

To enable or disable a BroadcastReceiver, we need to get a reference to the PackageManager and we need a ComponentName object containing the class of the receiver we want to enable/disable: ComponentName componentName = new ComponentName(context, MyBroadcastReceiver.class); PackageManager packageM...
Installing Ant is very simple. Follow the steps given below to install Ant on windows platform: Download latest ant version from Apache website Unzip the file on your machine. Set ANT_HOME in environment variables Add %ANT_HOME%\bin to your PATH environment variable. Set CLA...
DATABASE : SQL Server PARSENAME function returns the specific part of given string(object name). object name may contains string like object name,owner name, database name and server name. More details MSDN:PARSENAME Syntax PARSENAME('NameOfStringToParse',PartIndex) Example To get object nam...
.NET Core app should be published using dotnet publish FROM microsoft/dotnet:latest COPY bin/Debug/netcoreapp1.0/publish/ /root/ EXPOSE 5000 ENTRYPOINT dotnet /root/sampleapp.dll
You should now be all set to run the importers with the following incantation: $ ruby -rubygems -e 'require "jekyll-import"; JekyllImport::Importers::MyImporter.run({ # options for this importer })' Where MyImporter is the name of the specific importer.
You can also put custom variables in the front matter. These can be reused in the page layout. For example, if your front matter looks like this: --- layout: post title: "Using Custom Variables!" date: 2016-07-25 chicken: "I like Chicken." --- You can use the chicken va...
There are a number of predefined global variables that you can set in the front matter of a page or post. VariableDescriptionlayoutIf set, this specifies the layout file to use. Use the layout file name without the file extension. Layout files must be placed in the _layouts directory.permalinkIf y...
You can convert a timestamp or interval value to a string with the to_char() function: SELECT to_char('2016-08-12 16:40:32'::timestamp, 'DD Mon YYYY HH:MI:SSPM'); This statement will produce the string "12 Aug 2016 04:40:32PM". The formatting string can be modified in many different wa...
If you want to retrieve the details of a user's Facebook profile, you need to set permissions for the same: loginButton = (LoginButton)findViewById(R.id.login_button); loginButton.setReadPermissions(Arrays.asList("email", "user_about_me")); You can keep adding more permiss...
Once you first add the Facebook login/signup, the button looks something like: Most of the times, it doesn't match with the design-specs of your app. And here's how you can customize it: <FrameLayout android:layout_below="@+id/no_network_bar" android:id="@+id/FrameLay...
You have to setup the prerequisites. Add the Facebook activity to the AndroidManifest.xml file: <activity android:name="com.facebook.FacebookActivity" android:configChanges= "keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:theme=&...
Facebook SDK 4.0 onwards, this is how we logout: com.facebook.login.LoginManager.getInstance().logOut(); For versions before 4.0, the logging out is gone by explicitly clearing the access token: Session session = Session.getActiveSession(); session.closeAndClearTokenInformation();
If you want your application to support a plug-in system, for example to load plug-ins from assemblies located in plugins folder: interface IPlugin { string PluginDescription { get; } void DoWork(); } This class would be located in a separate dll class HelloPlugin : IPlugin { ...
WinDbg is often used as an abbreviation of "Debugging tools for Windows". It contains different debuggers: DebuggerDescriptionWinDbgthe debugger with a graphical user interfaceCDBconsole debugger, user mode debugger which runs in the currently open consoleNTSDnew terminal symbolic debugge...
Structure: Try 'Your program will try to run the code in this block. 'If any exceptions are thrown, the code in the Catch Block will be executed, 'without executing the lines after the one which caused the exception. Catch ex As System.IO.IOException 'If an exception occurs w...
CoffeeScript is a scripting language that compiles into JavaScript. Any code written in CoffeeScript can be translated into JavaScript with a one-to-one matching. CoffeeScript can be easily installed with npm: $ mkdir coffee && cd coffee $ npm install -g coffee-script The -g flag will ...
Add a init.gradle to your user gradle folder. The init.gradle is recognized on every project. Unix: ~/.gradle/init.gradle These are also alternative locations where init script can be placed and loaded automatically:- Any *.gradle file in USER_HOME/.gradle/init.d Any *.gradle file in t...
NSMutableArray can be initialized as an empty array like this: NSMutableArray *array = [[NSMutableArray alloc] init]; // or NSMutableArray *array2 = @[].mutableCopy; // or NSMutableArray *array3 = [NSMutableArray array]; NSMutableArray can be initialized with another array like this: NSMuta...
Extension Method can work on null references, but you can use ?. to null-check anyway. public class Person { public string Name {get; set;} } public static class PersonExtensions { public static int GetNameLength(this Person person) { return person == null ? -1 : pers...
To list all available schemes for the project in your current directory xcodebuild -list Optionally you can pass a path to a project or workspace file xcodebuild -list -workspace ./MyApp.xcworkspace xcodebuild -list -project ./MyApp.xcodeproj Example output Information about project "...

Page 506 of 1191