Tutorial by Examples

Template as below Scenario Outline: As a homemaker i want to buy and pay for the below product Given I purchase <a product> And I require a carry bag to take things to home When I pay bill using <payment method> to successfully checkout Then I should have a receipt Exam...
There are many ways of creating DataFrames. They can be created from local lists, distributed RDDs or reading from datasources. Using toDF By importing spark sql implicits, one can create a DataFrame from a local Seq, Array or RDD, as long as the contents are of a Product sub-type (tuples and ca...
var logRepository = new Mock<ILogRepository>(); logRepository.Setup(x => x.Write(It.IsAny<Exception>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Verifiable(); In this case, we are using t...
use Text::CSV; # Can use Text::CSV which will switch to _XS if installed $sep_char = ","; my $csv = Text::CSV->new({sep_char => $sep_char}); my $line = q{"a quoted, comma", word1, word2}; $csv->parse($line); my @fields = $csv->fields(); print join("\n"...
import pyglet from pyglet.gl import * win = pyglet.window.Window() @win.event() def on_draw(): #OpenGL goes here. Use OpenGL as normal. pyglet.app.run()
import pyglet from pyglet.gl import * win = pyglet.window.Window() glClear(GL_COLOR_BUFFER_BIT) @win.event def on_draw(): glBegin(GL_POINTS) glVertex2f(x, y) #x is desired distance from left side of window, y is desired distance from bottom of window #make as many vertexes as...
In our last two examples, numpy assumed that a[0,:] was the first vector, a[1,:] the second, and a[2,:] the third. Numpy.cross has an optional argument axisa that allows us to specify which axis defines the vectors. So, >>> a=np.array([[1,1,1],[0,1,0],[1,0,-1]]) >>> b=np.array([0...
Required JARs on classpath: javax.money:money-api:1.0 (JSR354 money and currency api) org.javamoney:moneta:1.0 (Reference implementation) javax:annotation-api:1.2. (Common annotations used by reference implementation) // Let's create non-ISO currency, such as bitcoin // At first, t...
Using named ranges allows you to describe the meaning of a cell(s) contents and use this defined name in place of an actual cell address. For example, formula =A5*B5 can be replaced with =Width*Height to make the formula much easier to read and understand. To define a new named range, select cell ...
Create new named range called ‘MyRange’ assigned to cell A1 ThisWorkbook.Names.Add Name:="MyRange", _ RefersTo:=Worksheets("Sheet1").Range("A1") Delete defined named range by name ThisWorkbook.Names("MyRange").Delete Access Named Range by name...
Formulas tab > Defined Names group > Name Manager button Named Manager allows you to: Create or change name Create or change cell reference Create or change scope Delete existing named range Named Manager provides a useful quick look for broken links.
A natural division is simply to make one topic for each language feature. For instance, Python has: Classes Functions Generators Decorators . . . On the downside, features can be quite complicated and it's easy to come up with many more examples than make sense for a single page. Classes h...
Example sheet Code Sub Example() Dim wks As Worksheet Set wks = ThisWorkbook.Worksheets("Sheet1") Dim units As Range Set units = ThisWorkbook.Names("Units").RefersToRange Worksheets("Sheet1").Range("Year_Max").Value =...
BatchBashDescriptioncommand /?man commandShows the help for commandbitsadminwget or curlDownloads a remote filecertutil -hashfile file_name MD5md5sum file_nameGets the MD5 checksum of file_namecdpwdDisplays the current directorycd directorycd directoryChanges the current directory to the specified o...
BatchBashDescription%variable%$variableA regular variable!variable!$variableA variable inside of a code block when setlocal enabledelayedexpansion is on%errorlevel% or ERRORLEVEL$?Returns the status of the previous command: 0 if successful, 1 (or something else) if not%1, %2, %3, etc.$1, $2, $3, etc...
Windows provides an explicit interface through which the winsound module allows you to play raw beeps at a given frequency and duration. import winsound freq = 2500 # Set frequency To 2500 Hertz dur = 1000 # Set duration To 1000 ms == 1 second winsound.Beep(freq, dur)
Using immutable locals: Uses less horizontal space but more vertical space than the "anonymous temporaries" template. Preferable over the "anonymous temporaries" template if the when expression is in a loop--in that case, regex definitions should be placed outside the loop. im...
The static factory method is a variation of the factory method pattern. It is used to create objects without having to call the constructor yourself. When to use the Static Factory Method if you want to give a meaningfull name to the method that generates your object. if you want to avoid over...
Implementing the Behavior This behavior will cause mouse wheel events from an inner ScrollViewer to bubble up to the parent ScrollViewer when the inner one is at either its upper or lower limit. Without this behavior, the events will never make it out of the inner ScrollViewer. public class Bubbl...
Smarty templating engine for PHP lets easily separate application logic and presentation, the first being in PHP code and the other generally, but not always, in HTML. That way a separation of PHP and HTML code is encouraged. Currently two versions of Smarty are maintained smarty2 for legacy purpos...

Page 1078 of 1336