Tutorial by Examples: f

Dim fso As New Scripting.FileSystemObject Debug.Print fso.GetBaseName("MyFile.something.txt") Prints MyFile.something Note that the GetBaseName() method already handles multiple periods in a file name.
Dim fso As New Scripting.FileSystemObject Debug.Print fso.GetExtensionName("MyFile.something.txt") Prints txt Note that the GetExtensionName() method already handles multiple periods in a file name.
When inheriting from base Controller class provided by the framework, you can use the convenience method ViewComponent() to return a view component from the action: public IActionResult GetMyComponent() { return ViewComponent("Login", new { param1 = "foo", param2 = 42 }); ...
Sometimes it is required to display a notification at a specific time, a task that unfortunately is not trivial on the Android system, as there is no method setTime() or similiar for notifications. This example outlines the steps needed to schedule notifications using the AlarmManager: Add a Broa...
The sensor values returned by Android are with respective to the phone's coordinate system (e.g. +Y points towards the top of the phone). We can transform these sensor values into a world coordinate system (e.g. +Y points towards magnetic North, tangential to the ground) using the sensor managers ro...
The Firebase Realtime Database allows ordering and querying data. For small data sizes, the database supports ad hoc querying, so indexes are generally not required during development. Before launching your app though, it is important to specify indexes for any queries you have to ensure they contin...
$ mkdir 20{09..11}-{01..12} Entering the ls command will show that the following directories were created: 2009-01 2009-04 2009-07 2009-10 2010-01 2010-04 2010-07 2010-10 2011-01 2011-04 2011-07 2011-10 2009-02 2009-05 2009-08 2009-11 2010-02 2010-05 2010-08 2010-11 2011-02 2011-05 2011-08 2011...
$ cp .vimrc{,.bak} This expands into the command cp .vimrc .vimrc.bak.
$ mv filename.{jar,zip} This expands into mv filename.jar filename.zip .
// Include the MFC header: // (you do not need to and should not include the standard Windows headers, e.g. // Windows.h) #include <AfxWin.h> // MFC core and standard components // The following header defines resource constants, such as dialog and control IDs: #include &qu...
Go in the Firebase console. Choose your project Click on the Database section on the left, and then select the Rules tab. If you would like to test your security rules before putting them into production, you can simulate operations in the console using the Simulate button in the upper right ...
The default rules require Authentication. They allow full read and write access to authenticated users of your app. They are useful if you want data open to all users of your app but don't want it open to the world. // These rules require authentication { "rules": { ".read&...
Just define: // These rules give anyone, even people who are not users of your app, // read and write access to your database { "rules": { ".read": true, ".write": true } } It can be useful during development but pay attention because This level o...
If you have one of the supported Linux distributions, you can follow the steps on the .NET Core website: https://www.microsoft.com/net If you have an unsupported distribution: Download the .NET Core SDK from the links, picking the distribution closer to the used one. https://www.microsoft.com/net...
Go to the (project folder) Then app -> src -> main. Create folder 'assets -> fonts' into the main folder. Put your 'fontfile.ttf' into the fonts folder.
private Typeface myFont; // A good practice might be to call this in onCreate() of a custom // Application class and pass 'this' as Context. Your font will be ready to use // as long as your app lives public void initFont(Context context) { myFont = Typeface.createFromAsset(context.getAss...
public void setFont(TextView textView) { textView.setTypeface(myFont); }
using the vibrate(long[] pattern, int repeat) Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); // Start time delay // Vibrate for 500 milliseconds // Sleep for 1000 milliseconds long[] pattern = {0, 500, 1000}; // 0 meaning is repeat indefinitely vibrator.vib...
using the vibrate(long milliseconds) Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); vibrator.vibrate(500);
Protocol oriented programing can be used as a core Swift design pattern. Different types are able to conform to the same protocol, value types can even conform to multiple protocols and even provide default method implementation. Initially protocols are defined that can represent commonly used pro...

Page 143 of 457