Tutorial by Examples: f

Orthogonal to the JRE versus JDK dichotomy, there are two types of Java release that are widely available: The Oracle Hotspot releases are the ones that you download from the Oracle download sites. The OpenJDK releases are the ones that are built (typically by third-party providers) from the Ope...
A JDK installation and a text editor are the bare minimum for Java development. (It is nice to have a text editor that can do Java syntax highlighting, but you can do without.) However for serious development work it is recommended that you also use the following: A Java IDE such as Eclipse, In...
You can enhance your own classes with generics just like NSArray or NSDictionary. @interface MyClass<__covariant T> @property (nonnull, nonatomic, strong, readonly) NSArray<T>* allObjects; - (void) addObject:(nonnull T)obj; @end
The format statement applies the given format to the specified variable for display purposes only, i.e. the underlying value does not change. data example1 ; Date = '02AUG2016'd ; /* stored as a SAS date, i.e. a number */ Date2 = '31AUG2016'd ; format Date monyy7. Date2 yymmddn8. ; run...
//Here self.webView is the view whose screenshot I need to take //The screenshot is saved in jpg format in the application directory to avoid any loss of quality in retina display devices i.e. all current devices running iOS 10 UIGraphicsBeginImageContextWithOptions(self.webView.bounds.size, N...
Adjustments can be done for specific platforms from C# code, for example for changing padding for all the targeted platforms. if (Device.OS == TargetPlatform.iOS) { panel.Padding = new Thickness (10); } else { panel.Padding = new Thickness (20); } An helper method is also availab...
Struct defines new classes with the specified attributes and accessor methods. Person = Struct.new :first_name, :last_name You can then instantiate objects and use them: person = Person.new 'John', 'Doe' # => #<struct Person first_name="John", last_name="Doe"> p...
filter returns a list of each item in the given list for which the given predicate returns a non-#f value. ;; Get only even numbers in a list > (filter even? '(1 2 3 4)) '(2 4) ;; Get all square numbers from 1 to 100 > (filter (lambda (n) (integer? (sqrt n))) (range 1 100)) '(1 4 9 16 ...
Let us first create a simple .proto file person.proto package Protocol; message Person { required string firstName = 1; required string lastName = 2; optional int32 age = 3; } After saving we can now create the Haskell files which we can use in our project by running ...
Here the steps required to create a Firebase project and to connect it with an Android app. Add Firebase to your app Create a Firebase project in the Firebase console and click Create New Project. Click Add Firebase to your Android app and follow the setup steps. When prompted, enter...
# Will display task as: # -------- Rebuild -------- # -------- Build -------- FormatTaskName "-------- {0} --------" # will display tasks in yellow colour: # Running Rebuild FormatTaskName { param($taskName) "Running $taskName" - foregroundcolor yellow } ...
1..100 | ForEach-Object { Write-Progress -Activity "Copying files" -Status "$_ %" -Id 1 -PercentComplete $_ -CurrentOperation "Copying file file_name_$_.txt" Start-Sleep -Milliseconds 500 # sleep simulates working code, replace this line with your e...
1..10 | foreach-object { $fileName = "file_name_$_.txt" Write-Progress -Activity "Copying files" -Status "$($_*10) %" -Id 1 -PercentComplete ($_*10) -CurrentOperation "Copying file $fileName" 1..100 | foreach-object { ...
QThread is a handle to a platform thread. It lets you manage the thread by monitoring its lifetime, and requesting that it finishes its work. In most cases inhering from the class is not recommended. The default run method starts an event loop that can dispatch events to objects living in the class...
To detect multiple features at once, use the and operator. @supports (transform: translateZ(1px)) and (transform-style: preserve-3d) and (perspective: 1px) { /* Probably do some fancy 3d stuff here */ } There is also an or operator and a not operator: @supports (display: flex) or (display...
ActiveRecord includes default_scope, to automatically scope a model by default. class Post default_scope ->{ where(published: true).order(created_at: :desc) } end The above code will serve posts which are already published when you perform any query on the model. Post.all # will only lis...
JSON_VALUE function enables you to take a data from JSON text on the path specified as the second argument, and use this value in any part of the select query: select ProductID, Name, Color, Size, Price, JSON_VALUE(Data, '$.Type') as Type from Product where JSON_VALUE(Data, '$.Type') = 'part' ...
If some JSON text might not be properly formatted, you can remove those entries from query using ISJSON function. select ProductID, Name, Color, Size, Price, JSON_VALUE(Data, '$.Type') as Type from Product where JSON_VALUE(Data, '$.Type') = 'part' and ISJSON(Data) > 0
In this example, Tags array may contain various keywords like ["promo", "sales"], so we can open this array and filter values: select ProductID, Name, Color, Size, Price, Quantity from Product CROSS APPLY OPENJSON(Data, '$.Tags') where value = 'sales' OPENJSON will op...
Since JSON is stored textual column, you might want to ensure that it is properly formatted. You can add CHECK constraint on JSON column that checks is text properly formatted JSON: CREATE TABLE ProductCollection ( Id int identity primary key, Data nvarchar(max) CONSTRAINT [Data shoul...

Page 230 of 457