Chapter 7: Cell Arrays and Structures
Chapter Objectives
This chapter discusses the nature, implementation, and behavior of collections that may contain data items of any class, size, or shape. We will deal with two different heterogeneous storage mechanisms:
- Those accessed by index (cell arrays)
- Those accessed by field name (structures)
Introduction
This chapter covers data collections that are more general and flexible than the homogeneous arrays we have considered so far. Conceptually, heterogeneous collections may contain objects of any type, rather than just numbers. Consequently, none of the collective operations defined for numerical arrays can be applied to cell arrays or structures. To perform most operations on their contents, the items must be extracted one at a time and replaced if necessary. We will consider three different mechanisms for building heterogeneous collections:
- you access components of a cell array with a numerical index;
- you access components of a structure with a symbolic field name; and
- you access components of a structure array by way of a numerical index to reach a specific structure then a symbolic field name.
7.1 Concept: Collecting Dissimilar Objects
Heterogeneous collections permit objects of different data types to be grouped in a collection. They allow data abstraction to apply to a much broader range of content. However, the fact that the contents of these collections may be of any data type severely restricts the operations that can be performed on the collections as a whole. Whereas a significant number of arithmetic and logical operations can be performed on whole number arrays, algorithms that process heterogeneous collections almost always deal with the data contents one item at a time.
Insignificant Footnote: There is a fundamental aspect of computing that is carefully hidden by the Matlab but fully exposed in other languages especially Java. That aspect is this: computer languages that deal with complex concepts such as the subject of this chapter actually need to implement the classes that define behavior in a hierarchy. At the root of that hierarchy in Java is a class called Object, and all Java classes actually respond as if they were Objects in addition to their specific behavior. Matlab hides exactly the same behavior. Hence, while we discuss these collections as if they were heterogeneous, because of this hierarchy, the Matlab infrastructure treats them as homogeneous collections of Objects.
7.2 Cell Arrays
Figure 7.1: Conceptual Cell Array
Cell arrays, as the name suggests, have the general form of arrays and can be indexed numerically as arrays. However, each element of a cell array should be considered as a container in which one data object of any class can be stored. They can be treated as arrays of containers for the purpose of concatenation and slicing. However, if you wish to access or modify the contents of the containers, the cells must be accessed individually.
Nomenclature: Cells and cell arrays have dual meanings. In one sense, the braces specify a cell, a container of whatever is inside the braces. The other sense suggests that within the cell is an arbitrary collection of objects we will refer to as a cell's contents.
7.2.1 Creating Cell Arrays
Cell arrays may be constructed in the following ways:
- By assigning values individually to a variable indexed with braces:
>> A{1} = 42
A =
[42] - By assigning anything contained within braces individually to a variable normally indexed with parentheses:
>> B(1) = {[4 6]};
B =
[1x2 double] - By concatenating cell contents using braces
{. . .}:
>> C = {3, [1,2,3], 'abcde'}
C =
[3] [1x3 double] 'abcde' - By concatenating cell containers:
>> D = [A B C {'xyz'}]
D =
[42] [1x2 double] [3] [1x3 double] 'abcde' 'xyz'
Based on these examples, we observe the following:
- A cell array can contain any legal MATLAB object
- Just as with numerical arrays, cell arrays can be created "on the fly" by assigning values to an indexed variable.
- When the values from a cell array are displayed, their appearance is different from that of the contents of a numerical array.
- Individual numbers, vectors and arrays are shown in brackets, for example,
[1 2 3];
- larger numerical arrays display their size, for example,
[2×3 double]
; and - character strings are displayed with the enclosing quotes, for example,
'abcde'
.
- Individual numbers, vectors and arrays are shown in brackets, for example,
7.2.2 Accessing Cell Arrays
Since cell arrays can be considered as conventional arrays of containers, the containers can be accessed and manipulated normally. For example, continuing the previous examples, we have the following:
>> E = D(2) % parentheses - fetching a container
E =
[4 6]
However, braces are used to access the contents of the containers as follows:
>> D{2} % braces - fetching the contents
ans =
4 6
Exercise 7.1 shows details of cell indexing behavior.
Lessons to learn:
- If the right-hand side of an assignment statement results in multiple cell arrays, the assignment must be to the same number of variables.
- The built-in function
deal(...)
is used to make these allocations. - When we extract the contents of multiple cells using, for example,
A{1:2}
, this results in multiple assignments being made. - These multiple assignments must go to separate variables. This is the fundamental mechanism behind returning multiple results from a function.
- These multiple assignments cannot be made to a single variable; sufficient storage must be provided either as a collection of variables or explicitly as a vector.
- Cell arrays can be "sliced" with normal vector indexing assignments as long as the sizes match on the left and right sides of the assignment. Any unassigned array elements are filled with an empty vector.
- The assignment
B{[1 3]} = A{[1 2]}
that produced an error needs some thought. SinceA{[1 2]}
produces two separate assignments, MATLAB will not assign the answers, even to the right number of places in another cell array. - The
deal(...)
function is provided to capture these multiple results in different variables. Notice the difference between usingA{:}
andA
as a parameter todeal(...)
. Whendeal(...)
is provided with a parameter other than a collection of cells, it merely copies that parameter to each variable. - Assignments work normally if cell arrays are treated as vectors and the extraction of items can be indexed —
s
is a vector of the sums of the elements inA
. - When accessing cell arrays, it is normal to have braces on one side or the other of an assignment; it is rarely appropriate to have braces on both sides of an assignment. The result in the last example is that a container is loaded into the third container in the cell array.
7.2.3 Using Cell Arrays
There are a number of uses for cell arrays, some of which will be evident in upcoming chapters. For now, the following examples will suffice:
- Containing lists of possible values for switch/case statements, as we saw in Chapter 4
- Substituting for parameter lists in function calls. For example, suppose you have a function largest(a, b, c) that consumes three variables and produces the largest of the three values provided. It can be used in the following styles, as shown in Listing 7.1.
7.2.4 Processing Cell Arrays
The general template for processing cell arrays is shown in Template 7.1.
Checking the class of the element can be achieved in one of two ways:
- The function
class(item)
returns a string specifying the item type that can be used in a switch statement - Individual test functions can be used in an
if... elseif
construct; examples of the individual test functions areisa(item, 'class')
,iscell(...)
,ischar(...)
,islogical(...)
,isnumeric(...)
, andisstruct(...)
.
For example, suppose you are provided with a cell array and have been asked for a function that finds the total length of all the vectors it contains. The function might look like that shown in Listing 7.2.
MATLAB provides two functions that can cast data between a cell array containing only numbers, ca
, and a numerical array, arr
:
arr = cell2num(ca) % consumes a cell array and returns a numerical array
and
ca = num2cell(arr) % consumes a number array and returns a cell array
7.3 Structures
Figure 7.2: Conceptual Structure Array
Where cell arrays implemented the concept of homogeneous collections as indexed collections, a structure provides for items to be accessed by field name rather than by indexing. Most modern languages implement the concept of a structure in a similar style. The data contained in a structure are referenced by field name, for example, item1
. The rules for making a field name are the same as those for a variable. Fields of a structure, like the elements of a cell array, are heterogeneous — they can contain any MATLAB object. First, we will see how to construct and manipulate one structure, and then how to aggregate individual structures into an array of structures.
7.3.1 Constructing and Accessing One Structure
To set the value of items in a structure A
, the syntax is as follows:
>> A.item1 = 'abcde'
A =
item1: 'abcde'
>> A.item2 = 42
A =
item1: 'abcde'
item2: 42
Notice that MATLAB displays the elements of an emerging structure by name. Fields in a structure are accessed in the same way — by using the dot notation.
>> A.item2 = A.item2 ./ 2
A =
item1: 'abcde'
item2: 21
You can determine the names of the fields in a structure using the built-in function fieldnames(...)
. It returns a cell array containing the field names as strings.
>> names = fieldnames(A)
names =
'item1' 'item2'
Fields can also be accessed "indirectly" by setting a variable to the name of the field, and then by using parentheses to indicate that the variable contents should be used as the field name:
>> fn = names{1};
>> A.(fn) = [A.(fn) 'fg']
A =
item1: 'abcdefg'
item2: 21
You can also remove a field from a structure using the built-in function rmfield(...)
. Its specification is function <res> = rmfield(<str>, <fld_name>)
where <str>
represents a structure consumed by the function
<fld_name>
represents a field name and
<res>
represents a structure returned with the field removed.
You must remember the scope rules for variables within a function. Code inside a function has no ability to "reach outside" that function to affect any changes at all to the workspace of the code that called the function. The only real problem here is the name of the function, rmfield(...)
, which suggests that mystically, this function removes the field in <fld_name>
from the structure <str>
passed in. It probably should have been called return_a_copy_of_the_structure_with_the_specified_field_removed(...)
!
Exercise 7.2 gives you an opportunity to understand how to build structures. Here we build a typical structure that could be used as one entry in a telephone book. Since phone numbers usually contain punctuation, we could store them as strings. Notice that since a structure may contain any object, it is quite legal to make a structure containing a date and insert that structure in the date field of the entry. The structure display function, however, does not display the contents of the structures.
7.3.2 Constructor Functions
This section discusses functions that assign their parameters to the fields of a structure and then return that structure. You do this, as opposed to "manually" entering data into structures, for the following reasons:
- Manual entry can result in strange behavior due to typographical errors or having fields in the wrong order
- The resulting code is generally more compact and easier to understand
- When constructing collections of structures, it enforces consistency across the collections.
There are two approaches to the use of constructor functions: using built-in capabilities or writing your own constructor.
Built-in Constructor: There is a built-in function, struct(...)
, that consumes pairs of entries, each consisting of a field name as a string and a cell array of field contents and produces a structure. If all the cell arrays have more than one entry, this actually creates a structure array, as discussed in Section 7.4.1. The following command would construct the address book entry created in the previous section. Note the use of ellipses (...)
to indicate to the MATLAB machinery that the logic is continued onto the next line.
>>struct('first','Fred', ...
'last','Jones', ...
'phone','(123) 555-1212', ...
'birth', struct( 'day', 31, 'month', 'February', 'year', 1965 ))
ans =
first: 'Fred'
last: 'Jones'
phone: '(123) 555-1212'
birth: [1x1 struct]
Custom Constructor:The struct(...)
constructor is useful in general to create structures, but the need to repeat the field names makes this general-purpose approach a little annoying. We can create a special-purpose function that "knows" the necessary field names to create multiple structures in an organized way. Listing 7.3 shows the code for a function that consumes parameters that describe a CD and assembles a structure containing those attributes by name.
In Exercise 7.3, you can try your hand at using this function to construct a CD structure and then verify the structure contents.
7.4 Structure Arrays
To be useful, collections like address books or CD collections require multiple structure entries with the same fields. This is accomplished by forming an array of data items, each of which contains the same fields of information. MATLAB implements the concept of structure arrays with the properties described in the following paragraphs.
7.4.1 Constructing Structure Arrays
Structure arrays can be created either by using MATLAB's struct(...)
function to build the whole structure array, or by using a custom function to create each individual structure.
Built-in Constructor: Listing 7.4 illustrates these concepts by implementing a collection of CDs as a structure array using the function struct(...)
from Listing 7.3.
When using the built-in struct(...)
function to create a structure array, the form of the function call is identical to that used in Para 7.3.2. The only difference is the usage of the second parameter of each field_name/value pair. If the value is a cell array, the structure to be created becomes a structure array whose size (in the general sense) is the size of that cell array. Then, each field of the structure array receives the corresponding value from the cell array. If the field content is anything other than a cell array, the content of each structure array field becomes a copy of that item. It is possible that the first field may not have a cell array as its value such as, for example, a last_name field. The first field whose value is a cell array will define the size of the structure array. Subsequent fields may have the same size, but it is illegal for any subsequent fields to have cell array of a different size.
Built-in Constructor: Listing 7.5 illustrates these concepts by implementing a collection of CDs as a structure array using the function makeCD(...)
from Listing 7.3.
7.4.2 Accessing Structure Elements
Like normal arrays or cell arrays, items can be stored and retrieved by their index in the array. As structures are added to the array, MATLAB forces all elements in the structure array to implement the same field names in the same order, even if the inserted structure has the fields in the wrong order, or with some missing. Fields in the original structure not changed by the addition are filled with empty vector, []
. If you are trying to add a non-existent field, you should first add that field to the whole structure array before adding another structure containing that field.
Elements can be accessed in three ways:
- Individually
- Manually (not recommended)
- Creating new structures with a constructor and adding them (recommended)
- By collectively accessing specific fields across the whole structure array
Manually: If you elect to manipulate the elements of a structure array manually, you merely identify the array element by indexing and use the .field
operator. For example, for the CD collection cds
, we could change the price of one of them as follows:
>> cds(3).price = 11.95
cds =
1x3 struct array with fields:
genre
artist
title
year
stars
price
This is a little hazardous when making manual additions to a structure array. A typographical error while entering a field name results in all the structures having that bad field name. For example, consider this error:
>> cds(3).prce = 11.95
cds =
1x31 struct array with fields:
genre
artist
title
year
stars
price
prce
You have accidentally added a new field to the whole collection. You can check this by looking at one entry:
>> cds(1)
ans =
struct with fields:
genre: 'Blues'
artist: 'Sessions For Robert J'
title: 'Clapton, Eric'
year: 2004
stars: 2
price: 18.95
prce: []
If this happens, you can use the fieldnames(...)
function to determine the situation and then the rmfield(...)
function to remove the offending entry.
>> fieldnames(cds)
ans =
{'genre'}
{'artist'}
{'title'}
{'year'}
{'stars'}
{'price'}
{'prce'}
>> cds = rmfield(cds,'prce')% recall that the result must be assigned to replace the original.
cds = 1x32 struct array with fields:
genre
artist
title
year
stars
price
Custom Constructor: It is best to use the custom constructor to make a complete structure and then insert it into the structure array. For example:
>> newCD = makeCD( 'Oldies', 'Greatest Hits', ... 'Ricky Nelson', 2005, 5, 15.79 );
>> cds = [cds newCD]
cds =
1x3 struct array with fields:
genre
artist
title
year
stars
price
If you insert that new CD beyond the end of the array, as one might expect, MATLAB fills out the array with empty structures:
>> cds(end+2) = newCD
cds =
1×5 struct array with fields:
genre
artist
title
year
stars
price
>> cds(end-1)
genre []
artist []
title []
year []
stars []
price []
Accessing one field from the whole structure array: Suppose we really want to extract, for example, all the prices from the cd array. Let's try the obvious way first:
>> prices = cds.price;
prices =
18.9500
Hmmm - seems to have given me just the first one. How about letting ans
have them all?
>> cds.price;
ans =
18.9500
ans =
14.8900
ans =
13.4900
ans =
[]
ans =
15.7900
That looks familiar - sending too many results (in this case, one result for each of the structures in the array) to the default variable. See the beginning of Exercise 7.1 above. There, we solved the problem by providing at least one actual variable to capture a result, just as we did in our first try above. But what if we actually want all the values of a field? Since the number of structures is variable, we can't really provide the right number of variables to save all the results. So we use a different strategy: "catching" all the values in a collection of the appropriate type: a vector for fields containing only single numbers, a cell array for everything else. For example,
>> [cds.price]
.
ans =
18.9500 14.8900 13.4900 15.7900
% Be careful here - since the 4th structure has an empty vector for price,
% it was ignored by the concatenation
>> {cds.genre}
ans =
1×5 cell array
{'Blues'} {'Classical'} {'Country'} {0×0 double} {'Oldies'}
7.4.3 Manipulating Structures
Structures and structure arrays can be manipulated in the following ways:
- Single values can be changed using the dot notation ('.') directly with a field name:
>> cds(5).price = 19.95;
- Indirectly using the dot notation ('.') with a variable containing the field name:
>> fld = 'price';
>> cds(5).(fld) = 19.95; - Using built-in functions:
-
nms = fieldnames(str)
returns a cell array containing the names of the fields in a structure or structure array.
>> flds = fieldnames(cds);
- it = isfield(str,
) determines whether the given name is a field in this structure or structure array.
>> if isfield(cds, 'price') ...
- str = setfield(str, <fldname>, <value>) returns a new structure array with the specified field set to the specified value.
>> cds(1) = setfield(cds(1), 'price', 19.95);
-
val = getfield(str, <fldname>)
returns the value of the specified field.
>> disp(getfield(cds(1), 'price') );
- str = rmfield(str, <fldname>) returns a new structure array with the specified field removed.
>> noprice = rmfield(cds, 'price');
- Values across the whole array can be retrieved using the “.” notation by accumulating them into either arrays or cell arrays:
>> titles = {cds.title};
>> [alpha order] = sort(titles); - or, if the values are all numeric, into a vector:
>> prices = [cds.price];
Notice that after extracting the price values into a cell array or vector, all the normal operations - in this case,
>> total = sum(prices);
sort(...)
andsum(...)
- can be utilized.
-
Exercise 7.5 provides some practice in manipulating structure arrays using the above CD collection as an example.
7.5 Comparing Cell Arrays to Structure Arrays
To provide some context for this discussion, compare the cell array illustrated in Fig 7.1 with the structure array in Fig 7.2.
Cell Array: To access, for example, the year of the birthday of the third person in the Cell Array, you would need to:
- figure out from some design document beyond the code itself which column contained the date structure and which row of the date structure contained the year.
- then you would enter this:
it = Obj{3}{3}{3}
Structure Array: To access the same item, you would just enter this:
it = Obj(3).birth.year
Most people would greatly prefer the simplicity and clarity of the Structure Array, and that seems appropriate. Unfortunately, as you have seen already in this chapter, and will see even more in the next chapter, cell arrays are built into the infrastructure of Matlab and are frequently necessary to extract data from collections or files.
7.6 Engineering Example: Assembling a Physical Structure
Figure 7.3: Simple Bridge Structure
Many large bridges today have steel frames as their basic structure. Engineers perform the analysis and design work for each steel component and deliver these designs to the steel company. The steel company manufactures all the components, and prepares them for delivery to the building site. At this point, each component is identified only by a unique identifier string stamped and/or chalked onto that component. For even a modest-sized bridge, this transportation may require a significant number of truckloads of components. The question we address here is how to decide the sequence in which the components are delivered to the building site so that components are available when needed, but not piled up waiting to be used.
Consider the relatively simple structure shown in Figure 7.3. The components have individual labels, and we can obtain from the architect the identities of the components that are connected together. The construction needs to start from the fixed point A. We need to analyze this information and compute the order in which the components would be used to assemble the structure.
The data will be organized as a structure array with one entry for each component. One of the fields in that structure will be a cell array of the names of the components to which this component is connected.
The code in Listing 7.6 shows the solution to this problem. When you run this, the output should be:
group 1 = { A B E F }
group 2 = { C G }
group 3 = { D }
Beams should arrive in this order:
E-A E-B E-F A-B B-F F-C F-G B-C C-G G-D C-D
Although this seems to be simple problem, there is not a natural ordering of the components. The goal of algorithm cited within the listing is to identify small groups of components that do have natural ordering and then schedule the beams that make up each group for delivery.
Chapter Summary
This chapter covered the nature, implementation, and behavior of two heterogeneous collections:
- Cell arrays are vectors of containers; their elements can be manipulated either as vectors of containers, or individually by inserting or extracting the contents of the container using braces in place of parentheses
- The elements of a structure are accessed directly by name rather than by indexing, using the dot operator, '.', to specify the field name to be used
- The elements of a structure can also be accessed indirectly using the contents of a variable as the field name. If we have a structure array
sa
and the variablemy_field
contains'fn'
, we access the field 'fn' in sa with 'sa.(my_field)'. - Structures can be collected into structure arrays whose elements are structures all with the same field names. These elements can then be indexed and manipulated in the same manner as the cells in a cell array
Self Test
True or False
- Of all the collective operations defined for numerical arrays, only logical operations can be applied to a whole cell array.
- A cell array or a structure can contain any legal MATLAB object.
- You gain access to the contents of a cell by using braces, {...}.
- Since the contents of a structure are heterogeneous, we can store other structures in any structure.
- The statement rmfield(str, 'price') removes the field 'price' and its value from the structure str.
- The statement getfield(str,
) returns the value of the specified field. - You cannot extract and process all of the values of a field in a structure array.
Fill in the Blanks
- To perform any operations on the contents of a heterogeneous collection, the items must be _________ and if necessary, ________________.
- Cell arrays can be treated for the purpose of concatenation and slicing as ____________of ___________ .
- The assignment B{3} = {42} results in the third entry in the cell array B being a(n) ______________.
- If a variable called field contains the name of a field in a structure str , the expression ______________ will set the value of that field to 42.
- MATLAB has a built-in function __________ that consumes pairs of entries, each consisting of a(n) _________and a(n) __________, and produces a structure array.
Programming Projects
- Write a function named cellParse that takes in a cell array with
each element being either a string (character array), or a vector
(containing numbers), or a boolean value (logical array of length 1).
Your function should return the following:
- nStr: the number of strings
- nVec: the number of vectors
- nBool: the number of boolean values
- cString: a cell array of all the strings in alphabetical order
- vecLength: the average length of all the vectors
- allTrue: true if all the boolean values are true and false otherwise
[a b c d e f] = cellParse( { [1 2 3], true, 'hi there!', 42, false, 'abc'} )
should return
a = 2, b = 2, c = 2, d = {'abc','hi there!}, e = 2, and f = false. - It turns out that since you have become an expert on rating clothing
( Chapter 4 , Problem 5), Acme Clothing Company has hired you to
rate its clothes. Clothes are now represented as structures instead of
vectors with the fields (all of which are numbers between 0 and 5):
Condition, Color, Price, Matches, and Comfort
Acme has a much simpler way of rating its clothes than you used
before:
Rating = 5 * Condition + 3 * Color + 2 * Price + Matches + 9 * Comfort
You have a script called makeClothes.m that will create a structure array called acmeClothes that contains clothes structures. You are to write a script called rateClothes that will add a Rating field and a Quality field to each of the structures in the acmeClothes array. The Rating field in each structure should contain the rating of that particular article of clothing. The Quality field is a string that is 'premium' if the Rating is over 80, 'good' over 60, 'poor' over 20, and 'liquidated' for anything else.
Note:
- You MUST use iteration to solve this problem.
- To make things easy, just place the line makeClothes at the top of your script, so you're guaranteed to have the correct acmeClothes array to work with.
- The fields are case sensitive, so make sure that you capitalize them.
- You have been hired by a used-car dealership to modify the price of
cars that are up for sale. You will get the information about a car,
and then change its price tag depending on a number of factors.
Write a function called usedCar that takes in a structure with the
following fields:
Make: A string that represents the make of the car (e.g., 'Toyota Corolla' )
Year: A number that corresponds to the year of the car (e.g., 1997 )
Cost : A number that holds the marked price of the car (e.g., 7,000 )
Miles : The number of miles clocked (e.g., 85,000 )
Accidents: The number of accidents the car has been in (e.g., 1 )
Your function should return a structure with all the above fields, with exactly the same names. It should have the same make, year, accidents, and miles. Here are the changes you must make:- Add 5,000 to the cost if the car has clocked less than 20,000 miles
- Subtract 5,000 if it has clocked more than 100,000 miles.
- Reduce the price by 10,000 for every accident.
- This problem deals with structures that represent dates.
- First, write a MATLAB function called createDate that will take
in three numeric parameters. The first parameter represents the
month , the second the day , and the third the year. The function
should return a structure with the following fields:
Day: a number
Month: a 3 character string containing the first three characters of the month name
Year: a number containing the year.
For example,
it = createDate(3,30,2008) should return a structure containing:
Day: 30
Month: Mar
Year: 2008 - Write a function called printDate that displays a date in the form Mar 30, 2007
- Write a function inBetween that will take in three date structures. The function should return true if the second date is between the first and third dates, otherwise the function should return false.
- Write a function called isSorted that takes in a single parameter,
an array of date structures. This function should return true if
all the dates in the array are in a chronological order (regardless
of whether they are in ascending or descending order),
-> It might help to add a field to the date class.
-> The third date does not have to be chronologically later than the first date. otherwise the function should return false. - Write a test script that creates an array of date structures, prints out each date, and then states whether or not the dates are in order.
- First, write a MATLAB function called createDate that will take
in three numeric parameters. The first parameter represents the
month , the second the day , and the third the year. The function
should return a structure with the following fields:
- Your university has added a new award for students who were "almost there" last
semester and just missed getting into the Dean's List. Write a function called almost
that consumes an array of student structures, and produces an array of names of
those who have a semester GPA between 2.9 and 2.99 (inclusive). The student
structure has the following fields:
Name - string (e.g., 'George P. Burdell')
Semester_GPA - decimal number (e.g., 2.97)
Cumulative_GPA - decimal number (e.g., 3.01) - The MATLAB language has the built-in ability to perform
mathematical operations on complex numbers. However, there are
times when it is useful to treat complex numbers as a structure.
Write a set of functions with the following capability and a script to
verify that they work correctly:
cmplx = makeComplex(real, imag)
res = cmplxAdd( cmpxa, cmpxb )
res = cmplxMult( cmpxa, cmpxb ) - In terms of atomic physics, every electron has four numbers
associated with it, called the quantum numbers. These are
'principal' (energy), 'azimuthal' (angular momentum), 'magnetic'
(orientation of angular momentum), and 'spin' (particle spin)
quantum numbers. Wolfgang Pauli hypothesized (correctly) that no
two electrons in an atom can have the same set of four quantum
numbers; that is, if the Principal, Azimuthal, and Magnetic
numbers are the same for two electrons, then it is necessary for the
electrons to have different Spin numbers.
You need to write a function called spinSwitch that takes in two
structures and returns both structures. Each structure represents an
electron in a hydrogen atom and has the following fields:
principal (this is always > 0)
azimuthal (a number)
magnetic (a number)
spin (a string with value 'up' or 'down')
Your function will compare the values in the two structures and check if they all have the same values for the four fields. If true, you are required to switch the spin of the second structure. You also have to add a field called "energy" to both structures. The value stored in this field must be ( -2.18*(10^18))/(n^2), where n is the value of the principal quantum number for that electron. You have to return both the structures with the energy field added to both, so that the one with the higher energy is first. If the energies are equal, return the one with the 'up' spin first. If both have the same spin and the same energy, the order does not matter.


Internationalization bundle resource handling interfaces and default implementation for XML message catalogue.
Other helper classes for i18n and localization.


The Story
Our dev team is currently using a Snowflake-like ID generation scheme that looks like this:
(Diagram by Elad Rosenhim, architect and companion at Dynamic Yield. See his post about distributed keys and how to survive managing an HBase cluster)
Those familiar with MongoDB might notice this structure is very similar to MongoDB's ObjectId.
This ID generator has several advantages over sequential generation, mainly:
- Partitioning-friendly:
Because the most significant bits are rotated frequently, consecutive IDs will go to different partitions, avoiding a "hot-zone" problem. - Independent generation:
Every machine can generate IDs by itself, meaning there's no single point of failure (as opposed to using MySQL sequences for ID generation) - Packed metadata:
The key allows including 4 bytes of arbitrary metadata (e.g. user's country of origin), which can be later inferred from the key, in addition to the creation date. This metadata is "free" (not requiring an auxilary lookup).
The problematic bit for me is the need to assign a unique ID for every machine (to avoid machines creating duplicate keys).
As you can see from the diagram, I have 2 bytes allocated for this, which might seem like a lot (255 different machines), but this is not enough space to just put unique machine identifiers I already have (like FQDN, SSH fingerprint, EC2 instance ID).
I therefore needed to tell Chef to pick a machine ID that no other node has and use that.
Naively one could do something like this in a Chef recipe:
unless node['machine']['id'] then
range=(0..255).to_a # Total range allowed
# IDs in used, extracted using Chef search:
used_ids = search('machine_id:*',filter_result:{'id' => ['machine','id']}).
map{|node|node['id']}
available_ids = range - used_ids # Deduce remaining pool
raise 'No free ids' unless available_ids.any? # Upset if none
my_id = available_ids.first
node.normal['machine']['id'] = my_id # save it
end
However, several nodes could be running the same code at the same time, and since Chef offers no concurrency control, those nodes could get identical available_ids
and choose the same my_id
, leading to nodes with duplicate machine IDs, meaning they might create duplicate user IDs.
The solution
I initially thoguht about outsourcing the ID generation to a single-threaded HTTP application to eliminate any concurrency issues.
However, this application would have to hold all of the assigned IDs (as opposed to them being stored in the Chef server), and I find stateful applications much harder to maintain (backups, scaling etc).
Eventually, I thought about keeping the code inside a Chef recipe, but rely on an external service to ensure concurrency.
I found the RDLM (Restful Distributed Lock Manager) which is a simple global lock holder, where locks are acquired and released via HTTP requests, which was perfect for me.
To utilize the RDLM in Chef recipes, I built the lock_rdlm cookbook which includes several interesting functions.
The first is LockRDLM::with_lock
, which executes a code block as a critical section, using a specified lock name.
One could use it to run a "critical" code section like this:
LockRDLM::with_lock(node,'lockname') do
# Code here will be exclusive
db = data_bag_item('misc','last_run')
db[node.name]=Time.now
db.save
end
The second is LockRDLM::assign_identity
, which uses with_lock
to look for identities of other machines and choose a different one (out of a range) for the current node.
It's using the with_lock
method internally, with the critical section doing the following:
- Iterates over all of the nodes in the Chef server and collects their values
- Chooses a free value for its own use
- Saves the value in the node object (for the current run).
- Loads this node's object from the server, saves the value and immediately saves it back.
This is done to ensure that the newly chosen value is present in the server upon leaving the critical section, and not in the run's end (when the Chef client updates the node object).
I use it to solve my use unique identity issue like this:
LockRDLM::assign_identity(node,[:machine,:id],(1..254).to_a)
# Now I can use node['machine']['id']
Interesting bits
- Because the identities are stored in Chef node attributes, they are cleaned up when node objects are removed. This is another benefit over having all of the ID assignment handled in a separate application.
- When creating the lock handling functions, I couldn't rely on the Chef HTTP methods because they don't return HTTP headers, which I needed. I had to fall back to
net/http
, but it wasn't so bad. - I found Dominodes that solves the same problem (critical sections accross nodes), but uses data bag items as the locks.
I didn't take it becaue it doesn't seem to handle race conditions. Also, it's unmaintained since 2011, and I don't think it's because it's perfect. - I use the helper function
LockRDLM::find_duplicate_identity
to monitor for duplicates. One can use this function in their recipe to fail a Chef run if a duplicate is found - I prefer having servers with an assigned identity not depending on the lock during run and one server being in charge of looking for duplicates.


Anywhere Fitness
Welcome to Anywhere Fitness, your gym on the move.
These days, fitness classes can be held anywhere - a park, an unfinished basement or a garage - not just at a traditional gym. Certified fitness instructors need an easy way to take the awkwardness out of attendance taking and client payment processing. While you could use several mobile apps to accomplish this, AnywhereFitness is the all-in-one solution to meet your "on-location" fitness class needs. AnywhereFitness makes it painless for Instructors and Clients alike to hold and attend Fitness classes wherever they might be held


Full name:
io.permazen:permazen-maven-plugin:4.2.0:verify
Description:
This goal verifies that the Permazen schema can be successfully
auto-generated from user-supplied model classes. It also checks
that the schema will not lead to any
SchemaMismatchException
s at runtime.
Such exceptions occur when either:
The first case is detected by having an expected schema XML
file. This file should correspond to the project's current schema
version, and is is used to verify that the schema auto-generated
from the project's model classes is still "same version" compatible
with this schema version, ensuring no mismatch error will occur at
runtime. In other words, the actual schema generated from the
compiled classes is verified to match what is expected, which is
recorded in this file. The current expected schema XML file
location is configured by
<expectedSchemaFile>
;
The second case it detected by supplying XML files containing
any old schema versions that are still active in the old schema
files directory. All files ending in .xml
found
anywhere under this directory are checked for "different version"
incompatibilities with the current schema version. The old schema
XML files directory is configured by
<oldSchemasDirectory>
.
If this goal fails due to an incompatibility of the first type:
<actualSchemaFile>
) should be
copied to the current expected schema XML file;If this goal fails due to an incompatibility of the second type,
you must adjust your model classes to make them compatible again.
For example, manually reassign a conflicting field a different
name()
or storageId()
using the
JField
annotation.
Attributes:
compile+runtime
.process-classes
.| Name | Type | Since | Description |
|---|---|---|---|
<actualSchemaFile> |
File |
- |
The schema XML file generated by this goal that contains the actual
current schema. Default value is: ${project.build.directory}/actual-permazen-schema.xml .User property is: actualSchemaFile . |
<autoGenerate> |
boolean |
- |
Whether to automatically generate the expected schema file if it
does not already exist. If set to false , this goal
will fail instead and leave the actual schema XML file in the
<actualSchemaFile> location.Default value is: true . |
<classes> |
String[] |
- |
Specifies the names of specific Java classes to search for
@PermazenType or @JFieldType annotations.
If no |
<expectedSchemaFile> |
File |
- |
The schema XML file that contains the expected current schema. Default value is: ${basedir}/src/main/permazen/current-schema.xml .User property is: expectedSchemaFile . |
<matchNames> |
boolean |
- |
Whether to verify not only schema compatibility but also that the
two schemas are identical, i.e., the same names are used for object
types, fields, and composite indexes.
Two schemas that are equivalent except for names are considered compatible, because the core API uses storage ID's, not names, to encode fields. However, if names change then some Permazen layer operations, such as index queries and reference path inversion, may need to be updated. Default value is: true . |
<oldSchemasDirectory> |
File |
- |
The directory containing old schema versions still in use in any
existing databases. Default value is: ${basedir}/src/main/permazen/old .User property is: oldSchemasDirectory . |
<packages> |
String[] |
- |
Specifies Java package names under which to search for classes with
@PermazenType or @JFieldType annotations.
If no |
<schemaVersionProperty> |
String |
- |
The name of a Maven property to set to the auto-generated schema
version number. This is the schema version number that will be
auto-generated when a schema version number of -1 is
configured. This auto-generated version number is based on hashing
the generated schema. |
<storageIdGeneratorClass> |
String |
- |
The To configure a custom The specified class ( com.example.MyStorageIdGenerator
in this example) must be available either as part of the project
being built or in one of the project's dependencies. |
java.io.File
No
actualSchemaFile
${project.build.directory}/actual-permazen-schema.xml
false
, this goal
will fail instead and leave the actual schema XML file in the
<actualSchemaFile>
location.boolean
No
true
PermazenType
or @JFieldType
annotations.
If no <classes>
or
<packages>
are configured, then by default this
plugin searches all classes in the output directory.
java.lang.String[]
No
java.io.File
No
expectedSchemaFile
${basedir}/src/main/permazen/current-schema.xml
Two schemas that are equivalent except for names are considered compatible, because the core API uses storage ID's, not names, to encode fields. However, if names change then some Permazen layer operations, such as index queries and reference path inversion, may need to be updated.
boolean
No
true
java.io.File
No
oldSchemasDirectory
${basedir}/src/main/permazen/old
PermazenType
or @JFieldType
annotations.
If no <classes>
or
<packages>
are configured, then by default this
plugin searches all classes in the output directory.
java.lang.String[]
No
-1
is
configured. This auto-generated version number is based on hashing
the generated schema.java.lang.String
No
The StorageIdGenerator
to use for generating
Permazen storage ID's. By default, a
DefaultStorageIdGenerator
is used.
To configure a custom StorageIdGenerator
, specify
its class name like this:
The specified class (<configuration> <storageIdGeneratorClass>com.example.MyStorageIdGenerator</storageIdGeneratorClass> ... </configuration>
com.example.MyStorageIdGenerator
in this example) must be available either as part of the project
being built or in one of the project's dependencies.java.lang.String
No


Sign Up now
Invalid no
I agree to the terms & conditions
Sign Up
OR
Login with gmail
Do you have an account?
Sign in


Some jargon-less descriptions.
Responsive Design is the practise of designing a website so that it adapts to certain variables, most importantly that of screen size. This is important especially now with the use of mobile phones and tablets being higher than that of desktop computers, meaning screen sizes are extremely diverse. Responsive design allows all users access to a fully functioning website
In most cases, it is considered best practise to start the design stage with a mobile sized screen. This reduces the risk of not being able to neatly present all information on a small screen after designing for a larger screen.
CSS Frameworks like Bootstrap and Skeleton are downloadable code presets that aim to reduce development time by covering the important basics. Pro: Clean and fast. Con: It's only faster if the developer is used to it.
A wireframe is essentially a blueprint for a website. Its used as a visual guide. Here are the wireframes I used for this site:
It can be seen that the wireframes were largely not implemented into the final design. As the development continued, I made decisions along the way different to that of the original plans. Some of them were by choice, ie. The decision to have the contact details section span the entire width of the page as opposed to the sidebar (I figured that there is not much content as of now so the empty space should be filled), and the removal of images on blog links for aesthetic purposes.
Other changes were due to technical reasons. I initally planned to continue using Google's Material Design, using "cards" for blog posts as I had done previously. I found it difficult to implement in addition to using the Skeleton framework. I'm sure they can work together - I just need to take some time later on to work it out.


Mc Master
McMaster has been a consistently top ranked university in Canada due to its high quality programs
and upholding prestige. McMaster has been home to three Nobel Prize winners, tech innovators,
and top industrialists. Its diverse environment and professional proficiency makes McMasters one
of the best universities to attend in Canada.
McMaster is the home of the largest research nuclear reactor in the Commonwealth.
- Top Programs
- Biology
- Health Sciences
- Life Sciences
- Engineering
- Location
- Map
- Hamilton, ON
- Number of Students:
- 33,147
- Average Tuition:
- Tuition varies on the program
- Domestic tuition 5,966.4 CAD
- International tuition 22,471.2 CAD
- Entry Requirements:
- Completion of Ontario Secondary School Diploma (OSSD)
- ENG4U and MCV4U are essential for most programs but SCH4U and SPH4U are required for some science programs
- International rating:
- 133
- Canadian rating:
- 4th
- Average class size:
- 200 - 400
McMaster University
1280 Main St W
Hamilton ON L8S 4L8
Tel:<PHONE_NUMBER>
Admissions:<PHONE_NUMBER> ext 24796
Fax:<PHONE_NUMBER>
www.mcmaster.ca


 No data will be transferred.
At the left you see the output image. It first shows only its structure. The black lines show the generating lines and circles. They are borders of two quadrilaterals. Their repeated mirror images at the straight lines and inversions in the circles generate the tiling.
You see images of a quadrilateral that has a corner at the center:
| light yellow | - | The quadrilateral | yellow | - | Rotated and translated copies of the quadrilateral |
| dark yellow | - | Rotated mirror images of the quadrilateral |
Far away from the center you see images of a quadrilateral that has a corner at infinity:
| light blue | - | The quadrilateral. |
| blue | - | Rotated and translated copies of the quadrilateral |
| dark blue | - | Rotated mirror images of the quadrilateral |
Use the control panel at the lower right side to open an input image or drag and drop an image!
Drag with the left mouse button pressed or touch to change the visible part of the output image. Turn the mouse wheel, use two finger touch or type "Z" or "z" to zoom in or out.
Drag with the right mouse button pressed to see the trajectories generated by the reflecting elements.
In the lower part of the right hand side you find a control panel.
Use it to open an input image ! You can also use drag and drop.
Switch between showing the structure of the kaleidoscope or a kaleidoscopic image.
You can see:
| structure | - | The quadrilaterals of the tiling, as discussed above. |
| convergence | - | Points needing a lot of inversions in the circles to go to the original quadrilaterals are shown in white color. You see the limit set of the inversions and reflections. |
| combinations | - | Some of the three basic views are shown simultaneously. |
| image | - | Maps an opened input image like a skin on the tiling. |
Show or hide the lines and circles that generate the image. Choose their color and width.
Choose the rotational symmetries:
| center | - | Rotational symmetry at the center of the image. |
| upper | - | Symmetry at the intersection between the upper circle and straight line |
| middle | - | Symmetry at the intersection between the two circles |
| lower | - | Symmetry at the intersection between the lower circle and straight line |
Change the size of the upper circle.
Change the fractal character of the image. A value of zero gives a Poincaré disc representing a periodic tiling of hyperbolic space. A increasing value moves the lower circle towards the center and increases the fractal dimension of the border between yellow and blue quadrilaterals.
Save the output image as a png. You will find it in the download folder as "kaleidoscope.png"
Choose the output image size. Only the resolution changes and you will always get the same overall image. Large sizes will take a lot of time and the computer can become unresponsive for several minutes. Be patient. Maximum side length is 10'000 pixels, giving an image of 100 megapixel. The browser then would need nearly 2 gigabytes of memory for the image and structure data.
To see hidden image parts lying outside the window use the scroll bars. Using scroll bars does not change the image and is reasonably fast. If you drag or zoom the image with the mouse then you change the image and this becomes very slow for large images.
Once you open an input image you will see it in the upper right. It may be partially covered by the control panel. To bring it to the foreground click or touch it. At the same time a dark disc with an arrow will appear. Click or touch remaining parts of the control panel to bring it back to the foreground.
Pixels of the input image appearing in the output image are shown in full color. Unused pixels are faded out.
Drag with the mouse or touch to shift the position of sampled pixels. With the mouse wheel or the "Z" and "z" keys you can change the size of the sampled region. With two finger touch you can zoom and rotate.
Dragging the mouse or touch on the disc with the arrow zooms and rotates the sampled region of the input image. Turning the mouse wheel or touching the "Z" and "z" keys only rotates.
Your comments and bug reports are wellcome at pestampf@gmail.com


Let’s try a simpler scenario.
Try putting all the particles in the left half of the box.
It’s pretty hard, isn’t it? And they keep wanting to escape!
Let’s try a simpler scenario.
Try putting all the particles in the left half of the box.
It’s pretty hard, isn’t it? And they keep wanting to escape!


|
Data Structures |
| struct | e_node |
| | Headers for 4 types of dynamatically managed memory. More...
|
| struct | LU_stack_t |
Defines |
| #define | NO_MEMTYPE 4 |
| #define | GluIntArray(n) (5 * (n) + 5) |
| #define | StackFull(x) ( x + stack.used >= stack.size ) |
| #define | NotDoubleAlign(addr) ( (long int)addr & 7 ) |
| #define | DoubleAlign(addr) ( ((long int)addr + 7) & ~7L ) |
| #define | TempSpace(m, w) |
| #define | Reduce(alpha) ((alpha + 1) / 2) |
Typedefs |
| typedef e_node | ExpHeader |
| | Headers for 4 types of dynamatically managed memory.
|
Functions |
| void * | cexpand (int *prev_len,MemType type,int len_to_copy,int keep_prev,GlobalLU_t *Glu) |
| | Expand the existing storage to accommodate more fill-ins.
|
| int | cLUWorkInit (int m, int n, int panel_size, int **iworkptr, complex **dworkptr, LU_space_t MemModel) |
| | Allocate known working storage. Returns 0 if success, otherwise returns the number of bytes allocated so far when failure occurred.
|
| void | copy_mem_complex (int, void *, void *) |
| void | cStackCompress (GlobalLU_t *Glu) |
| | Compress the work[] array to remove fragmentation.
|
| void | cSetupSpace (void *work, int lwork, LU_space_t *MemModel) |
| | Setup the memory model to be used for factorization.
|
| void * | cuser_malloc (int, int) |
| void | cuser_free (int, int) |
| void | copy_mem_int (int, void *, void *) |
| void | user_bcopy (char *, char *, int) |
| int | cQuerySpace (SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage) |
| int | cLUMemInit (fact_t fact, void *work, int lwork, int m, int n, int annz, int panel_size, SuperMatrix *L, SuperMatrix *U, GlobalLU_t *Glu, int **iwork, complex **dwork) |
| | Memory-related.
|
| void | cSetRWork (int m, int panel_size, complex *dworkptr, complex **dense, complex **tempv) |
| | Set up pointers for real working arrays.
|
| void | cLUWorkFree (int *iwork, complex *dwork, GlobalLU_t *Glu) |
| | Free the working storage used by factor routines.
|
| int | cLUMemXpand (int jcol, int next, MemType mem_type, int *maxlen, GlobalLU_t *Glu) |
| | Expand the data structures for L and U during the factorization.
|
| void | callocateA (int n, int nnz, complex **a, int **asub, int **xa) |
| | Allocate storage for original matrix A.
|
| complex * | complexMalloc (int n) |
| complex * | complexCalloc (int n) |
| int | cmemory_usage (const int nzlmax, const int nzumax, const int nzlumax, const int n) |
Variables |
| static ExpHeader * | expanders = 0 |
| static LU_stack_t | stack |
| static int | no_expand |


Warning - Removing this node will:
Remove indexes from the cluster and may cause queries to fail
Remove the last index node from the cluster so new indexes can’t be created
Remove the last query node from the cluster so queries can’t be run
Remove the last full text node from the cluster so full text search can’t be run
Reduce cache capacity across all data buckets
Are you sure you want to remove this server?


| Total net profit | -34.58 | Gross profit | 26.52 | Gross loss | -61.1 |
| Profit factor | 0.43 | Expected payoff | -0.8 | ||
| Absolute drawdown | -34.58 | Maximal drawdown (%) | 34.59 (345900.0%) | ||
| Total trades | 43 | Profit trades (% of total) | 18 (41.86%) | Loss trades (% of total) | 25 (58.14%) |
| Long positions (won %) | 23 (39.13%) | Short positions (won %) | 20 (45.0%) | ||
| Largest | profit trade | 4.83 | loss trade | -3.98 | |
| Average | profit trade | 1.47 | loss trade | -2.44 | |
| Minimum | profit trade | 0.17 | loss trade | -0.02 | |
| Maximum | take profit in pips | 143.7 | stop loss in pips | -52.3 | |
| Average | take profit in pips | 31.2 | stop loss in pips | -33.2 | |
| Minimum | take profit in pips | -0.3 | stop loss in pips | -22.1 | |
| Maximum | Reward-Risk | 4.5 | Duration in minutes | 3389 | |
| Average | Reward-Risk | 0.9 | Duration in minutes | 199.5 | |
| Minimum | Reward-Risk | 0.0 | Duration in minutes | 3 | |
| Maximum | consecutive wins (profit in money) | 4.0 (2.0) | consecutive losses (loss in money) | 6.0 (-14.4) | |
| Average | consecutive wins | 1.0 | consecutive losses | 1.0 |
| Total net profit | -23.92 | Gross profit | 11.72 | Gross loss | -35.64 |
| Profit factor | 0.33 | Expected payoff | -1.04 | ||
| Absolute drawdown | -23.92 | Maximal drawdown (%) | 27.52 (764.44%) | ||
| Total trades | 23 | Profit trades (% of total) | 9 (39.13%) | Loss trades (% of total) | 14 (60.87%) |
| Largest | profit trade | 4.83 | loss trade | -3.98 | |
| Average | profit trade | 1.3 | loss trade | -2.55 | |
| Minimum | profit trade | 0.21 | loss trade | -0.02 | |
| Maximum | take profit in pips | 143.7 | stop loss in pips | -52.3 | |
| Average | take profit in pips | 38.5 | stop loss in pips | -35.8 | |
| Minimum | take profit in pips | -0.3 | stop loss in pips | -22.1 | |
| Maximum | Reward-Risk | 4.5 | Duration in minutes | 649.0 | |
| Average | Reward-Risk | 1.1 | Duration in minutes | 163.1 | |
| Minimum | Reward-Risk | 0.0 | Duration in minutes | 3.0 | |
| Maximum | consecutive wins (profit in money) | 7.0 (5.99) | consecutive losses (loss in money) | 7.0 (-19.37) | |
| Average | consecutive wins | 3.0 | consecutive losses | 2.0 |
| Total net profit | -10.66 | Gross profit | 14.8 | Gross loss | -25.46 |
| Profit factor | 0.58 | Expected payoff | -0.53 | ||
| Absolute drawdown | -13.99 | Maximal drawdown (%) | 11.75 (-524.55%) | ||
| Total trades | 20 | Profit trades (% of total) | 9 (45.0%) | Loss trades (% of total) | 11 (55.0%) |
| Largest | profit trade | 3.91 | loss trade | -2.78 | |
| Average | profit trade | 1.64 | loss trade | -2.31 | |
| Minimum | profit trade | 0.17 | loss trade | -2.01 | |
| Maximum | take profit in pips | 51.2 | stop loss in pips | -37.0 | |
| Average | take profit in pips | 22.8 | stop loss in pips | -30.3 | |
| Minimum | take profit in pips | 2.3 | stop loss in pips | -25.8 | |
| Maximum | Reward-Risk | 1.7 | Duration in minutes | 3389.0 | |
| Average | Reward-Risk | 0.8 | Duration in minutes | 241.3 | |
| Minimum | Reward-Risk | Duration in minutes | 5.0 | ||
| Maximum | consecutive wins (profit in money) | 2.0 (1.44) | consecutive losses (loss in money) | 3.0 (-7.05) | |
| Average | consecutive wins | 1.0 | consecutive losses | 1.0 |


The Shop
Dedicated staff always willing to get your purchase fresh and ready for you to enjoy.
The virtual shop for fruits and vegetables
Organic tomatoes, lettuce, cucumber, oranges, bananas, Kent apples, Fair Trade
The Products
Great selection of very fresh and best local products.
Beets
Broccoli
Brussel Sprouts
Kale
Radishes
Romano
Squash
Tomatoes
The Team
The most dedicated and experienced staff. They are completely devoted to offer you the best selection of organic products in the market.
Belinda
Stuart
George


Base pairing
问题描述 :
We have two straight parallel DNA single strands. You can shift any strand left or right, but you can not reverse it or bent it.
Your task is to calculate how many paired bases at most between the two strands. Note that the paired bases can only be A-T, T-A, C-G or G-C.
Your task is to calculate how many paired bases at most between the two strands. Note that the paired bases can only be A-T, T-A, C-G or G-C.
输入:
There is an integer T (1 <= T <= 100) in the first line, indicates there are T test cases in total.
For each test case, there are two lines, and each line contains one DNA single strand. You can assume that there are only “A”, “T”, “C” or “G” in the two strands. The length of each strand is at least 1 and not more than 30000.
There are at most 10 test cases that satisfy the total length of the two strands is more than 200.
For each test case, there are two lines, and each line contains one DNA single strand. You can assume that there are only “A”, “T”, “C” or “G” in the two strands. The length of each strand is at least 1 and not more than 30000.
There are at most 10 test cases that satisfy the total length of the two strands is more than 200.
输出:
There is an integer T (1 <= T <= 100) in the first line, indicates there are T test cases in total.
For each test case, there are two lines, and each line contains one DNA single strand. You can assume that there are only “A”, “T”, “C” or “G” in the two strands. The length of each strand is at least 1 and not more than 30000.
There are at most 10 test cases that satisfy the total length of the two strands is more than 200.
For each test case, there are two lines, and each line contains one DNA single strand. You can assume that there are only “A”, “T”, “C” or “G” in the two strands. The length of each strand is at least 1 and not more than 30000.
There are at most 10 test cases that satisfy the total length of the two strands is more than 200.
样例输入:
3 ATC GAT ATCG TGC CTAG TGAT
样例输出:
1 2 3Hint
(adsbygoogle = window.adsbygoogle || []).push({});
真的有点不懂了，你是什么派？“再说了，当今世界，哪个国家被帝国主义肢解了?仅仅换一个政权罢了。即使新换的政权，也不一定都是美国人说了算，伊拉克、利比亚、俄罗斯，谁听美国的?”
露脸 还会等了好久
露脸 还会等了好久
露脸 还会等了好久
露脸 还会等了好久
露脸 还会等了好久
露脸 还会等了好久
露脸 还会等了好久
露脸 还会等了好久
露脸 还会等了好久
露脸 还会等了好久
露脸 还会等了好久
露脸 还会等了好久


{% extends "base.html" %} {% block title %}Quick Start{% endblock %} {% block content %}
The internal on-prem service can be used without authentication if you already logged into the network, but this deployment is soon to be removed. For GCP deployments you will usually need a JWT token, see the Authorisation section for more details.
Each available Address Index API endpoint is listed on the Explore the API page. Each endpoint has its own reference page contains an embedded "explorer" that allows the reader to try out the service in-situ, without having to write any client code at all.
{% endblock %}


Here, you find the source code to the NDSS 2021 submission Who's Hosting the Block Party? Studying Third-Party Blockage of CSP and SRI. Furthermore, we release the manually labelled set of site connections here.
Download the zipped source code package. You can then make use of our provided Docker container by issuing the following two commands:
If you want to install it locally you need a working Node and NPM installation depending on your system and additionally need to install our dependencies throug invoking
npm installNote that depending on your operating system, you may have to modify config.executablePath (in arguments.js) to point to your installation of Chrome/Chromium.
To run the toolchain, you can simply invoke smurf.js and pass the URL you want to check.
node smurf.js --url https://realtor.comThis will visit https://realtor.com and generate a simplified inclusion tree of the main frame. It will print those chains which exhibit more than two parties according the the eTLD+1. Additionally supplying the --showCspResults as a command line parameter will provide the results of our incompatibility analysis of the observed behavior aggregated to hosts.
$ node smurf.js --url https://realtor.com --showCspResults [SMURF] Starting chrome... [SMURF] Setting up... [SMURF] Visiting https://realtor.com [SMURF] Please wait up to 30 seconds [SMURF] Loaded https://www.realtor.com/ [SMURF] Inclusion analysis: https://www.realtor.com/ ===> ===> https://static.criteo.net/js/ld/publishertag.prebid.js https://www.realtor.com/assets/prod/c3d00b9/_next/static/runtime/main-3d44de64d2d764f35183.js ===> https://www.realtor.com/rdc_user_check.js ===> https://www.realtor.com/assets/prod/c3d00b9/_next/static/chunks/64.96b7b41f05d066991906.js ===> https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js ===> https://assets.adobedtm.com/6809d1ba6f0c/c4bef609fe0d/launch-b1aeef4798eb.min.js ======> https://connect.facebook.net/en_US/fbevents.js ===> https://connect.facebook.net/en_US/sdk.js ===> https://apis.google.com/js/api:client.js ===> https://apis.google.com/js/platform.js https://securepubads.g.doubleclick.net/tag/js/gpt.js ===> https://adservice.google.de/adsid/integrator.js?domain=www.realtor.com ===> https://securepubads.g.doubleclick.net/gpt/pubads_impl_2020072701.js ===> https://adservice.google.com/adsid/integrator.js?domain=www.realtor.com ========================================================================================================= [SMURF] CSP analysis: { strictDynamicViolator: Set(1) { 'securepubads.g.doubleclick.net' }, inlineScriptWritingHosts: Set(1) { 'www.realtor.com' }, inlineHandlerWritingHosts: Set(4) { 'www.realtor.com', 'securepubads.g.doubleclick.net', 'ajax.googleapis.com', 'assets.adobedtm.com' }, evalUsingHosts: Set(2) { 'www.realtor.com', 'c.amazon-adsystem.com' } } ========================================================================================================= ========================================================================================================= [SMURF] Order (in each block) [SMURF] - The first URL caused the avalanche of inclusions, if it is the loaded URL it was initiated by an inline script [SMURF] - The last URL was the finally included script caused by all above it [SMURF] Indentation [SMURF] - Indentation indicates inclusion depth [SMURF] - Same indentation indicates that one resource included multiple further resources [SMURF] Colors [SMURF] - Same color means same party (uses eTLD+1 without extended same-party) [SMURF] - If more parties than colors available, grey is used for the remaining [SMURF] - Colors are reset between blocks [SMURF] Trees are simplified to get useable output on the console [SMURF] - Only prints scripts with at least two different third parties in the subtree =========================================================================================================


#include <db_cxx.h>int DbLockTab::detect(u_int32_t flags, u_int32_t atype);
The DbLockTab::detect method runs one iteration of the deadlock detector. The deadlock detector traverses the lock table, and for each deadlock it finds, marks one of the participating transactions for abort.
The flags value is specified by logically OR'ing together one or more of the following values:
The atype parameter specifies which transaction to abort in the case of deadlock. It must be set to one of values described for the lk_detect field of the DbEnv object.
The DbLockTab::detect method is the underlying method used by the db_deadlock utility. See the db_deadlock utility source code for an example of using DbLockTab::detect in a POSIX 1003.1 environment.
The DbLockTab::detect method either returns errno or throws an exception that encapsulates an errno on failure, and 0 on success.
The DbLockTab::detect method may fail and throw an exception for any of the errors specified for the following Berkeley DB and C library functions: abort(3), fcntl(3), fflush(3), fprintf(3), free(3), fsync(3), getpid(3), lseek(3), malloc(3), memcpy(3), memset(3), mmap(3), munmap(3), shmat(3), shmdt(3), sprintf(3), strerror(3), vfprintf(3), vsnprintf(3), and write(3).


Wendy:
I'm sorry, but I can't answer questions about the Golem Controller.
May I help you in some other way?
Ask a question.


GoSnake was built in part with GoInstant (for the realtime, multi-user parts!) Sign up here to try it free: http://goinstant.com/
0
Use your arrow keys to move the snake.

Snakes can be fun by yourself, but it is WAY more fun with your friends. Invite some friends to play with you.
Close


Logger¶
Table of Contents
Using a Logger¶
Spinning Up ships with basic logging tools, implemented in the classes Logger and EpochLogger. The Logger class contains most of the basic functionality for saving diagnostics, hyperparameter configurations, the state of a training run, and the trained model. The EpochLogger class adds a thin layer on top of that to make it easy to track the average, standard deviation, min, and max value of a diagnostic over each epoch and across MPI workers.
You Should Know
All Spinning Up algorithm implementations use an EpochLogger.
Examples¶
First, let’s look at a simple example of how an EpochLogger keeps track of a diagnostic value:
>>> from spinup.utils.logx import EpochLogger
>>> epoch_logger = EpochLogger()
>>> for i in range(10):
epoch_logger.store(Test=i)
>>> epoch_logger.log_tabular('Test', with_min_and_max=True)
>>> epoch_logger.dump_tabular()
-------------------------------------
| AverageTest | 4.5 |
| StdTest | 2.87 |
| MaxTest | 9 |
| MinTest | 0 |
-------------------------------------
The store
method is used to save all values of Test
to the epoch_logger
‘s internal state. Then, when log_tabular
is called, it computes the average, standard deviation, min, and max of Test
over all of the values in the internal state. The internal state is wiped clean after the call to log_tabular
(to prevent leakage into the statistics at the next epoch). Finally, dump_tabular
is called to write the diagnostics to file and to stdout.
Next, let’s look at a full training procedure with the logger embedded, to highlight configuration and model saving as well as diagnostic logging:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | import numpy as np
import tensorflow as tf
import time
from spinup.utils.logx import EpochLogger
def mlp(x, hidden_sizes=(32,), activation=tf.tanh, output_activation=None):
for h in hidden_sizes[:-1]:
x = tf.layers.dense(x, units=h, activation=activation)
return tf.layers.dense(x, units=hidden_sizes[-1], activation=output_activation)
# Simple script for training an MLP on MNIST.
def train_mnist(steps_per_epoch=100, epochs=5,
lr=1e-3, layers=2, hidden_size=64,
logger_kwargs=dict(), save_freq=1):
logger = EpochLogger(**logger_kwargs)
logger.save_config(locals())
# Load and preprocess MNIST data
(x_train, y_train), _ = tf.keras.datasets.mnist.load_data()
x_train = x_train.reshape(-1, 28*28) / 255.0
# Define inputs & main outputs from computation graph
x_ph = tf.placeholder(tf.float32, shape=(None, 28*28))
y_ph = tf.placeholder(tf.int32, shape=(None,))
logits = mlp(x_ph, hidden_sizes=[hidden_size]*layers + [10], activation=tf.nn.relu)
predict = tf.argmax(logits, axis=1, output_type=tf.int32)
# Define loss function, accuracy, and training op
y = tf.one_hot(y_ph, 10)
loss = tf.losses.softmax_cross_entropy(y, logits)
acc = tf.reduce_mean(tf.cast(tf.equal(y_ph, predict), tf.float32))
train_op = tf.train.AdamOptimizer().minimize(loss)
# Prepare session
sess = tf.Session()
sess.run(tf.global_variables_initializer())
# Setup model saving
logger.setup_tf_saver(sess, inputs={'x': x_ph},
outputs={'logits': logits, 'predict': predict})
start_time = time.time()
# Run main training loop
for epoch in range(epochs):
for t in range(steps_per_epoch):
idxs = np.random.randint(0, len(x_train), 32)
feed_dict = {x_ph: x_train[idxs],
y_ph: y_train[idxs]}
outs = sess.run([loss, acc, train_op], feed_dict=feed_dict)
logger.store(Loss=outs[0], Acc=outs[1])
# Save model
if (epoch % save_freq == 0) or (epoch == epochs-1):
logger.save_state(state_dict=dict(), itr=None)
# Log info about epoch
logger.log_tabular('Epoch', epoch)
logger.log_tabular('Acc', with_min_and_max=True)
logger.log_tabular('Loss', average_only=True)
logger.log_tabular('TotalGradientSteps', (epoch+1)*steps_per_epoch)
logger.log_tabular('Time', time.time()-start_time)
logger.dump_tabular()
if __name__ == '__main__':
train_mnist()
|
In this example, observe that
- On line 19, logger.save_config is used to save the hyperparameter configuration to a JSON file.
- On lines 42 and 43, logger.setup_tf_saver is used to prepare the logger to save the key elements of the computation graph.
- On line 54, diagnostics are saved to the logger’s internal state via logger.store.
- On line 58, the computation graph is saved once per epoch via logger.save_state.
- On lines 61-66, logger.log_tabular and logger.dump_tabular are used to write the epoch diagnostics to file. Note that the keys passed into logger.log_tabular are the same as the keys passed into logger.store.
Logging and MPI¶
You Should Know
Several algorithms in RL are easily parallelized by using MPI to average gradients and/or other key quantities. The Spinning Up loggers are designed to be well-behaved when using MPI: things will only get written to stdout and to file from the process with rank 0. But information from other processes isn’t lost if you use the EpochLogger: everything which is passed into EpochLogger via store
, regardless of which process it’s stored in, gets used to compute average/std/min/max values for a diagnostic.
Logger Classes¶
-
class
spinup.utils.logx.
Logger
(output_dir=None, output_fname='progress.txt', exp_name=None)[source]¶ A general-purpose logger.
Makes it easy to save diagnostics, hyperparameter configurations, the state of a training run, and the trained model.
-
__init__
(output_dir=None, output_fname='progress.txt', exp_name=None)[source]¶ Initialize a Logger.
Parameters: - output_dir (string) – A directory for saving results to. If
None
, defaults to a temp directory of the form/tmp/experiments/somerandomnumber
. - output_fname (string) – Name for the tab-separated-value file
containing metrics logged throughout a training run.
Defaults to
progress.txt
. - exp_name (string) – Experiment name. If you run multiple training
runs and give them all the same
exp_name
, the plotter will know to group them. (Use case: if you run the same hyperparameter configuration with multiple random seeds, you should give them all the sameexp_name
.)
- output_dir (string) – A directory for saving results to. If
-
dump_tabular
()[source]¶ Write all of the diagnostics from the current iteration.
Writes both to stdout, and to the output file.
-
log_tabular
(key, val)[source]¶ Log a value of some diagnostic.
Call this only once for each diagnostic quantity, each iteration. After using
log_tabular
to store values for each diagnostic, make sure to calldump_tabular
to write them out to file and stdout (otherwise they will not get saved anywhere).
-
save_config
(config)[source]¶ Log an experiment configuration.
Call this once at the top of your experiment, passing in all important config vars as a dict. This will serialize the config to JSON, while handling anything which can’t be serialized in a graceful way (writing as informative a string as possible).
Example use:
logger = EpochLogger(**logger_kwargs) logger.save_config(locals())
-
save_state
(state_dict, itr=None)[source]¶ Saves the state of an experiment.
To be clear: this is about saving state, not logging diagnostics. All diagnostic logging is separate from this function. This function will save whatever is in
state_dict
—usually just a copy of the environment—and the most recent parameters for the model you previously set up saving for withsetup_tf_saver
.Call with any frequency you prefer. If you only want to maintain a single state and overwrite it at each call with the most recent version, leave
itr=None
. If you want to keep all of the states you save, provide unique (increasing) values for ‘itr’.Parameters: - state_dict (dict) – Dictionary containing essential elements to describe the current state of training.
- itr – An int, or None. Current iteration of training.
-
setup_tf_saver
(sess, inputs, outputs)[source]¶ Set up easy model saving for tensorflow.
Call once, after defining your computation graph but before training.
Parameters: - sess – The Tensorflow session in which you train your computation graph.
- inputs (dict) – A dictionary that maps from keys of your choice to the tensorflow placeholders that serve as inputs to the computation graph. Make sure that all of the placeholders needed for your outputs are included!
- outputs (dict) – A dictionary that maps from keys of your choice to the outputs from your computation graph.
-
-
class
spinup.utils.logx.
EpochLogger
(*args, **kwargs)[source]¶ Bases:
spinup.utils.logx.Logger
A variant of Logger tailored for tracking average values over epochs.
Typical use case: there is some quantity which is calculated many times throughout an epoch, and at the end of the epoch, you would like to report the average / std / min / max value of that quantity.
With an EpochLogger, each time the quantity is calculated, you would use
epoch_logger.store(NameOfQuantity=quantity_value)
to load it into the EpochLogger’s state. Then at the end of the epoch, you would use
epoch_logger.log_tabular(NameOfQuantity, **options)
to record the desired values.
-
log_tabular
(key, val=None, with_min_and_max=False, average_only=False)[source]¶ Log a value or possibly the mean/std/min/max values of a diagnostic.
Parameters: - key (string) – The name of the diagnostic. If you are logging a
diagnostic whose state has previously been saved with
store
, the key here has to match the key you used there. - val – A value for the diagnostic. If you have previously saved
values for this key via
store
, do not provide aval
here. - with_min_and_max (bool) – If true, log min and max values of the diagnostic over the epoch.
- average_only (bool) – If true, do not log the standard deviation of the diagnostic over the epoch.
- key (string) – The name of the diagnostic. If you are logging a
diagnostic whose state has previously been saved with
-
Loading Saved Graphs¶
-
spinup.utils.logx.
restore_tf_graph
(sess, fpath)[source]¶ Loads graphs saved by Logger.
Will output a dictionary whose keys and values are from the ‘inputs’ and ‘outputs’ dict you specified with logger.setup_tf_saver().
Parameters: - sess – A Tensorflow session.
- fpath – Filepath to save directory.
Returns: A dictionary mapping from keys to tensors in the computation graph loaded from
fpath
.
When you use this method to restore a graph saved by a Spinning Up implementation, you can minimally expect it to include the following:
| Key | Value |
|---|---|
x |
Tensorflow placeholder for state input. |
pi |
Samples an action from the agent, conditioned
on states in
x . |
The relevant value functions for an algorithm are also typically stored. For details of what else gets saved by a given algorithm, see its documentation page.


Also Try: Best Shopping Souks in Dubai (You’ll LOVE it!)
The undisputed king of the malls! Dubai Mall is the biggest mall in the world and it holds over 1,200 shops variating from luxury brands like Gucci to public favorites like Zara, Dubai Ice Rink, Dubai Aquarium, children’s theme parks, and some of the largest food courts in the world. Additionally, if you’re after high fashion, Dubai Mall’s Fashion Avenue hosts industry leaders like Alexander McQueen, Versace, Stella McCartney, and many more.
A major plus: the mall gives you the best view of Dubai Fountain’s shows and Burj Khalifa’s magnificence. Also Try: Essential Things to Do in Dubai (Don’t MISS These!)
Entertainment: Reel Cinemas; Dubai Ice Rink; Dubai Aquarium; Emirates A380; Dubai Dino; Sega Republic.
Contact: (800) 382 346-355
Location: Downtown Dubai, Dubai, United Arab Emirates
Dubaing Score: 5/5
Mall of the Emirates exists as a legend among the mall-nation; it has its own ski rink and snow park! Never again will you get a chance to tan at a beach and then head over to a ski trip. The mall includes about 560 shops selling all fashion demands, Dubai Community Theatre and Arts Centre, a 14-screen cinema, Magic Planet children’s park, and almost 100 café and dining facilities. Also Try: Best Adventures in Dubai (HIGHEST Rated 2017)
Entertainment: DUCTAC; Magic PLanet and Ski Dubai; Vox Cinemas
Contact: (971) 04 409-9000
Location: Al Barsha, Dubai, United Arab Emirates
Dubaing Score: 5/5
This Abu Dhabi mall has a namesake in Dubai, but obviously, this contender is far superior. It has over 400 shops on the span of 5 floors, its own observation center (30 stories up), and plenty of other entertainment options. Also Try: Best Things to Do & See in Abu Dhabi (SHOCKING Release)
Entertainment: Cinema; Bowling; Observation Deck; Ice Rink; Kid’s Zone
Contact: (971) 02 681-2310
Location: Corniche Road, Abu Dhabi, United Arab Emirates
Dubaing Score: 5/5
Dubai’s Ibn Batuta Mall is easily one of the most unique shopping destinations. It has 275 shops and 50 eateries spread across 6 courts; each court (Andalusia, Tunisia, Egypt, India, China, and Persia) has its own design, architecture, layout, featured shops, restaurants, and even themed bathrooms! Even if shopping isn’t your forte, this mall is a Dubai sightseeing opportunity. Also Try: Best Sky Views in Dubai (Some are VERY Rare!)
Entertainment: 21-screen Grand Megaplex with Dubai’s premiere IMAX
Contact: (971) 04 362-1901
Location: Jebel Ali, Dubai, United Arab Emirates
Dubaing Score: 5/5
One of the largest malls in Dubai & still expanding! Dubai Festival City features 420 shops including brands from across the world. It includes plenty of outlets for cuisine and even a massive IKEA! Also Try: Luxury Spas in Dubai (Celebrity Status)
Entertainment: Abra Rides; Cinema; Bowling
Contact: 800 322
Location: Dubai Creek, Dubai, United Arab Emirates
Dubaing Score: 5/5
While not a mall in Dubai, Yas Mall is the flagship shopping destination in Abu Dhabi and its size only beaten by the world champion of malls: Dubai Mall. It features 370 stores and over 60 dining spots. This is a top shopping destination if you happen to stroll by Abu Dhabi. Also Try: Dubai FREE Attractions (Yes, FREE!)
Entertainment: Kids’ Zone, Cinema
Contact:<PHONE_NUMBER>
Location: Yas Marina, Abu Dhabi, United Arab Emirates
Dubaing Score: 4.5/5
The largest mall among the city centre chain; this mall is quaintly located in the suburbs of Dubai. It features global brands and has a stronger emphasis on American chains than most other malls in Dubai. It features plenty of coffee shops, restaurants, and fast food chains. Also Try: Dubai Heritage Zones (Almost GONE 2017)
Entertainment: iFly; Magic planet; Cinema; Playnation; Aquaplay
Contact: (971) 04 602-3000
Location: Mirdif, Dubai, United Arab Emirates
Dubaing Score: 4.5/5
Wafi is an iconic mall known for its innovative usage of ancient Egyptian architecture; it’s good to know that this theme continues in its interior design. It features many shops but this mall stands out for its focus on featuring boutiques and brands that showcase Middle Eastern fashion and traditional wear.
Entertainment: Minigolf; Outdoor Pool; Outdoor Cinema
Contact: (971) 04 324-4555
Location: Oud Metha, Dubai, United Arab Emirates
Dubaing Score: 4/5
Crafted to display a beautiful Italian Renaissance architecture & interior design, this mall is just as pleasant to look at as it is to fulfill shopping needs. It features popular shopping chains as well as premiere brands like Laura Ashley and Jack Wills. It also includes unique eateries in its lengthy wallet of dining spots. Also Try: Top Attractions in Jumeirah (New 2017)
Entertainment: Fun City; Cinema
Contact: (91) 04 344-4161
Location: Jumeirah Beach Road, Dubai, United Arab Emirates
Dubaing Score: 4/5
As the name hints, this is once again not a mall in Dubai. Abu Dhabi Mall features over 200 popular retailers and a blend of boutiques. Of course, it’s heavy on the dining too.
Entertainment: Cinema
Contact: (971) 02 645-4858
Location: Sheikh Zayed Street, Abu Dhabi, United Arab Emirates
Dubaing Score: 4/5
Burjuman recently went through a renovation that allows it to host more than 200 global fashion brands. It not only includes exclusive boutiques, but also popular household names like Zara, Splash, H&M, Forever 21, & more. Like all malls in Dubai, it offers a bustling food court along with an assortment of restaurants and cafés.
Entertainment: Magic Planet; Cinema
Contact: (971) 04 352-0222
Location: Bur Dubai, Dubai, United Arab Emirates
Dubaing Score: 4/5
Sharjah is a city with many malls so it’s fair to allow it one entry on this list. Sahara Centre earns the spot because it’s Sharjah’s premiere mall and has a lot more to offer than many of Dubai’s malls; plus, it’s right on the border of Dubai & Sharjah. The mall features a large variety of stores, an interesting modern architecture, and a spread of dining options between a fast-food court and independent restaurant chains.
Entertainment: Cinema; Bowling; Adventure Land
Contact: (971) 06 531-3666
Location: Al Nahda, Sharjah, United Arab Emirates
Dubaing Score: 4/5
This shopping destination is located at the Dubai Marina, esuring you brilliant views as you go about your shopping excursion. It features fashion retailers at all price tags along with outdoor seating next to the beautiful Marina. A plus is that this mall has made an extra effort to provide beauty services.
Entertainment: Large cinema; Kid’s Train
Contact: (971) 04 436-1020
Location: Dubai Marina, Dubai, United Arab Emirates
Dubaing Score: 4/5
This Abu Dhabi mall is dedicated to luxury brands & boutiques. The average price tag runs very high as the featured shops are Jimmy Choo, D&G, Alexander McQueen, Prada, and other exclusive brands.
Entertainment: N/A
Contact: (971) 02 616-6999
Location: Corniche Road, Abu Dhabi, United Arab Emirates
Dubaing Score: 4/5
This mall dates back to 1995, making it one of the oldest malls in the UAE. It has grown to house a massive collection of brands, cafés, & restaurants. Despite the changing times and its age, Deira City Centre has retained its status as a popular shopping & family-time destination.
Entertainment: Magic Planet; Cinema
Contact: (917) 04 295-4486
Location: Deira, Dubai, United Arab Emirates
Dubaing Score: 4/5
Few malls have the hype to be able to build 2 editions. Though, Dragon Mart 1 is definitely not just the original, but also the better one. Dragon Mart features a massive collection of outlets showcasing direct Chiense imports available for retail & wholesale purchase.
Entertainment: Cinema
Contact: (971) 04 433-6200
Location: International City, Dubai, United Arab Emirates
Dubaing Score: 4/5
This is perhaps the only spot where the strip mall concept earned success in Dubai. It primarily features upscale fashion as the location retains an effort to bring “Beverly Hills” style shopping to Dubai. It includes boutique restaurants and chocolatiers too.
Entertainment: Cinema
Contact: (917) 04 346-1462
Location: Jumeirah, Dubai, United Arab Emirates
Dubaing Score: 4/5
Again, not a mall in Dubai, but Al Wahda Mall is a powerful shopping destionation in Abu Dhabi and its size allows it to feature 350 stores and some 50 dining spots. Put this on your mall list if you are in Abu Dhabi.
Entertainment: Kid’s Zone; Cinema
Contact:<PHONE_NUMBER>
Location: Hazza Bin Zayad Street, Abu Dhabi, United Arab Emirates
Dubaing Score: 4/5
Get ready for bargain pickings from over 800 retailers from across the globe. This mall ditches the frills that are a standard at most Dubai malls and focuses entirely on providing a bargain shopping destination
Entertainment: Soft Play Area
Contact: (917) 04 423-4666
Location: Dubailand, Dubai, United Arab Emirates
Dubaing Score: 3.5/5
The follow-up to the initial success: Dragon Mart II. The second establishment remains true to the popular architectural theme of the first Dragon Mart. The new mall hosts new merchants providing retail & wholesale offerings imported directly from China, however, the quantity at Mart II is less than the original mart.
Entertainment: Cinema
Contact: (971) 04 433-6200
Location:
Dubaing Score: 3.5/5
An ultimate shopping destination in Dubai for getting bargains on the world’s world’s leading luxury brands from Michael Kors to Carolina Herrera. It features 125 brands and an extensive list of delicious food offerings. The Outlet Village is more than just a top shopping spot; it features a jaw-dropping Tuscan architecture.
Entertainment: Stay & Play
Contact: (971) 04 317-3999
Location: Jebel Ali, Dubai, United Arab Emirates
Dubaing Score: 3.5/5
Another very small mall in Dubai featuring household brands & a small collection of restaurants along with a fast-food food court.
Entertainment: Cinema
Contact: 800 24-227
Location: Al Rigga, Dubai, United Arab Emirates
Dubaing Score: 3.5/5
A small community mall featuring popular brands and a small collection of dining spots. It drives popularity through a consistent foray of events.
Entertainment: Cinema
Contact: (971) 04 284-5555
Location: Al Mizhar, Dubai, United Arab Emirates
Dubaing Score: 3.5/5
A community mall fitting for the residents of Jumeirah: Sunset Mall includes only high-end boutiques and luxury fashion retailers; it also features gourmet dining spots.
Entertainment: Challenge Chambers
Contact: (971) 04 330-7333
Location: Jumeirah, Dubai, United Arab Emirates
Dubaing Score: 3.5/5
A small community mall serving primarily the residents of Al Quoz. If features a small collection of brands & restaurants.
Entertainment: Kids’ Zone
Contact: (971) 04 515-4000
Location: Al Quoz, Dubai, United Arab Emirates
Dubaing Score: 3/5
This is a relatively small mall but it features a good variety of shops dedicated to affordable shopping. The mall is convenient for those located within Barsha hoping to not break the wallet.
Entertainment: Kids’ Rides
Contact: (971) 04 455-7151
Location: Al Barsha, Dubai, United Arab Emirates
Dubaing Score: 3/5
A small mall tailored for the Arab market; the shops have a focus on Arab clothing trends & the restaurants cater to the many Arab cuisines.
Entertainment: Kids’ Centre
Contact: (971) 04 284-3663
Location: Al Khawaneej, Dubai, United Arab Emirates
Dubaing Score: 3/5
Here’s a mall in Dubai dedicated to budget brands and retailers. It features a large food court primarily based on fast-food.
Entertainment: Kids’ Zone
Contact: (971) 04 238-1111
Location: Al Qusais, Dubai, United Arab Emirates
Dubaing Score: 3/5
The name’s straight to the point with this one. It’s another small mall in Jumeirah but it offers a large variety of brands along with a spacious food court.
Entertainment: N/A
Contact: (971) 04 348-4848
Location: Jumeirah, Dubai, United Arab Emirates
Dubaing Score: 2.5/5
A small mall in Dubai driving popularity due to closeness to Sharjah. It features common brands and some conveniently located cafes & fast food spots.
Entertainment: N/A
Contact: (971) 04 263-0000
Location: Al Nahda, Dubai, United Arab Emirates
Dubaing Score: 2.5/5
If you are the owner or manager of a relevant business/institution and feel your business/institution has been overlooked, please contact us at Enquiry@Dubaing.ae


JavaScript is disabled on your browser.
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
Prev Letter
Next Letter
Frames
No Frames
All Classes
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
M
Main
- Class in
com.dropbox.core.examples.account_info
An example command-line application that runs through the web-based OAuth flow (using
DbxWebAuth
).
Main()
- Constructor for class com.dropbox.core.examples.account_info.
Main
main(String[])
- Static method in class com.dropbox.core.examples.account_info.
Main
Main
- Class in
com.dropbox.core.examples.authorize
An example command-line application that runs through the web-based OAuth flow (using
DbxWebAuth
).
Main()
- Constructor for class com.dropbox.core.examples.authorize.
Main
main(String[])
- Static method in class com.dropbox.core.examples.authorize.
Main
main(String[])
- Static method in class com.dropbox.core.examples.uploader.
DbxUploader
Main
- Class in
com.dropbox.core.examples.web_file_browser
An example web application that uses the Dropbox API to let users browse their Dropbox folder.
main(String[])
- Static method in class com.dropbox.core.examples.web_file_browser.
Main
Maybe
<
T
> - Class in
com.dropbox.core.util
metadata
- Variable in class com.dropbox.core.
DbxClient.Downloader
metadata
- Variable in class com.dropbox.core.
DbxDelta.Entry
If this is
null
, it means that this path doesn't exist on on Dropbox's copy of the file system.
metadata
- Variable in class com.dropbox.core.
DbxDeltaC.Entry
If this is
null
, it means that this path doesn't exist on on Dropbox's copy of the file system.
metadataReader
- Variable in class com.dropbox.core.
DbxDelta.Entry.Reader
metadataReader
- Variable in class com.dropbox.core.
DbxDelta.Reader
metadataReader
- Variable in class com.dropbox.core.
DbxDeltaC.Entry.Reader
metadataReader
- Variable in class com.dropbox.core.
DbxDeltaC.Reader
mightHaveThumbnail
- Variable in class com.dropbox.core.
DbxEntry
Whether this file or folder might have a thumbnail image you can retrieve via the
DbxClient.getThumbnail
call.
mk(JsonReader<? extends T>)
- Static method in class com.dropbox.core.json.
JsonArrayReader
mk(JsonReader<? extends T>, Collector<T, ? extends L>)
- Static method in class com.dropbox.core.json.
JsonArrayReader
mkAssert(String, Throwable)
- Static method in class com.dropbox.core.util.
LangUtil
move(String, String)
- Method in class com.dropbox.core.
DbxClient
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
Prev Letter
Next Letter
Frames
No Frames
All Classes


There are {{totalCarParts()}} total parts in stock.
{{carPart.price | currency:'EUR':true}}
5">{{carPart.price | currency:'CNY':true:'4.2-2'}}
{{carPart.desc}}
0">{{carPart.inStock }} in Stock
Out of Stock


Europe yet to decide on response to Iran uranium enrichment: Merkel
BERLIN (Reuters) - Europe has not yet taken a decision on how to respond to Iran’s decision to resume enriching uranium, which is restrained under its non-proliferation deal, but every step Tehran takes makes things more difficult, German Chancellor Angela Merkel said.
Iran said on Thursday it had resumed uranium enrichment at its underground Fordow nuclear plant, stepping further away from its 2015 nuclear deal with world powers after the United States pulled out of it.
“We have not yet taken a final decision,” Merkel told a joint news conference in Berlin with NATO Secretary General Jens Stoltenberg. “But with each step Iran takes the situation naturally gets more difficult.”


{% for qualification in qualification_list %}
Qualifications
{#
Qualifications
#}| Id : | → | {{ qualification.id }} |
| Degree Name : | → | {{ qualification.degree_name }} |
| Institute: | → | {{ qualification.institute_name }} |
| Start Year : | → | {{ qualification.start_year }} |
| End Year : | → | {{ qualification.end_year }} |
| Percentage / CGPI: | → | {{ qualification.percentage }} % |
| Description : | → | {{ qualification.description }} |


10 pixels represents a "meter."
The box on the left should fall at the same speed regardless of frame rate.
The box on the right assumes that it always runs at 60fps (the difference is more significant when you switch tabs).
Until now, my previous projects with gravity (eg Platformre, Penland, Platformludo, and Skribilmondo) have used the system on the right.
My future projects will likely use the method used on the left since it also accounts for potentially slower/laggier computers that don't run the canvas at 60fps (this is extremely apparent in Skribilmondo where a ton of blocks are being rerendered per frame).


Hom
e
Home
Article
Article Index
Archives
Categories
Tags
Photos & Drawings
About & Contact
Archived by Category
life
Movie
... articles in total.


3
1 As a result of that, when I could no longer endure worrying about you, I decided that Silas and I would stay behind alone in the city of Athens,
2 and we sent Timothy to you. You know that he is our close associate and also works for God by proclaiming the good news about Christ. Silas and I sent him in order that he would urge you to continue to strongly trust in Christ.
3 We did not want any of you to think about turning away from Christ because of what you were suffering.  And this is what happened!
5 This is why I sent Timothy to you: because I wanted so badly to know whether you were still trusting in Christ. I was afraid that Satan, the one who tempts us, had caused you to stop trusting in Christ. I was afraid that everything we had done with you was useless.
6 But now Timothy has just returned to Silas and me from being with you, and he has told us the good news that you still trust in Christ and that you love him. He told us also that you always happily remember us and that you want very much us to visit you, just as we want to visit you.
7 My fellow believers, even though we are suffering very much because of what people are doing to us here, we have cheered up because Timothy told us that you still trust in Christ.
8 Now it is as if we are living in a new way, because you are trusting very much in the Lord Jesus.
9 We cannot thank God enough for what he has done for you! We greatly rejoice over you when we pray to our God!
10 We constantly and fervently ask God that we will be able to visit you and that we will be able to help you to trust in Christ more strongly!
11 We pray to God, our Father, and to our Lord Jesus, that they will enable us to return to you.
12 As for you, we pray that the Lord Jesus will help you to love each other and other people more and more, just like we continue loving you more and more.
13 We pray that our Lord Jesus will make you want to please him more and more. We pray that God our Father will enable you to become more like him, and that no one can criticize. We pray this, so that when Jesus comes back to earth and all those who belong to him come with him, he will be pleased with you.


sqlexecution − RWP*Load Simulator execute sql, PL/SQL or cursor loops
statement ::=
identifier [ atclause ]
cursorloop ::=
for identifier [ atclause ] [ and expression ]
loop
statementlist
end [ loop ]
identifier
An identifier that is not followed by an open parenthesis must be a SQL statement which is executed once. If an at clause is provided, the execution will be against the specified database. It is highly recommended that if the sql statement is a query, it is expected to return (at most) one row.
If the SQL statement is a dml that has an array size set, rwloadsim will buffer executions until the array is filled or a commit or rollback is executed.
for c at d and e loop s;s;s; end
The identifier c must refer to a SQL statement that is a query, and the statement list between loop and end will be executed once for each row fetched from the query. If no rows are returned, no execution will take place. The optional at clause can be used to choose a particular database, d, otherwise the currently chosen one will be used.
If array fetch is active (which is the case by default), rwloadsim will use the Oracle Call Interface array fetch capabilities; if define array is used, rwloadsim will create a client side array. In either case, actual fetch of rows from the database will take place initially and susequently only when the array has been exhausted in the loop.
The optional and followed by an expression e before the loop keyword will cause the cursor to be canceled when the expression is zero. Note that due to array fetching, some rows may have been fetched from the database but not yet processed when the condition after and becomes false. The cursor will also be canceled if you perform a break or a return from inside the loop.
Still to come.
Copyright
© 2021 Oracle Corporation
Licensed under the Universal Permissive License v 1.0 as
shown at https://oss.oracle.com/licenses/upl
statement(1rwl), identifier(1rwl), sqldeclaration(1rwl), sqlstatement(1rwl), atclause(1rwl), databasestatement(1rwl), expression(1rwl)