Tutorial by Examples: c

.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
If you’re switching to Jekyll from another blogging system, Jekyll’s importers can help you with the move. Most methods listed on this page require read access to the database from your old system to generate posts for Jekyll. Each method generates .markdown posts in the _posts directory based on th...
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...
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 { ...
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...
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 "...
public void MoveToStateAndExecuteActions(Item item, ID workflowStateId) { Sitecore.Workflows.IWorkflowProvider workflowProvider = Item.Database.WorkflowProvider; Sitecore.Workflows.IWorkflow workflow = workflowProvider.GetWorkflow(item); // if item is in any workflow if (workf...
Thanks to this great post If we want to mimic the Sitecore UI behavior and execute the command which will change the workflow state, we need to use WorkflowProvider to get an instance of the workflow assigned to the given item and call Execute method with a chosen command ID. This will fire all the...
An HTTP POST request is sent to a URL of the format: "https://api.twilio.com/2xxx-xx-xx/Accounts/[AccountSid]/Messages.json The example below uses a alphanumeric string as the sender. At the time of writing a sender ID can only be added through a service request Twlio. Example Request: To=&q...
To get the current date you use the DateTime.Today property. This returns a DateTime object with today's date. When this is then converted .ToString() it is done so in your system's locality by default. For example: Console.WriteLine(DateTime.Today); Writes today's date, in your local format to...
from __future__ import print_function import multiprocessing def countdown(count): while count > 0: print("Count value", count) count -= 1 return if __name__ == "__main__": p1 = multiprocessing.Process(target=countdown, args=(10,)) ...
To get Array from any object, use Kernel#Array. The following is an example: Array('something') #=> ["something"] Array([2, 1, 5]) #=> [2, 1, 5] Array(1) #=> [1] Array(2..4) #=> [2, 3, 4] Array([]) #=> [] Array(nil) #=> [] For...

Page 355 of 826