Tutorial by Examples: l

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...
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...
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...
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)
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...
Declare @userList Table(UserKey VARCHAR(60)) Insert into @userList values ('bill'),('jcom'),('others') --Declared a table variable and insert 3 records Declare @text XML Select @text = ( select UserKey from @userList for XML Path('user'), root('group') ) --Set the XML value from ...
CREATE TABLE mytable (number INT); INSERT INTO mytable VALUES (1); CREATE MATERIALIZED VIEW myview AS SELECT * FROM mytable; SELECT * FROM myview; number -------- 1 (1 row) INSERT INTO mytable VALUES(2); SELECT * FROM myview; number -------- 1 (1 row) REFRESH ...
Java code: public class StdioApplication { public static void main(String[] args) { new ClassPathXmlApplicationContext("classpath:spring/integration/stackoverflow/stdio/stdio.xml"); } } Xml config file <?xml version="1.0" encoding="UTF-8"?&...
This example demonstrates how to develop a simple UWP application. On creation of a "Blank App (Universal Windows)" project there are many essential files that are created in your solution. All files in your project can be seen in the Solution Explorer. Some of the crucial files in your...
using System; using System.Speech.Synthesis; using System.Windows; namespace Stackoverflow.SpeechSynthesisExample { public partial class SpeechSynthesisSample : Window { public SpeechSynthesisSample() { InitializeComp...
The non-null assertion operator, !, allows you to assert that an expression isn't null or undefined when the TypeScript compiler can't infer that automatically: type ListNode = { data: number; next?: ListNode; }; function addNext(node: ListNode) { if (node.next === undefined) { nod...
This example demonstrates how a cross origin http request can be handled using a middleware. CORS Background CORS is an access control method adopted by all major browsers to avert Cross Scripting Vulnerabilities inherent by them. In general browser security, scripts should maintain that all XHR r...
Let's say you need to add a field to every document in a collection. import pymongo client = pymongo.MongoClient('localhost', 27017) db = client.mydb.mycollection for doc in db.find(): db.update( {'_id': doc['_id']}, {'$set': {'newField': 10} }, upsert=False, multi=False...
Previously, datatables were initialized as follows: var oTable = $("#selector").dataTable(); This used to return a jQuery object which would stored in the variable oTable. And then to access the api to modify table properties, we had to initialize the api differently, as shown below: ...
The following 3 features (that were deprecated in 1.9) are no longer available in 1.10, they are : fnRender: According to the deverloper: The old fnRender option provided a method of manipulating a cell when it was created. however, it was provided with a confusing list of options as its a...

Page 687 of 861