Tutorial by Examples: sin

It is possible to create a set of variables that can act similar to an array (although they are not an actual array object) by using spaces in the SET statement: @echo off SET var=A "foo bar" 123 for %%a in (%var%) do ( echo %%a ) echo Get the variable directly: %var% Result: ...
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...
When working with XAML, using a centralized Style allows you to update a set of styled views from one place. All the idiom and platform adjustements can also be integrated to your styles. <Style TargetType="StackLayout"> <Setter Property="Padding"> <Setter...
You can create custom views that can be integrated to your page thanks to those adjustment tools. Select File > New > File... > Forms > Forms ContentView (Xaml) and create a view for each specific layout : TabletHome.xamland PhoneHome.xaml. Then select File > New > File... > F...
Gson does not support inheritance out of the box. Let's say we have the following class hierarchy: public class BaseClass { int a; public int getInt() { return a; } } public class DerivedClass1 extends BaseClass { int b; @Override public int getI...
The function in this example returns true if two line segments are intersecting and false if not. The example is designed for performance and uses closure to hold working variables // point object: {x:, y:} // p0 & p1 form one segment, p2 & p3 form the second segment // Retur...
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 ...
# Set The Formatting $xmlsettings = New-Object System.Xml.XmlWriterSettings $xmlsettings.Indent = $true $xmlsettings.IndentChars = " " # Set the File Name Create The Document $XmlWriter = [System.XML.XmlWriter]::Create("C:\YourXML.xml", $xmlsettings) # Write the XML ...
Many languages feature a with statement that allows programmers to omit the receiver of method calls. with can be easily emulated in Ruby using instance_eval: def with(object, &block) object.instance_eval &block end The with method can be used to seamlessly execute methods on object...
All objects are instances of a class. However, that is not the whole truth. In Ruby, every object also has a somewhat hidden singleton class. This is what allows methods to be defined on individual objects. The singleton class sits between the object itself and its actual class, so all methods defi...
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' ...
Once JSON values are extracted from JSON text, you can use them ina any part of the query. You can create some kind of report on JSON data with grouping aggregations, etc: select JSON_VALUE(Data, '$.Type') as type, AVG( cast(JSON_VALUE(Data, '$.ManufacturingCost') as float) ) as cost from...
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...
OPENJSON function parses collection of JSON objects and returns values from JSON text as set of rows. If the values in input object are nested, additional mapping parameter can be specified in each column in WITH clause: declare @json nvarchar(4000) = N'[ {"data":{"num":&quot...
Step 1: Locate your download of Node.js, typically it is installed under C:/program files/nodejs Step 2: Open Visual Studios and navigate to "Tools>Options" Step 3: In the options window navigate to "Projects and Solutions>External Web Tools" Step 4: Add new entry with y...
If Sitecore is setup in a CM-CD enviornment there could be a need to fire events on CD server when CM events are fired. The example could be firing publish:end:remote on CD when content editors done publish on CM. In order to make sure that events are firing the following steps are required to be ...
Python follows PEMDAS rule. PEMDAS stands for Parentheses, Exponents, Multiplication and Division, and Addition and Subtraction. Example: >>> a, b, c, d = 2, 3, 5, 7 >>> a ** (b + c) # parentheses 256 >>> a * b ** c # exponent: same as `a * (b ** c)` 7776 >>...
While using decorator syntax (with the @) is convenient, it also a bit concealing. You can use properties directly, without decorators. The following Python 3.x example shows this: class A: p = 1234 def getX (self): return self._x def setX (self, value): self._x =...
If the file already exists, it will be overwritten! String fileName = "file.zip"; // name of the file String urlToGetFrom = "http://www.mywebsite.com/"; // URL to get it from String pathToSaveTo = "C:\\Users\\user\\"; // where to put it ...
Suppose you want to prevent unauthorized users to access the page then you have to put barrier to them by authorizing access. We can do this by using spring-security which provides basic authentication by securing all HTTP end points. For that you need to add spring-security dependency to your proje...

Page 84 of 161