Tutorial by Examples: e

In this example we are creating a new xs:complexType (EmployeeType) based on an existing xs:complexType (PersonType). The construction of this is slightly more complicated. Because the base xs:complexType (PersonType) is considered to be complex (more about this below) we add the <xs:complexCon...
This is where things get a little tricky. We are now restricting an existing xs:complexType. Our SolidStateDriveType derives from HardDiskType but removes the spinUpTime attribute and the RotationSpeed element. Notice the approach for dealing with attributes and elements is different. To remove an ...
int highScore = 57; NSString *scoreBoard = [NSString stringWithFormat:@"HighScore: %i", (int)highScore]; NSLog(scoreBoard);//logs "HighScore: 57"
# Get two numbers from STDIN, separated by a newline, and output the result number1 = gets number2 = gets puts number1.to_i + number2.to_i ## run with: $ ruby a_plus_b.rb ## or: $ echo -e "1\n2" | ruby a_plus_b.rb
number1 = ARGV[0] number2 = ARGV[1] puts number1.to_i + number2.to_i ## run with: $ ruby a_plus_b.rb 1 2
After installing the SDK, atlas-run-standalone starts a JIRA instance with the latest released version. atlas-run-standalone --product jira The instance is available http://localhost:2990/jira The created instance is for testing only. It provides an other directory structure as production insta...
It is possible to customize the JIRA version, the port or the context path. atlas-run-standalone --product jira --version 6.0 --http-port 1337 --context-path issues The JIRA 6 instance is available under http://localhost:1337/issues There are more parameters that can be set for running atlas-ru...
Let's say we want to use libc's ntohl function. First, we must load libc.so: >>> from ctypes import * >>> libc = cdll.LoadLibrary('libc.so.6') >>> libc <CDLL 'libc.so.6', handle baadf00d at 0xdeadbeef> Then, we get the function object: >>> ntohl = l...
The most basic object is an int: >>> obj = ctypes.c_int(12) >>> obj c_long(12) Now, obj refers to a chunk of memory containing the value 12. That value can be accessed directly, and even modified: >>> obj.value 12 >>> obj.value = 13 >>> obj c_...
As any good C programmer knows, a single value won't get you that far. What will really get us going are arrays! >>> c_int * 16 <class '__main__.c_long_Array_16'> This is not an actual array, but it's pretty darn close! We created a class that denotes an array of 16 ints. Now al...
In some cases, a C function accepts a function pointer. As avid ctypes users, we would like to use those functions, and even pass python function as arguments. Let's define a function: >>> def max(x, y): return x if x >= y else y Now, that function takes two arguments and r...
Let's combine all of the examples above into one complex scenario: using libc's lfind function. For more details about the function, read the man page. I urge you to read it before going on. First, we'll define the proper prototypes: >>> compar_proto = CFUNCTYPE(c_int, POINTER(c_int), PO...
Private Sub this() Dim rs As DAO.Recordset Dim q%: Dim z% Set rs = CurrentDb.OpenRecordset("SELECT * FROM Invoice;") With rs rs.MoveLast q = rs.RecordCount rs.MoveFirst z = rs.Fields.Count End With Dim aRR As Variant...
Shows a very basic schema. Note: by convention elementFormDefault is set to 'qualified', in the really world you will be hard pressed to find a schema that does not set this (so just include it in your schemas!). <?xml version="1.0" encoding="utf-8" ?> <!--Created wit...
By convention elementFormDefault is always set to qualified, but lets look at what it actually does. First with elementFormDefault set to qualified. <?xml version="1.0" encoding="utf-8" ?> <!--Created with Liquid Studio 2017 (https://www.liquid-technologies.com)--&g...
The easiest way to run a local JIRA instance, is to install the SDK and run atlas-run-standalone For further details see Starting a local JIRA test instance Please note that this runs a local test instance and is not meant for production.
One of the simpler ways of implementing an authorization system is using the flask-login extension. The project's website contains a detailed and well-written quickstart, a shorter version of which is available in this example. General idea The extension exposes a set of functions used for: log...
Code, to be saved in „helloworld.nsi“: Name "Hello World" OutFile "helloworld.exe" Section "Hello World" MessageBox MB_OK "Hello World!" SectionEnd Compile it with: <Path to NSIS>\makensis.exe <Path to script>\helloworld.nsi
The builder pattern is an object creation software design pattern. Unlike the abstract factory pattern and the factory method pattern whose intention is to enable polymorphism, the intention of the builder pattern is to find a solution to the telescoping constructor anti-pattern. The telescopi...
Consider the following code to copy one file to another: import java.io.*; public class FileCopy { public static void main(String[] args) throws Exception { try (InputStream is = new FileInputStream(args[0]); OutputStream os = new FileOutputStream(args[1])) { ...

Page 1011 of 1191