What is an arrow function?
A function defined as follows:
let myFunc = () => {
console.log("Hello World")
}
What is a parameter?
A parameter are the variables defined in the function declaration.
function addThree(parameter1, parameter2, parameter3) {
return parameter1 + parameter2 + parameter3
}
What is an argument?
An argument passes variables or values to a function in the function call
function addThree(parameter1, parameter2, parameter3) {
return parameter1 + parameter2 + parameter3;
}
let argument1 = 3;
let argument2 = 5;
let argument3 = 9;
addThree(argument1, argument2, argument3); //returns 17
What does the following code return
function addTwo(num1, num2) {
return num1 + num2;
}
console.log(addTwo(5))
Returns NaN - because 1 + undefined is not a number.
What are the 3 expressions in a for loop?
for (let i = 0; ... ) {}
for (let i = 0; i < array.length; ... ) {}
for (let i = 0; i < array.length; i++)
Define a comment
Comments are used in code to further define what the code is doing. They are NOT to be executed.
Which of the following may be used to insert a comment into code:
1 and 3. #1 is for multiple lines of comments. The last '*/' will close the comment area. // may also be a comment, but you must use it at the beginning of each comment line.
Can a comment come after an executable line of code as follows:
function myFunction( a, b) {
if (a < b) { //a must be less than b
return true;
} else {
return false;
}
}
Yes!
Will the following code run?
function myFunc (a, b) {
// This is my comment
it spans multiple lines
and must be closed by another pair of //
return a + b;
}
No! This will return a syntax error because it is trying to evaluate "it". '//' must be used before each line on a comment. To comment out multiple lines of code use the pair: '/* */'
What is a simple way of debugging your code?
Use console.log()
to print out variable values.
What are three ways of console logging values?
console.log("myVar Value: " + myVar)
console.log(`myVar Value: ${myVar}`)
console.log("myVar Value1: ", myVar, " and adding 1 is:
",
myVar + 1)
Does this work?
let sum = 'a' + 'b';
Yes, but it may not do what you intended. If, for instance, you have two variables a=1 and b=2, and you run the code above it will not add a and b. Instead, it will concatenate the two characters 'a' and 'b' into another string of 'ab'.
Will the following work?
let a = 1;
a + b
Yes, but again, it may not give you what you intended. Here JavaScript sees a letter and a number. It will attempt to convert the number to a letter, then concatenate. The result will be '1b'
What can a Number datatype represent?
A float or an integer. It can be negative, or positive.
What will the following produce:
let x = 10;
let y = 20;
console.log("The result is: " + x + y)
The result will be 1020. Because you took a string, used the concatenate operator and added x and y. To
get
the result of 30, you would use:
let x = 10;
let y = 20;
console.log("The result is: ", x + y) ... or
console.log(`The result is: ${x + y}`);
What is a REPL?
REPLS: Read, Evaluate, Print Loops. Invoking node at the command line will provide a REPL.
What can variables NOT begin with?
Numbers
Can a variable begin with an underscore? (_) i.e.: let _myVar =
5;
Yes!
Which of the following are illegal?
Variables cannot begin with Numbers, and "-" is never allowed, nor is "#" ever allowed.
Variables can be any alpha/numeric value, $, or _; and cannot begin with a number
Variables may only begin with (_), (#), (alpha), (numeric), (alpha) characters
False
Variables may only begin with underscore (_), dollar sign($), or alphabetic characters
Which of the following variable names are illegal?
my#Variable: # is neither alphabetic, numeric, nor $ nor _
1Variable: Although numeric, the variable cannot begin with a number
Find the length of a string
"bootcamp".length ==> 8
What index value is the letter 't' at in the string 'bootcamp'?
'bootcamp'[3] ==> 't'
What is the index of the first letter in 'bootcamp'?
'bootcamp'[0] = 'b'
What is the difference between index and length?
Index is a zero based number. Length counts starting at 1.
What is the common problem between index and length?
Overrunning the length of the array or string. 'bootcamp'.length = 8, but 'bootcamp'[8] is undefined
How would you find the index of the letter 't' in 'bootcamp'?
Use the indexOf method: 'bootcamp'.indexOf('t') => 3;
How do you concatenate two strings?
Use the '+' operator: 'Hello' + 'World' = 'HelloWorld'
Define the 5 mathematical operators
+, -, *, /, %
Define the Comparator Operators
What is the order of precedence in evaluating multiplication, division, addition and subtraction?
How do you evaluate !==
NOT equal to
How do you evaluate &&
The expression on the left must be true AND the expression on the right must be true; otherwise the answer is false.
How do you evaluate ||
The expression on the left must be true, and if it is not, the expression on the right is evaluated to see if it is true. If neither are true, the expression is evaluated to false. Otherwise the expression is evaluated to true.
What is short-circuiting?
Only the expression that is required to determine the outcome is evaluated, starting from left to right. For instance, if true && false, both the left 'true' and the right 'false' must be evaluated. However, if 'false' && 'false' then only the left needs to be evaluated, because only one expression must be false for an '&&' operation to evaluate to false.
In the case of ||, if the left expression is true, the expression evaluates to true. So the right expression is never evaluated. If the left expression evaluates to false, then the right must be evaluated to determine if the statement evaluates to false.
What is DeMorgan's law
DeMorgan's law refers to the associativity of && and || expressions. Given a grouped expression, how would you break it apart into individual expressions.
My memory aid is: "NOT of AND is OR, and NOT of OR is AND"
Create a truth table for &&
| A | B | A&&B |
| false | false | false |
| false | true | false |
| true | false | false |
| true | true | true |
Evaluate the expression: 'a' < 'b'
'a' < 'b' = true
Evaluate the expression: "Apple" < "apple"
"Apple" < "apple" = true
Evaluate the expression: 'A' > 'a'
'A' > 'a'
Evaluate the expression: 1 > 2
1 > 2 = false
What is the pneumonic for order of evaluation?
PEMDAS: Parentheses, Exponents, Multiplication and Division (from left to right), Addition and Subtraction (from left to right)
What is the difference between the expression ==
and
===
==
: Used for comparing two variables, but it ignores the datatype of the variable
===
: Used for comparing two variables, but this operator also checks the datatype when
comparing.
Evaluate: 5 == "5"
5 == "5" => true
Because ==
does not compare the datatype.
Evaluate: 5 === "5"
5 === "5" //false
Because ===
evaluates the datatype as well. The number 5 is
not
equal to the string '5'.
Write a while loop with an empty block
while (condition) {
... code to be executed here
}
Write a for loop:
for (let i = 0; i < 5; i++) {
... do something
}
Define an iteration:
An iteration is each pass through the loop, or each time the loop executes.
What is the traditional word for the variable that keeps track of how many times a loop has been run?
index
>
Write the following loop using a while loop:
function forLoopDoubler(array) {
for (let i = 0; i < array.length; i++) {
array[i] = array[i] * 2;
}
return array;
}
function forLoopDoubler (array) {
let i = 0;
while (i < array.length) {
array[i] = array[i] * 2;
i++;
}
return array;
}
How do you determine the length of an array?
Use the .length method: myArray.length
How would you define an array?
Arrays are always defined with square brackets: let myArray = ['a', 'b', 'c']
What does this return? [4, 7, 9].length
3
How would you find the index of 9?
Either use indexOf, or because 9 is the last element in the array you can use array.length-1;
myArray.indexOf(9)
myArray[myArray.length - 1]
Given an array: let numbersAndLetters = ['b', 'z', 17, 'cat']
,
find
the index of 17
numbersAndLetters.indexOf(17)
==> 2
Notice that because 17 is a number, it is stored in the array index of 3. It is NOT stored as index of 3 AND 4. Similarly with 'cat', stored at index 3. This element is a string. Arrays can store different data types, and each data type gets its own index.
What do arrays ALWAYS start at (index)?
Arrays are 0-based -- meaning the first element is ALWAYS 0.
What is the most classic problem when accessing array elements?
Using length as an index. Because arrays are zero based, the last index of the array would be length-1,
NOT
length! myArray.length
What would the result of the following be: console.log([1, 2, 3] + [4,
5,
6]);
1, 2, 34, 5, 6
: Javascript tries to convert your array into a string. :-(
How would you concatenate an array?
console.log([1, 2, 3].concat([4, 5, 6]));
// => [1, 2, 3, 4, 5, 6]
What is the return of this expression:
let myArray = [1, 2, 3]
console.log(myArray.indexOf(4));
The number 4 is not included in the array. So the indexOf method would return -1
How do we combine two different arrays?
Use the .concat method: arrayOne.concat(arrayTwo)
How would you remove the last element on an array?
myArray.pop()
will return the last element of the array. Further, it will remove the last
element from the array.
How do you remove the first element from an array?
myArray.shift()
: This will both remove the first element from the array, and return that
element
to the caller.
How do you add an element to an array?
If you want to add the element to the end of the array, use .push(<element>):
myArray.push('newElement')
How would you add an element to the beginning of an array?
Use the unshift method: myArray.unshift('newFirstElement')
Which built-in function allows you to interate through every element in an array and return a new array?
Array.map()
let myArray = [ 1, 2, 3, 4 ]
myArray.map( (elt) => {
return elt * 2
});
//returns: [2, 4, 6, 8 ]
//does NOT mutate original array.
What builtin array function allows you to produce a sub-array matching certain criteria?
Array.filter
let myArray = [ 1, 4, 7, 6, 12, 9]
myArray.filter( (elt) => {
if (elt % 2 === 0) return elt;
});
//returns [4, 6, 12]
With the builtin array function "reduce", what is it's first argument?
accumulator.
What is accumulator set to when Array.reduce is first called?
If accumulator does not have an initial value set, then accumulator is set to the first element of the array
Write a function that will return the sum of the array [3, 7, 5,
9]
Or, in arrow function syntax:
let nums = [3, 7, 5, 9];
let sum = nums.reduce ( (accum, el) => {
return accum + el;
});
//sum is now 24.
Or ...
let sum = nums.reduce ( (accum, el) => return accum + el, 100);
Array.reduce( fn(), accum);
If Array.reduce() defaults the accumulator to the array, what does the code in the answer above add on the first iteration?
accum = 3; elt = 7;
How do you set an initial value for the accumulator?
This would be the 2nd argument to the reduce function:
let nums = [3, 7, 5, 9]
let sum = nums.reduce(function(accum, el) {
return accum + el;
}, 100);
How would you use an Array builtin function to calculate the sum of all integer elements of an array?
let nums = [3, 7, 5, 9]
let product = nums.reduce( (accum, elt) => {
return accum * el;
});
// returns
How would you take the same array as in the answer above, and first double the numbers, then multiply them together?
Because you're doubling each number, you'll need to double the first number. This requires that the accumulator doubles the number - but the accumulator will not automatically do this. So you'll need to pass in an initial value for the accumulator so that it doesn't use the first element of the array as the initial value.
let nums = [3, 7, 5, 9];
let doubleProduct = nums.reduce( (accum, el) => {
return accum * 2 * el
}, 1);
Now on the first pass accumulator will be set to 1, and each element will be doubled before being multiplied -- including the first element. Remember: If there is no initial value given for the accumulator, the initial value will be set to the first value in the array, and the second element in the array will be used in the first iteration of the reducer's function.
What is the return value from the builtin Array.reduce() function?
The accumulator.
Write a function that finds the max value of the array [3, 7, 5, 9, 2]
let nums = [3, 7, 5, 9, 2]
let max = nums.reduce( (accum, el) => {
if (el > accum) {
return el;
} else {
return accum
}});
How what are two ways to iterate through an array?
let nums = [1, 2, 3]
let newArray = []
for (let i = 0, i < nums.length; i++) {
newArray.push(2 * nums[i]);
}
or ...
let nums = [1, 2, 3];
let newArray = nums.forEach( (elt, index) => {
return elt[i] * 2
}
What is "defensive coding"?
When you write code to avoid throwing exceptions. eg:
if (value !== undefined) {}
if (value !== null) {}
The Array#forEach accepts a function as an argument. What arguments can the function that is passed into Array#forEach accept?
The function that is passed into Array#forEach may accept the current element, index, and array
What two arguments does the Array#reduce method accept?
The Array#reduce method accepts a function as it's first argument and a value to be used as the initial accumulator as an optional second argument.
The Array#filter method accepts a function as an argument. What type of data should the function that is passed into Array#filter return?
The function that is passed into Array#filter should return boolean.
The Array#reduce method accepts a function as an argument. What arguments should the function that is passed into Array#reduce accept?
The function that is passed should accept the current accumulator and current element as its arguments.
Describe what the Array#filter does.
The Array#filter method accepts a function as an argument and returns a new array containing elements of the original array that result in `true` when passed into the function.
Describe what the Array#map method does.
The Array#map method accepts a function as an argument returns a new array containing the results of calling that function on each element of the original array.
Name the array method that removes the first element of an array (mutating the array) and returns the removed element.
Array#shift
Describe what the String#split method does.
The String#split method accepts a "separator" string as an argument and returns an array containing the resulting substrings when the string is cut along instances of the "separator".
For example:
let sentence = "follow the yellow brick road";
let words = sentence.split(" ");
console.log(words); // [ 'follow', 'the', 'yellow', 'brick', 'road' ]
Name the array method that removes the last element from an array (mutating the array) and returns that removed element.
Array#pop
What do the Array#slice and String#slice methods accept as arguments?
Both methods accept a start index and end index representing the range of indices to be sliced as a new array or string. The start index is inclusive, while the end index is exclusive.
What does the term "mutability" mean in programming?
"Mutability" refers to an object's ability to undergo changed. Mutable objects can be modified, while immutable objects cannot be changed after they are created.
Describe what the Array#join method does.
The Array#join method accepts a "separator" string as an argument and returns a string where elements of the array are concatenated together with the "separator" between each element.
For example:
let words = ["run", "around", "the", "block"];
console.log(words.join("_")); // 'run_around_the_block'
Identify which of the following JavaScript data types are mutable: number, string, boolean, array
Arrays are mutable.
Numbers, strings, and booleans are all immutable. Don't confuse mutability with the variable types: var, let and const. When you define a variable with let, then yes. You can change the value of the variable. Similarly with var. However, when you change the value of the variable the variable is re-created in a different location in memory. This makes the data types shown immutable. Arrays, on the other hand, you can change the contents of the array without changing where the array points in memory. The variable containing the array will never change its memory address.
Describe what the Array#unshift method does.
The Array#unshift method accepts one or more values as arguments and will add those values to the front of the array, mutating the array. The method returns the new length of the array.
let array = ['a', 'b', 'c', 'd' ]
let arrayLength = array.unshift('e', 'd', 'f', 'g')
arrayLength //=> 8
array //=> :
[
'e', 'd', 'f',
'g', 'a', 'b',
'c', 'd'
]
Describe what the Array#push method does.
The Array#push method accepts one or more values as arguments and adds those values as new elements to the end of the array, mutating the array. The method will return the new length of the array.
let array = [1, 2, 3, 4]
array.push(6, 7, 8, 9, 10) //=> 9
array // => :
[
1, 2, 3, 4, 6,
7, 8, 9, 10
]
What does Array#splice accept as arguments?
Array#splice has two required arguments: a target index and a number of elements to remove
Array#splice can additionally accept any number of additional arguments representing values to be inserted
array // => :
[
1, 2, 3, 4, 6,
7, 8, 9, 10
]
array.splice(-1) //=> [ 10 ] -- removes 10 from the arrray and returns it as an array
array // => array now does not have 10 in it
[
1, 2, 3, 4,
6, 7, 8, 9
]
array.splice(4, 1) // returns [ 6 ] from the array, while removing it from the array
[ 6 ]
array // Array no longer has 6 in it
[
1, 2, 3, 4,
7, 8, 9
]
array.splice(0, 1, 'a', 'b', 'c') //removes 1 from the array and returns [ 1 ], then adds 'a', 'b', 'c', in its place
array // contents of the array has removed 1, and in its place put 'a', 'b', 'c'
[
'a', 'b', 'c', 2, 3,
4, 7, 8, 9
]
What will the following code snippet print out:
let arr = [ 'a', 'b', 'c', 'd', 'e', 'f' ]
arr.splice(2, 3);
console.log(arr);
['a', 'b', 'f'] : Array#splice mutates the input array, removing 3 elements starting at index 2.
When is an object considered mutable?
A mutuble object can be changed. An immutable object cannot be changed.
Which of the following types is mutable?
Arrays are mutable. Booleans, Numbers, and Strings are immutable.
What will the following code snippet print out?
let arr = ['a', 'b', 'c', 'd', 'e' ];
arr.slice(1, 3);
console.log(arr);
['a', 'b', 'c', 'd', 'e'] : Array#slice does not mutate the input array, so arr is unchanged.
Define a primitive datatype in JavaScript.
A primitive (primitive value, primitive data type) is data that is not an object, and has no methods.
How many primitive data types are there in JavaScript?
Six: string, number, bigint, boolean, undefined and symbol.
We haven't learned about symbols yet.
Is NULL a data type?
Null means "the ABSENCE of data". Any data type can be set to null.
How would you check a data type in JavaScript?
Use the built in "typeof" operator
console.log(typeof null); // 'object'
console.log(typeof 'c'); // 'string'
console.log(typeof 1); // 'number'
console.log(typeof true); // 'boolean'
let a;
console.log(typeof a); //'undefined'
Why are objects considered "first-class" in JavaScript?
A first-class object is something that can be stored in a variable.
Is a function a first class object?
Yes! You can store a function in a variable and pass it to another function
let myFunc = (a, b) => { return a + b }
doSomething(f, g, myFunc) {
if (f > g) {
return myFunc(f, g)
}
}
How do you stop your program from throwing ugly exceptions?

Provides a mechanism to evalute statements and throw errors if the statements do not conform.
try {
if (array.length === 0) {
do something ...
}
}
if array is undefined, checking the length of an undefined object will throw an exception.
What do you use a catch block for?
You use a catch block to gracefully process the error, rather than allowing your code to break and throw an exception to the user.
try {
if (array.length === 0) {
... do something
}
} catch (e) {
if (e === instanceOf ReferenceError) {
console.log("array is not defined");
} else {
console.log("error: ", e)
}
}
Describe the following code:
let sayHello = function() {
console.log('hello')
};
Function Expression Syntax
How can I make my own errors to be caught by try/catch blocks?
throw Error('this error');
throw new Error('this error');
What does the finally block in a try/catch block do?
The finally block runs whether or not an error occurs. It always runs.
function sumArray(array) {
let sum = 0;
try {
for (let i = 0; i < array.length; i += 1) {
sum += array[i];
}
} catch (e) {
console.log(e);
return null;
} finally {
console.log("This wil aways print.");
}
return sum;
}


|
Water Calculator
|
|
Required Data Entry
|
|
Number Of People In Residence
|
|
|
Indoor Water Use
|
|
Bathroom Water Use
|
|
Daily Showers In The Residence
|
|
|
Average Shower Time In Minutes
|
|
|
Shower Head Flow Rate (3.8 std. 1.6 res.)
|
|
|
Total Weekly Baths In Residence
|
|
|
Toilet Water Use
|
|
Average Number Of Flushes Daily Per Person
|
|
|
Gallons Per Flush (5 std. 1.6 res.)
|
|
|
Faucet Water Use
|
|
Average Number Of Times Each Person Uses Faucet Daily
|
|
|
How Many Minutes Each Use
|
|
|
Dishwashing Water Use
|
|
How Many Times Are Dishes Washed By Hand Daily
|
|
|
How Many Minutes Each Use
|
|
|
How Many Dishwasher Loads Each Week
|
|
|
Gallons Per Dishwasher Load
|
|
|
Laundry Water Use
|
|
How Many Loads Of Laundry Each Week
|
|
|
How Many Gallons Each Load
|
|
|
Car Wash
|
|
How Many Cars you have
|
|
|
How Many buckets of water you use
|
|
|
Lawn Water Use
|
|
How Many Times Is The Lawn Watered Each Week
|
|
|
For How Many Minutes Each Time
|
|
|
How Many Minutes For Other Outdoor Use Each Week
|
|
|
|
Calculated Results
|
|
Bathroom
|
|
|
Lawn Watering
|
|
|
Toilets
|
|
|
Other Outdoor Uses
|
|
|
Faucets
|
|
|
Laundry
|
|
|
Dishwasher
|
|
|
Hand Washing Dishes
|
|
| TOTAL CONSUMPTION |
| |
Your House |
| Interior per capita gallons per day |
|
| Exterior per capita gallons per day |
|
| |
| |
Total Per Capita Gallons Of Water Used |
| |
Per Day | Per Month | Per Year |
| Your Household |
|
|
|


This project is focused on using machine learning to determinet the appropriate number of Starbucks locations per zipcode in the U.S. The following is a list of the members in our group.
Due to a variety of reasons, companies often have to shut down stores. Often times the reason is because the surrounding population does not actually have a need for the company’s services. This occurrence causes huge losses for a company or business as they have spent valuable resources such as time planning and building the store, money paying workers, and product that could have been sold to customers in a more conducive environment. This tool will help mitigate such losses as it will allow companies to see beforehand whether or not a store may be successful in an area.
A tool like this would be useful for Starbucks or any other chain franchises to determine possible locations for new stores and currently underperforming stores that could be shut down. Chain franchises employ teams of people whose responsibility is to perform the previously mentioned task. A location assessor like this would make the employees jobs much easier and at the same time would allow them to focus on the more interesting parts of their jobs like designing the layout of the store and finding the perfect location in the zip code. While our tool would not replace the jobs of these individuals, it would certainly make their lives easier.
Our model will use U.S. census data, which provides the total population, demographic breakup, and household income in conjunction with publicly available datasets of chain franchise locations. The data provided in the U.S census data will be used as input to predict the number of chain franchise locations in a certain zip code. Comparing the predicted number of store locations with currently open store locations in a zip code would tell a company whether to open or close stores in the area of the zip code.


--- title: "A Tech Company Is Developing A Way To Bring You Back After Death" featimg: "http://www.viralthread.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-26-at-14.11.31.png" description: categories: sourceurl: "http://www.viralthread.com/a-tech-company-is-developing-a-way-to-bring-you-back-after-death/" ---
Humai are a tech company who are adamant that they can develop a way to bring us back from the dead. What’s even more amazing is they say they can do it in the next thirty years. They plan to create an artificial body that our consciences can then be transferred to at the moment of our death.
Although this sounds like a science fiction blockbuster its a lot closer to reality than you might think. Our brains are packed full of data and as technology develops our ability to store and process it will increase. Humai are working on human resurrection through artificial intelligence and believe they could could produce their initial ‘I-Human’ in just three decades.
They plan to use nanotechnology to recreate conversational styles, behavioral patterns and thought processes.
Humai are based in L.A and were founded by Josh Bocanegra who states on the website that. “Humai is an AI company with a mission to reinvent the afterlife. We want to bring you back to life after you die.”
We wish Josh and all at Humai the best in their endeavors. In the meantime I suggest you watch Charlie Brooker’s hit TV drama ‘Black Mirror’ – this fantastic series explores what life could be like in the future with one episode focussing in on this exact type of technology. It’s well worth a watch, you can catch it on Netflix.


Bitcoin Weekly Forecast: BTC Price Turned Sell On Rallies
- After settling below $9,000, bitcoin declined steadily against the US Dollar.
- The price is under a lot of pressure below the $8,700 and $8,650 resistance levels.
- There is a crucial bearish trend line forming with resistance near $8,630 on the 4-hours chart of the BTC/USD pair (data feed from Kraken).
- The price could correct higher, but it is likely to face sellers near the $8,700 resistance area.
Bitcoin price is trading in a bearish zone towards $8,200 against the US Dollar. BTC remains sell on rallies unless there is a successful close above the $8,880 resistance.
Bitcoin Price Weekly Analysis (BTC)
This past week, bitcoin saw an increase in selling pressure below the $8,880 support area against the US Dollar. Moreover, BTC price settled below the $8,700 pivot level and the 100 simple moving average (4-hours).
There were steady losses and the price broke the $8,600 and $8,500 support levels. A new monthly low is formed near $8,382 and the price is clearly trading in a bearish zone.
It is currently consolidating losses above the $8,400 level. Besides, bitcoin is trading near the 23.6% Fib retracement level of the recent decline from the $8,777 high to $8,382 low.
On the upside, there are many resistances near $8,580 and $8,600. There is also a declining channel forming with resistance near $8,580 on the 4-hours chart of the BTC/USD pair. Additionally, the 50% Fib retracement level of the recent decline from the $8,777 high to $8,382 low is also near the $8,580 level.
If there is an upside break above the channel resistance, the price could test the $8,620 and $8,630 resistance levels. More importantly, there is a crucial bearish trend line forming with resistance near $8,630 on the same chart.
To move into a positive zone, the price must break the $8,700 and $8,720 levels. Having said that, a proper close above the $8,880 resistance is needed for a trend change and a fresh increase.
On the downside, there are many key supports near the $8,320 and $8,200 levels. The bears are likely to face a strong buying interest near $8,200, below which there is a risk of a break down towards the $8,000 handle.
Looking at the chart, bitcoin price is following a bearish path, with key supports near $8,200. Therefore, there are chances of a short term upside correction towards the $8,600 and $8,700 levels. However, the upward move is likely to face sellers and gains could be capped by $8,880.
Technical indicators
4 hours MACD – The MACD for BTC/USD is slowly losing momentum in the bearish zone.
4 hours RSI (Relative Strength Index) – The RSI for BTC/USD is now recovering above the 30 level.
Major Support Level – $8,200
Major Resistance Level – $8,880


Note: This article originally appeared in CodeRag.
Gavin Belson’s name has long been synonymous with innovation—but beyond his work at Hooli, do we even know the man behind the rampant success? In a Code/Rag exclusive, Belson revealed to us 10 things about himself that aren’t common knowledge.
- He’s a nature fanatic! “It’s important to me that Hooli has an effective recycling program, and a personal passion of mine is donating to elephant sanctuaries. In fact, I’ve recently spearheaded the creation of Hooli’s newest charity: the Hooli Elephant Wildlife Trust.”
- He likes to go analog! His company may have been founded on email, but Belson has a soft spot for the written word. “There’s something nostalgic about receiving a letter—it’s a message from the past.”
- He’s an honorary shaman! “I studied at the Institute of Spiritual Therapy and Vision Quests, where I was honored with the title of shaman. The Institute has fundamentally furthered my understanding of the world and its capacity for greatness.”
- His favorite pizza topping is pepperoni! “Uncured, preferably, with some aged parmesan.”
- He drives a Tesla! “Black. I try not to bee too conspicuous. And of course, the benefit to the environment is incomparable.”
- His health is important to him! “I eat at least one piece of unprocessed fruit a day.”
- He has bad habits too! “I never reboot my laptop. I know it’s bad, but I’m always in a hurry.”
- He doesn’t have a Nobel Peace Prize…yet! “It’s a common misconception, especially with the amount of charity work I do with Hooli, and sometimes people associate my status as a shaman with working towards world peace, which of course is something I’m striving for.”
- He’s loyal to his barber! “I’ve been going to the same barber for years—he was based in Palo Alto, but I’ve convinced him to move to the South Bay.”
- He really, really loves animals! “I would say I’m a cat person.   Did you know the African bush elephant is still an endangered species? Programs like the Hooli Elephant Wildlife Trust won’t save them immediately, but it’s a start.”


This is a document intended to describe various aspects of SNES timing. It will probably not be useful unless you already know a good bit about the SNES.
BTW, special credit to byuu for the critical observation that the SNES returns to a known timing position on reset. Thus, a deterministic ROM (i.e. it doesn’t depend on user input or any other randomness) will always give the same results on reset. And a series of ROMs which vary only in the master cycle count before testing some event (like the value of $4212) can tell us just when such events occur.
A note on timings: stating that a bit set is at H=X means that a read that would latch X-.5 were it reading $2137 will see the bit not set, while a read that would latch X were it reading $2137 will see the bit set. The counter may also be latched by writing 0 to $4201 bit 7: this will latch 1 dot later than if the same memory access cycle were reading $2137.
S-CPU (5A22)
S-PPU
S-APU
The SNES master clock runs at about 21.477MHz NTSC (theoretically 1.89e9/88 Hz). The best number we have for PAL is 21.28137MHz.
A CPU internal operation (an IO cycle) takes 6 master cycles. A memory access cycle takes 6, 8, or 12 master cycles, depending on the memory region accessed and bit 0 of CPU register $420d.
The SNES runs 1 scanline every 1364 master cycles, except in non-interlace mode scanline $f0 of every other frame (those with $213f.7=1) is only 1360 cycles. Frames are 262 scanlines in non-interlace mode, while in interlace mode frames with $213f.7=0 are 263 scanlines. “V-Blank” runs from either scanline $e1 or $f0 until the end of the frame.
The CPU is paused for 40 cycles beginning about 536 cycles after the start of each scanline. Current theory is that this is used for WRAM Refresh. The exact timing is that the refresh pause begins at 538 cycles into the first scanline of the first frame, and thereafter some multiple of 8 cycles after the previous pause that comes closest to 536.
For specifics on particular instructions, see any generic 65816 doc. The GTE datasheet is particularly nice, as it identifies the CPU activity for each cycle of the instruction.
To determine the exact length of any CPU instruction, you must examine its behavior for each cycle, and count 6, 8, or 12 master cycles as appropriate.
The WAI instruction stops the processor. The processor restarts when either the /NMI or /IRQ line is low (or /RESET, but we don’t care about that too much). It takes 12 master cycles (2 IO cycles) to end the WAI instruction, at which point the NMI or IRQ handler may actually be executed.
The internal timer will set its NMI output low at H=0.5 at the beginning of V-Blank. The CPU’s /NMI input is forced high by clearing bit 7 of register $4200, so the CPU may not actually see the NMI transition. The CPU will jump to the NMI routine at the end of the instruction during which /NMI transitions.
The internal timer sets its NMI output high at H=0 V=0, or when register $4210 is read. Possibly also when $4200 is written?
If the CPU is halted (i.e. for DMA) while /NMI goes low, the NMI will trigger after the DMA completes (even if /NMI goes high again before the DMA completes). In this case, there is a 24-30 cycle delay between the end of DMA and the NMI handler, time enough for an instruction or two.
The internal timer will set its IRQ output low under the following conditions (’x’ and ‘y’ are bits 4 and 5 of $4200, HTIME is registers $4207-8, and VTIME is $4209-a):
yx trigger point
00 => Never
01 => H-IRQ: every scanline, H=HTIME+~3.5
10 => V-IRQ: V=VTIME, H=~2.5
11 => HV-IRQ: V=VTIME, H=HTIME+~3.5
The actual formula for the trigger point is as follows. V-IRQ is just like HV-IRQ with H=0. If H=0, $4211 bit 7 gets set 1374 master cycles after dot 0.0 of the previous scanline. Otherwise, it gets set 14+H4 master cycles after dot 0.0 of the current scanline. Note that the ‘dot offset’ will change due to the two long dots per scanline. Also, no IRQ will trigger for dot 153 on the short scanline in non-interlace mode, and no IRQ will trigger for dot 153 on the last scanline of any frame.
The internal timer will set its IRQ output high when $4211 is read, or when IRQs are disabled by a write to $4200. Note that the expansion port and the cart connector both have access to the /IRQ line, and may be able to trigger IRQs on their own. When enabling IRQs, the IRQ output will go low even if the enable write occurs at the exact cycle when the IRQ is scheduled to trigger For example, if HV-IRQ is set for (0,1) and the last cycle of the STA $4200 is at (0,0)+1372 master cycles, the IRQ line will still go low.
The CPU will jump to the NMI or IRQ handler at the end of the instruction when /NMI transitions or when /IRQ is low and the I flag is clear. The actual check occurs just before the final CPU cycle of the instruction, which means that the jump will begin at the earliest 6 to 12 master cycles after /NMI or /IRQ. Also note that PLP, CLI, SEI, SEP #$04, and REP #$04 update the flags during their final CPU cycle, so the IRQ check will use the old value of I rather than the new one set by the current instruction. RTI, BRK, and COP on the other hand do not have this issue.
So for the following code:
> ; set up IRQ
> SEI
> WAI
> STZ $00
> LDA #$01
> CLI
> LDA #$42
> STP
>
> IRQHandler:
> STA $00
> RTI
Memory location $00 will end up set to 0x42, not 0 or 1, because the I flag isn’t clear before the final cycle of CLI. And for the following code:
> ; set up IRQ
> SEI
> WAI
> CLI
> SEI
The IRQ will actually trigger following the SEI instruction, not before it (but the flags pushed during the IRQ handler will have the I flag set). OTOH, the following code will not allow an IRQ to trigger at all if the RTI sets the I flag:
> ; set up IRQ
> SEI
> WAI
> CLI
> RTI
And the following code (with RTI clearing I):
> ; set up IRQ
> SEI
> WAI
> STZ $00
> LDA #$01
> RTI
>
> ; -> RTI returns here
> LDA #$42
> STP
>
> IRQHandler:
> STA $00
> RTI
Will result in memory location $00 being set to 1, not 0x42.
If /NMI and /IRQ are both pending, NMI takes precedence.
And the datasheet is inaccurate regarding that first cycle of the IRQ/NMI pseudo-opcode. It’s an opcode fetch cycle from PB:PC (typically 6 or 8 master cycles), not an IO cycle (always 6 master cycles) as the datasheet claims.
DMA is activated by writing a 1 to any bit of CPU register $420b. The CPU is halted during the DMA transfer.
DMA takes 8 master cycles per byte transferred, regardless of the memory regions accessed. It is unknown what happens if you attempt DMA to or from $4000-$41ff, since that memory region requires 12 master cycles for access. There is also 8 master cycles overhead per channel.
The exact DMA timing works as follows: After $420b is written, the CPU gets one more CPU cycle before the pause (on a standard “STA $420b”, this would be the opcode fetch for the next instruction). The speed of the next CPU cycle to execute after the DMA determines the CPU Clock speed for the DMA transfer.
Now, after the pause, wait 2-8 master cycles to reach a whole multiple of 8 master cycles since reset. The perform the DMA: 8 master cycles overhead and 8 master cycles per byte per channel, and an extra 8 master cycles overhead for the whole thing. Then wait 2-8 master cycles to reach a whole number of CPU Clock cycles since the pause, and only then resume S-CPU execution.
The exact timing of the read within the DMA period is not known. Best guess at this point is that 2-4 of the “whole DMA overhead” is before the transfer and the rest after.
An example: “STA $420b : NOP”, one channel active for a 3 byte transfer. The pause occurs after the NOP opcode is fetched, so the CPU Clock Speed is 6 master cycles due to the following IO cycle in the NOP. After the pause, say we need 2 master cycles to reach an even multiple of 8 master cycles since reset total=2. Then wait 8 for DMA init total=10, 8 for channel init total=18, and 83 for the actual transfer total=42. To reach a whole number of CPU Clock cycles since the pause, we must wait 6 master cycles (remember, 0 is not an option) total=48.
Same thing, but begin the pause 2 master cycles earlier. Thus, we must wait 4 master cycles to get to a multiple of 8 since reset total=4, then our 40 for the DMA transfer total=44. To get to a whole CPU Clock, 4 master cycles are needed total=48.
Same thing, but begin the pause 2 master cycles earlier. Thus, we must wait 6 master cycles to get to a multiple of 8 since reset total=6, then our 40 for the DMA transfer total=46. To get to a whole CPU Clock, only 2 master cycles are needed total=48.
One last time, begin the pause 2 master cycles earlier. Thus, we must wait 8 master cycles to get to a multiple of 8 since reset total=8, then our 40 for the DMA transfer total=48. To get to a whole CPU Clock sinze pause, 6 master cycles are again needed total=54. So this transfer took an extra 6 master cycles…
HDMA is enabled by writing a 1 to any bit of CPU register $420c. Much like DMA, the CPU is halted during HDMA operations. HDMA takes priority over DMA.
For all active channels, the HDMA registers are initialized at about V=0 H=6. The overhead is ~18 master cycles, plus 8 master cycles for each channel set for direct HDMA and 24 master cycles for each channel set for indirect HDMA. Presumably, the exact timing for the HDMA pause is the same as that for DMA.
HDMA channels may be deactivated mid-frame if $00 is read into $43xA from the HDMA table (or possibly if $00 is written to $43xA manually). They may also be activated or deactivated by writing $420c. All HDMA channels are deactivated at the start of V-Blank.
The actual HDMA transfer begins at dot 278 of the scanline (or just after, the current CPU cycle is completed before pausing), for every visible scanline (0-224 or 0-239, depending on $2133 bit 3). For each scanline during which HDMA is active (i.e. at least one channel has not yet terminated for the frame), there are ~18 master cycles overhead. Each active channel incurs another 8 master cycles overhead for every scanline, whether or not a transfer actually occurs. If a new indirect address is required, 16 master cycles are taken to load it. Then 8 cycles per byte transferred are used.
When enabled, the SNES will read 16 bits from each of the 4 controller port data lines into registers $4218-f. This begins between dots 32.5 and 95.5 of the first V-Blank scanline, and ends 4224 master cycles later. Register $4212 bit 0 is set during this time. Specifically, it begins at dot 74.5 on the first frame, and thereafter some multiple of 256 cycles after the start of the previous read that falls within the observed range.
Reading $4218-f during this time will read back incorrect values. The only reliable value is that no buttons pressed will return 0 (however, if buttons are pressed 0 could still be returned incorrectly). Presumably reading $4016/7 or writing $4016 during this time will also screw things up.
$4210 bit 7: shows the status of the internal timer’s NMI output (1=low). Reading this bit causes the NMI output to go high.
$4211 bit 7: shows the status of the internal timer’s IRQ output (1=low) OR the status of the CPU’s external /IRQ line. Reading this bit causes the internal timer’s IRQ output to go high.
$4212 bit 0: set when Auto Joypad Read is being performed.
$4212 bit 6: indicates H-blank. Set at H=274 of every scanline, and cleared at H=1.
$4212 bit 7: indicates V-blank. Set at H=0 at the beginning of V-Blank, and cleared at H=0 V=0.
$4214-7: 8 cycles (8 master cycles or somewhere between 48 and 64 master cycles?) after $4203 is written, the multiplication result may be read. 16 master cycles (or somewhere between 96 and 128 master cycles) after $4206 is written, the division result may be read. What happens before the time is up (or if you initiate another multiplication/division while calculating) is unknown.
The PPU is clocked off the same oscillator as the S-CPU.
The PPU uses the same measure of frames and scanlines as the 5A22 S-CPU. There are always 340 dots (‘pixels’) per scanline; normally dots 323 and 327 are 6 master cycles instead of 4.
Note that a superscope pointing at pixel (X, Y) on the screen will latch approximately dot X+40 on scanline Y+1.
The PPU outputs one pixel every 4 master cycles, for dots 22-277(?) on scanlines 1-224 or 1-239. Note that (for NTSC) the color carrier is 6 master cycles, hence the interesting color effects seen with alternating pixel patterns.
The PPU seems to access memory 2-3 tiles ahead of the pixel output. At least, when we disable Force Blank mid-scanline, there is garbage for about 16-24 pixels.
V-Blank begins on scanline $E1 or $F0, at H=0, depending on bit 2 of $2133. If this bit is set, then cleared between $E0 and $F0, most “at the start of V-Blank” events will trigger at the next appropriate H point. Note though that clearing it too late may cause the TV to lose sync, possibly because the PPU doesn’t get a chance to output a correct V-Blank signal. Setting the bit ‘too late’ will not resume HDMA or rendering or re-trigger NMI, but VRAM will be locked as if rendering were still proceeding.
V-Blank ends at V=0 H=0.
H-Blank begins at H=274 of every scanline, and ends at H=1.
$2134-6: Some unknown number of master cycles after $211c is set, the product may be read from these registers. What value may be read before these cycles have elapsed is unknown.
$2137: Read to latch the PPU dot position.
$213F bit 6: Set when the PPU dot counter is latched (or shortly thereafter), and cleared on read (and maybe the beginning/end of V-Blank too?).
$213F bit 7: Toggles every frame, at V=0 H=1.
At the beginning of V-Blank if force-blank is disabled, the internal OAM address is reset to the value last written to $2102-3. byuu reports this occurs at H=10 on scanline 225/240. Also, byuu reports the reset occurs on any 1->0 transition of $2100 bit 7.
Most of this is conjecture, based on a NES timing expetiment conducted by Brad Taylor<EMAIL_ADDRESS>around Sept 25, 2000.
All SNES VRAM memory access cycles are 4 master cycles long (the same amount of time it takes to output one pixel), compared to 8 (2 pixels) for the NES. The scanline is thus 340 memory accesses long. Also, the SNES PPU can access 2 bytes at a time (one from each VRAM chip) where the NES could only access one. Like the NES, ‘rendering’ begins on scanline 0, however nothing is actually output for scanline 0.
Beginning when the PPU begins outputting the first pixel on the scanline (just after H-Blank), we load the data for 32 tiles. For Modes 0-4, each BG takes 1 memory access for the tilemap word, and either 1, 2, or 4 accesses for 8 pixels of character data (depending on if the BG is 2, 4, or 8 bits, and see now why the bitplanes are stored the way they are?). For Modes 5 and 6, 2 or 4 memory accesses (again, if the BG is 2 or 4 bits) are required for 16 half-pixels of character data. Since this is at most 8 memory accesses for any BG mode, and 8 pixels are loaded at a time, you can see we just break even. For Mode 7, a tilemap entry is read from the low-byte VRAM chip and a pixel from the high-byte chip. During the rendering of the first tile, the third tile is being loaded from VRAM. This is a total of 256 memory access cycles.
Also during this time, OAM is being examined to determine the first 32 sprites on the next scanline. This (and the later loading during H-Blank) is the reason for the dummy scanline 0, otherwise there would be no sprite data for the first scanline on the screen.
During H-Blank, 68 memory access cycles are devoted to loading the next scanline from 34 4-bit sprite tiles, and 16 memory access cycles to loading the scanline for the first two tiles of the next scanline (recall that the third tile is being loaded while the first is being rendered). This totals 340 memory access cycles.
The SPC700 is nominally clocked at 1024000 Hz, however my SNES seems to run at ~1026900 Hz instead.
Instruction timing is not well known. There are some docs available, but their accuracy is suspect.
The SPC700 has 3 timers, one clocked at “64000 Hz” and two at “8000 Hz”. In reality, the fast timer ticks every 16 cycles and the slow every 128, whatever length the SPC700 cycles really are.
The SPC700 communicates with the S-CPU via 4 registers. Exact memory access timings on these registers is not known, however it is possible that the 5A22 will be performing a read at the instant the SPC700 is performing a write. The 5A22 will then read the logical OR of the old and new values of the register.
The DSP outputs samples at “32000 Hz”, although a real rate of one sample every 32 SPC700 cycles is more likely.
Other timing is not known. If you do know, please fill in the details here.
by Anomie (anomie@users.sourceforge.net)


SVG Generator Example
The SVG Generator example shows how to add SVG file export to applications.
Scalable Vector Graphics (SVG) is an XML-based language for describing two-dimensional vector graphics. Qt provides classes for rendering and generating SVG drawings. This example allows the user to create a simple picture and save it to an SVG file.
The example consists of two classes: Window
and DisplayWidget
.
The Window
class contains the application logic and constructs the user interface from a Qt Designer UI file as described in the Qt Designer manual. It also contains the code to write an SVG file.
The DisplayWidget
class performs all the work of painting a picture on screen. Since we want the SVG to resemble this picture as closely as possible, we make this code available to the Window
class so that it can be used to generate SVG files.
The DisplayWidget Class
The DisplayWidget
class displays a drawing consisting of a selection of elements chosen by the user. These are defined using Shape
and Background
enums that are included within the class definition:
class DisplayWidget : public QWidget { Q_OBJECT public: enum Shape { House = 0, Car = 1 }; enum Background { Sky = 0, Trees = 1, Road = 2 }; DisplayWidget(QWidget *parent = 0); QColor color() const; void paint(QPainter &painter); public slots: void setBackground(Background background); void setColor(const QColor &color); void setShape(Shape shape); protected: void paintEvent(QPaintEvent *event) override; private: Background background; QColor shapeColor; Shape shape; QHash<Shape,QPainterPath> shapeMap; QPainterPath moon; QPainterPath tree; };
Much of this class is used to configure the appearance of the drawing. The paintEvent()
and paint()
functions are most relevant to the purpose of this example, so we will describe these here and leave the reader to look at the source code for the example to see how shapes and colors are handled.
We reimplement the QWidget::paintEvent() function to display the drawing on screen:
void DisplayWidget::paintEvent(QPaintEvent * /* event */) { QPainter painter; painter.begin(this); painter.setRenderHint(QPainter::Antialiasing); paint(painter); painter.end(); }
Here, we only construct a QPainter object, begin painting on the device and set a render hint for improved output quality before calling the paint()
function to perform the painting itself. When this returns, we close the painter and return.
The paint()
function is designed to be used for different painting tasks. In this example, we use it to draw on a DisplayWidget
instance and on a QSvgGenerator object. We show how the painting is performed to demonstrate that there is nothing device-specific about the process:
void DisplayWidget::paint(QPainter &painter) { painter.setClipRect(QRect(0, 0, 200, 200)); painter.setPen(Qt::NoPen); switch (background) { case Sky: default: painter.fillRect(QRect(0, 0, 200, 200), Qt::darkBlue); painter.translate(145, 10); painter.setBrush(Qt::white); painter.drawPath(moon); painter.translate(-145, -10); break; case Trees: { painter.fillRect(QRect(0, 0, 200, 200), Qt::darkGreen); painter.setBrush(Qt::green); painter.setPen(Qt::black); for (int y = -55, row = 0; y < 200; y += 50, ++row) { int xs; if (row == 2 || row == 3) xs = 150; else xs = 50; for (int x = 0; x < 200; x += xs) { painter.save(); painter.translate(x, y); painter.drawPath(tree); painter.restore(); } } break; } case Road: painter.fillRect(QRect(0, 0, 200, 200), Qt::gray); painter.setPen(QPen(Qt::white, 4, Qt::DashLine)); painter.drawLine(QLine(0, 35, 200, 35)); painter.drawLine(QLine(0, 165, 200, 165)); break; } painter.setBrush(shapeColor); painter.setPen(Qt::black); painter.translate(100, 100); painter.drawPath(shapeMap[shape]); }
The Window Class
The Window
class represents the example's window, containing the user interface, which has been created using Qt Designer:
class Window : public QWidget, private Ui::Window { Q_OBJECT public: Window(QWidget *parent = 0); public slots: void saveSvg(); void updateBackground(int background); void updateColor(); void updateShape(int shape); private: QString path; };
As with the DisplayWidget
class, we concentrate on the parts of the code which are concerned with painting and SVG generation. In the Window
class, the saveSvg()
function is called whenever the Save As... button is clicked; this connection was defined in the window.ui
file using Qt Designer.
The start of the saveSvg()
function performs the task of showing a file dialog so that the user can specify a SVG file to save the drawing to.
void Window::saveSvg() { QString newPath = QFileDialog::getSaveFileName(this, tr("Save SVG"), path, tr("SVG files (*.svg)")); if (newPath.isEmpty()) return; path = newPath; QSvgGenerator generator; generator.setFileName(path); generator.setSize(QSize(200, 200)); generator.setViewBox(QRect(0, 0, 200, 200)); generator.setTitle(tr("SVG Generator Example Drawing")); generator.setDescription(tr("An SVG drawing created by the SVG Generator " "Example provided with Qt.")); QPainter painter; painter.begin(&generator); displayWidget->paint(painter); painter.end(); }
In the rest of the function, we set up the generator and configure it to generate output with the appropriate dimensions and write to the user-specified file. We paint on the QSvgGenerator object in the same way that we paint on a widget, calling the DisplayWidget::paint()
function so that we use exactly the same code that we used to display the drawing.
The generation process itself begins with the call to the painter's begin() function and ends with call to its end() function. The QSvgGenerator paint device relies on the explicit use of these functions to ensure that output is written to the file.
Further Reading
The SVG Viewer Example shows how to display SVG drawings in an application, and can be used to show the contents of SVG files created by this example.
See the Qt SVG module documentation for more information about SVG and Qt's SVG classes.
Files:


Nobody reads this small text anyways and if you are reading this now, you better get back to work.
So will not worry about the content here as even google is not interested in crawling this useless blank space stuffing.
Let's just place some random sentences and move on with some meaningless activities.


Mary Black announces return to Vicar St next year
by By Digital Desk staffMary Black has announced an extra date next year.
Mary Black will perform on March 22 at Vicar St, alongside her band to perform fan favourites as well as new songs from her latest album 'Mary Black Orchestrated'.
The band includes Bill Shanley, Pat Crowley, Nick Scott, Richie Buckley and Liam Bradley.
Tickets start at €38 and will go on sale this Thursday at 10am.
A number of other performances around the country are already on sale. All tickets can be found here.


As one might expect, lifting the CGLE into two-dimensional space makes things significantly more complicated. In addition to quasi-1D versions of the coherent structures found in the one-dimensional CGLE, there are a variety of other coherent structures.
Along side two-dimensional analogues of defect and phase turbulence, solutions known as 'frozen states' are commonly observed. Such a state is illustrated here:
Hold the cursor over the right-hand plot to see the periodic motion of the spiral waves.
These solutions are composed of cellular structures which take the form of a stationary arrangement of spiral defects (where spirals are either emitted or disappear) surrounded by shocklines (another form of defect). The arrangement of these shocklines form the cellular pattern
Two movie (.avi) files are available here, illustrating the evolution of and in selecting the above frozen state.
| spirals-abs.avi (2.1MB) | |
| spirals-real.avi (2.1MB) |
From the first of these animations, one can clearly see that selection of the final state takes place over two time-scales: a fast scale where early transients die away and a slow scale where the spiral source defect (where the spirals are emitted from) slowly converges to its steady state.
For a complete review of the phase diagram for the two-dimensional CGLE, please refer to Chaté (1996).


Plato on Github
Report Home
src/react/appContext.js
Maintainability
74.96
Lines of code
73
Difficulty
21.32
Estimated Errors
0.27
Function weight
By Complexity
By SLOC
/** * @module react/appContext * @memberof react */ import React from 'react'; // `React` must be in scope when using JSX import debounce from '../lib/debounce'; class AppContextContainer extends React.Component { getChildContext() { /** * @typedef {Object} Context * * Application components can optionally recieve a `context` object, as an * instance parameter, for interacting with or manipulating the application * at the top-level in a consistent through the provided methods. The * "context" feature of React is a way to provide this object implicitly to * child components without the need to explicitly "passing down" the * object through all of the layers of components. * * @property {Function} request - perform a root-relative API request; * where the root is prefilled by the value provided at application init. * @property {Function} setState - pass the new state object to change the * current state of the application; state change will incur a re-render. * @property {Object} state - the current state of the application; a copy * of the actual state instead of a reference to the actual state object. * @property {Function} visit - pass an application path to naviate to the * corresponding page; an API request will be made if necessary. * * @example * // define a new application component * function MessageBoard(props, context) { * // ... * } * // "opt-in" to recieve context properties; * // otherwise they will not be provided by React * MessageBoard.contextTypes = { * setState: React.PropTypes.func, * }; */ const context = { request: this.props.app.request, setState: debounce(this.props.setState), state: this.props.app.state, visit: this.props.app.visit, }; return context; } render() { return (this.props.children); } } AppContextContainer.childContextTypes = { request: React.PropTypes.func, setState: React.PropTypes.func, state: React.PropTypes.object, visit: React.PropTypes.func, }; AppContextContainer.propTypes = { app: React.PropTypes.shape({ request: React.PropTypes.func, state: React.PropTypes.object, visit: React.PropTypes.func, }).isRequired, children: React.PropTypes.element.isRequired, setState: React.PropTypes.func.isRequired, }; export default AppContextContainer;


Previous: type-error-datum, Up: Types and Classes Dictionary
simple-type-error, simple-condition, type-error, error, serious-condition, condition, t
Conditions of type simple-type-error are like conditions of type type-error, except that they provide an alternate mechanism for specifying how the condition is to be reported; see the type simple-condition.
‘simple-condition-format-control; simple-condition-format-arguments’ ,
simple-condition-format-arguments, ‘type-error-datum; type-error-expected-type’ , type-error-expected-type


Classes | |
| struct | boost::geometry::coordinate_system< G > |
| Meta-function which defines coordinate system for any geometry. More... | |
| struct | boost::geometry::coordinate_type< G > |
| Meta-function which defines coordinate type (int, float, double, etc) of any geometry. More... | |
| struct | boost::geometry::cs_tag< G > |
| Meta-function returning coordinate system tag (cs family) of any geometry. More... | |
| struct | boost::geometry::dimension< G > |
| Meta-function which defines coordinate dimensions, i.e. the number of axes of any geometry. More... | |
| struct | boost::geometry::exception |
| Base exception class for GGL. More... | |
| struct | boost::geometry::geometry_id< Geometry > |
| Meta-function the id for a geometry type. More... | |
| struct | boost::geometry::interior_type< Geometry > |
| Meta-function defining container type of inner rings of (multi)polygon geometriy. More... | |
| struct | boost::geometry::is_linear< Geometry > |
| Meta-function defining "true" for linear types (linestring,ring), "false" for non-linear typse. More... | |
| struct | boost::geometry::is_multi< Geometry > |
| Meta-function defining "true" for multi geometries (multi_point, etc). More... | |
| struct | boost::geometry::is_radian< CoordinateSystem > |
| Meta-function to verify if a coordinate system is radian. More... | |
| struct | boost::geometry::point_order< Geometry > |
| Meta-function which defines point type of any geometry. More... | |
| struct | boost::geometry::point_type< Geometry > |
| Meta-function which defines point type of any geometry. More... | |
| struct | boost::geometry::ring_type< Geometry > |
| Meta-function which defines ring type of (multi)polygon geometry. More... | |
| struct | boost::geometry::tag< Geometry > |
| Meta-function to get the tag of any geometry type. More... | |
| struct | boost::geometry::topological_dimension< Geometry > |
| Meta-function returning the topological dimension of a geometry. More... |
|
December 1, 2009 |
Copyright © 1995-2009 Barend Gehrels, Geodan, Amsterdam Copyright © 2008-2009 Bruno Lalande, Paris Copyright © 2009 Mateusz Loskot, Cadcorp, London |


;; Produces the union of two sets
(define (set-union set1 set2)
(let loop ((set1 set1)
(set2 set2))
(if (null? set2)
set1
(let ((item (car set2)))
(if (member item set1)
(loop set1 (cdr set2))
(loop (cons item set1) (cdr set2)))))))
(define (all? pred coll)
(if (null? coll)
#t
(and (pred (car coll))
(all? pred (cdr coll)))))
(define (filter pred coll)
(let loop ((ret '())
(coll coll))
(if (null? coll)
(reverse ret)
(let ((a (car coll)))
(if (pred a)
(loop (cons a ret) (cdr coll))
(loop ret (cdr coll)))))))
Last modified: Wed Jan 25 22:04:37 CET 2012


| DOSE: |
1.67 Tbsp |
oral |
Nutmeg |
(ground / crushed) |
Last night, I presented myself with a choice of tripping off of Robotussin or getting high from eating nutmeg. Since I was beginning to have anxiety towards tripping (because my last trip was a traumatizing one), I tried to call up some of my most trusted friend to see if they'd spend time with me to help me relax. Because nobody was home, or plainly unavailable, I decided to choose the path of nutmeg. Around 11pm, I took out a measuring spoon and poured a roughly measured tablespoon of nutmeg and ate it, quickly chasing it with water. I poured some more nutmeg into the spoon, this time stopping somwehere between half and 3/4's of the spoon, and then I did the same with that.
To pass the time and keep my mind off wondering when it will start working, I took a shower and then checked my email. As I was checking my email, my heartrate just about doubled and things had a slight trail behind it (11:45pm or 12am). I turned around and looked at the light behind me. Amazingly, the light was in the center, but there was a ring of blackness that cascaded out and faded into vibrant colors. I then ran to the bathroom to see what I looked like. I was pale, I had dark circles around my eyes. Also, my eyes were heavily bloodshot and seemed to have a crystal coating over it. At times, if I stared long enough, I saw my pupils slowly dilate and then disappear, and then stabilize into the usual slightly dilated position.
Soon after, I'm not too sure how long after it began, I started to dose off. It felt like I was not only falling asleep, but falling away from the rest of reality, in which I did. I had odd dreams. The dreams were trips themselves, and were rather pleasant. I woke up many times that night, or morning, laughing, saying 'hello' as if I answered the phone, or saying things that were random and disturbing. I then realized that the beeping noise that I heard for quite some time was my alarm clock. I had to be at work early (out of all the Saturdays, too).
I woke up, permanently, feeling sober, and rather rested. I was rather satisfied with what the nutmeg did. So I went upstairs, and had a cup of coffee, and then went to work. I don't know what happened, but on the way to work, I felt like I was beginning to float out of my car. I tried to grab the steering wheel tightly, but I couldn't feel it. I was driving at 40mph, and I felt g-force pushing me into the seat. I have a system in my car, and it suddenly became unbearably loud.
[Erowid Note: Driving while intoxicated or tripping is dangerous and irresponsible because it endangers other people. Don't do it!]  There was no possible way I'd be able to pass off working and act sober at the same time. I took one last look in the mirror, and it was horrible. Just two bright red slits for eyes, and two black holes in the middle of it all for pupils. I didn't think I'd be able to make it.
Just my luck, I was on an express register, and there was a radiothon going on in front of the register, and the day was an unusually busy day.  Working in these conditions made my high very uncomfortable. It just seemed to get worse and worse, it was completely unexpected, and I was beginning to wonder if I should have somebody bring me to the hospital. I thought I committed suicide and death was mocking me.
After long, never ending hours at work, the high pretty much crashed down and left me with a terrible headache, ringing ears, exhaustion, cotton mouth, tremors, and a general drone, more so than the usual one I have, in my head. This occurred about 9/10's through my shift. I also had a grad party to go to afterwards. It was just the circumstances I guess.
All in all, nutmeg is a fun drug to take. I enjoyed it, despite the fact that the last 6 hours (the time spent at work) were a nightmare. That wasn't my first time doing nutmeg, I have done it a few times before. The high is incredible, almost to the point where I'm too high to move, and can come unexpected, sometimes at the wrong times.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


org.apache.velocity.runtime.resource.loader
Class FileResourceLoader
java.lang.Object
|
+--org.apache.velocity.runtime.resource.loader.ResourceLoader
|
+--org.apache.velocity.runtime.resource.loader.FileResourceLoader
- public class FileResourceLoader
- extends ResourceLoader
A loader for templates stored on the file system.
- Version:
- $Id: FileResourceLoader.java,v <IP_ADDRESS> 2004/03/03 23:23:02 geirm Exp $
- Author:
- Jason van Zyl
|
Field Summary |
private java.util.Vector |
paths
The paths to search for templates. |
private java.util.Hashtable |
templatePaths
Used to map the path that a template was found on
so that we can properly check the modification
times of the files. |
|
Method Summary |
private java.io.InputStream |
findTemplate(java.lang.String path,
java.lang.String template)
Try to find a template given a normalized path. |
long |
getLastModified(Resource resource)
Get the last modified time of the InputStream source
that was used to create the template. |
java.io.InputStream |
getResourceStream(java.lang.String templateName)
Get an InputStream so that the Runtime can build a
template with it. |
void |
init(org.apache.commons.collections.ExtendedProperties configuration)
Initialize the template loader with a
a resources class. |
boolean |
isSourceModified(Resource resource)
How to keep track of all the modified times
across the paths. |
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
paths
private java.util.Vector paths
- The paths to search for templates.
templatePaths
private java.util.Hashtable templatePaths
- Used to map the path that a template was found on
so that we can properly check the modification
times of the files.
FileResourceLoader
public FileResourceLoader()
init
public void init(org.apache.commons.collections.ExtendedProperties configuration)
- Description copied from class:
ResourceLoader
- Initialize the template loader with a
a resources class.
- Overrides:
init
in class ResourceLoader
getResourceStream
public java.io.InputStream getResourceStream(java.lang.String templateName)
throws ResourceNotFoundException
- Get an InputStream so that the Runtime can build a
template with it.
- Overrides:
getResourceStream
in class ResourceLoader
- Parameters:
name
- name of template to get- Returns:
- InputStream containing the template
- Throws:
ResourceNotFoundException
- if template not found
in the file template path.
findTemplate
private java.io.InputStream findTemplate(java.lang.String path,
java.lang.String template)
- Try to find a template given a normalized path.
- Parameters:
String
- a normalized path- Returns:
- InputStream input stream that will be parsed
isSourceModified
public boolean isSourceModified(Resource resource)
- How to keep track of all the modified times
across the paths. Note that a file might have
appeared in a directory which is earlier in the
path; so we should search the path and see if
the file we find that way is the same as the one
that we have cached.
- Overrides:
isSourceModified
in class ResourceLoader
getLastModified
public long getLastModified(Resource resource)
- Description copied from class:
ResourceLoader
- Get the last modified time of the InputStream source
that was used to create the template. We need the template
here because we have to extract the name of the template
in order to locate the InputStream source.
- Overrides:
getLastModified
in class ResourceLoader
Copyright © 2002 Apache Software Foundation. All Rights Reserved.


This tutorial will go over the basics of the Egg
data object, the
essential quail
data structure that contains all the data you need
to run analyses and plot the results. An egg is made up of two primary
pieces of data:
pres
data - stimuli/features that were presented to a subjectrec
data - stimuli/features that were recalled by the subject.You cannot create an egg
without both of these components.
Additionally, there are a few optional fields:
dist_funcs
dictionary - this field allows you to control the
distance functions for each of the stimulus features. For more on
this, see the fingerprint tutorial.meta
dictionary - this is an optional field that allows you to
store custom meta data about the dataset, such as the date collected,
experiment version etc.There are also a few other fields and functions to make organizing and
modifying eggs
easier (discussed at the bottom). Now, lets dive in
and create an egg
from scratch.
In [1]:
import quail
%matplotlib inline
/usr/local/lib/python3.6/site-packages/pydub/utils.py:165: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
pres
data structure¶The first piece of an egg
is the pres
data, or in other words
the stimuli that were presented to the subject. For a single subject’s
data, the form of the input will be a list of lists, where each list is
comprised of the words presented to the subject during a particular
study block. Let’s create a fake dataset of one subject who saw two
encoding lists:
In [2]:
presented_words = [['cat', 'bat', 'hat', 'goat'],['zoo', 'animal', 'zebra', 'horse']]
rec
data structure¶The second fundamental component of an egg is the rec
data, or the
words/stimuli that were recalled by the subject. Now, let’s create the
recall lists:
In [3]:
recalled_words = [['bat', 'cat', 'goat', 'hat'],['animal', 'horse', 'zoo']]
We now have the two components necessary to build an egg
, so let’s
do that and then take a look at the result.
In [4]:
egg = quail.Egg(pres=presented_words, rec=recalled_words)
That’s it! We’ve created our first egg
. Let’s take a closer look at
how the egg
is setup. We can use the info
method to get a quick
snapshot of the egg
:
In [5]:
egg.info()
Number of subjects: 1
Number of lists per subject: 2
Number of words per list: 4
Date created: Tue Jul 31 10:26:50 2018
Meta data: {}
Now, let’s take a closer look at how the egg
is structured. First,
we will check out the pres
field:
In [6]:
egg.get_pres_items()
Out[6]:
| 0 | 1 | 2 | 3 | ||
|---|---|---|---|---|---|
| Subject | List | ||||
| 0 | 0 | cat | bat | hat | goat |
| 1 | zoo | animal | zebra | horse |
As you can see above, the pres
field was turned into a multi-index
Pandas DataFrame organized by subject and by list. This is how the
pres
data is stored within an egg, which will make more sense when
we consider larger datasets with more subjects. Next, let’s take a look
at the rec
data:
In [7]:
egg.get_rec_items()
Out[7]:
| 0 | 1 | 2 | 3 | ||
|---|---|---|---|---|---|
| Subject | List | ||||
| 0 | 0 | bat | cat | goat | hat |
| 1 | animal | horse | zoo | NaN |
The rec
data is also stored as a DataFrame. Notice that if the
number of recalled words is shorter than the number of presented words,
those columns are filled with a NaN
value. Now, let’s create an
egg
with two subject’s data and take a look at the result.
eggs
¶
In [8]:
# presented words
sub1_presented=[['cat', 'bat', 'hat', 'goat'],['zoo', 'animal', 'zebra', 'horse']]
sub2_presented=[['cat', 'bat', 'hat', 'goat'],['zoo', 'animal', 'zebra', 'horse']]
# recalled words
sub1_recalled=[['bat', 'cat', 'goat', 'hat'],['animal', 'horse', 'zoo']]
sub2_recalled=[['cat', 'goat', 'bat', 'hat'],['horse', 'zebra', 'zoo', 'animal']]
# combine subject data
presented_words = [sub1_presented, sub2_presented]
recalled_words = [sub1_recalled, sub2_recalled]
# create Egg
multisubject_egg = quail.Egg(pres=presented_words, rec=recalled_words)
multisubject_egg.info()
Number of subjects: 2
Number of lists per subject: 2
Number of words per list: 4
Date created: Tue Jul 31 10:26:54 2018
Meta data: {}
As you can see above, in order to create an egg
with more than one
subject’s data, all you do is create a list of subjects. Let’s see how
the pres
data is organized in the egg with more than one subject:
In [9]:
multisubject_egg.get_pres_items()
Out[9]:
| 0 | 1 | 2 | 3 | ||
|---|---|---|---|---|---|
| Subject | List | ||||
| 0 | 0 | cat | bat | hat | goat |
| 1 | zoo | animal | zebra | horse | |
| 1 | 0 | cat | bat | hat | goat |
| 1 | zoo | animal | zebra | horse |
Looks identical to the single subject data, but now we have two unique
subject identifiers in the DataFrame
. The rec
data is set up in
the same way:
In [10]:
multisubject_egg.get_rec_items()
Out[10]:
| 0 | 1 | 2 | 3 | ||
|---|---|---|---|---|---|
| Subject | List | ||||
| 0 | 0 | bat | cat | goat | hat |
| 1 | animal | horse | zoo | NaN | |
| 1 | 0 | cat | goat | bat | hat |
| 1 | horse | zebra | zoo | animal |
As you add more subjects, they are simply appended to the bottom of the df with a unique subject identifier.
Stimuli can also be passed as a dictionary containing the stimulus and features of the stimulus. You can include any stimulus feature you want in this dictionary, such as the position of the word on the screen, the color, or perhaps the font of the word:
In [11]:
cat_features = {
'item': 'cat',
'category': 'animal',
'word_length': 3,
'starting_letter': 'c',
}
Let’s try creating an egg with additional stimulus features:
In [12]:
# presentation features
presented_words = [
[
{
'item': 'cat',
'category': 'animal',
'word_length': 3,
'starting_letter': 'c'
},
{
'item': ' bat',
'category': 'object',
'word_length': 3,
'starting_letter': 'b'
},
{
'item': 'hat',
'category': 'object',
'word_length': 3,
'starting_letter': 'h'
},
{
'item': 'goat',
'category': 'animal',
'word_length': 4,
'starting_letter': 'g'
},
],
[
{
'item': 'zoo',
'category': 'place',
'word_length': 3,
'starting_letter': 'z'
},
{
'item': 'donkey',
'category' : 'animal',
'word_length' : 6,
'starting_letter' : 'd'
},
{
'item': 'zebra',
'category': 'animal',
'word_length': 5,
'starting_letter': 'z'
},
{
'item': 'horse',
'category': 'animal',
'word_length': 5,
'starting_letter': 'h'
},
],
]
recalled_words = [
[
{
'item': ' bat',
'category': 'object',
'word_length': 3,
'starting_letter': 'b'
},
{
'item': 'cat',
'category': 'animal',
'word_length': 3,
'starting_letter': 'c'
},
{
'item': 'goat',
'category': 'animal',
'word_length': 4,
'starting_letter': 'g'
},
{
'item': 'hat',
'category': 'object',
'word_length': 3,
'starting_letter': 'h'
},
],
[
{
'item': 'donkey',
'category' : 'animal',
'word_length' : 6,
'starting_letter' : 'd'
},
{
'item': 'horse',
'category': 'animal',
'word_length': 5,
'starting_letter': 'h'
},
{
'item': 'zoo',
'category': 'place',
'word_length': 3,
'starting_letter': 'z'
},
],
]
# create egg object
egg = quail.Egg(pres=presented_words, rec=recalled_words)
Like before, you can use the get_pres_items
method to retrieve the
presented items:
In [13]:
egg.get_pres_items()
Out[13]:
| 0 | 1 | 2 | 3 | ||
|---|---|---|---|---|---|
| Subject | List | ||||
| 0 | 0 | cat | bat | hat | goat |
| 1 | zoo | donkey | zebra | horse |
The stimulus features can be accessed by calling the
get_pres_features
method:
In [14]:
egg.get_pres_features()
Out[14]:
| 0 | 1 | 2 | 3 | ||
|---|---|---|---|---|---|
| Subject | List | ||||
| 0 | 0 | {'category': 'animal', 'word_length': 3, 'star... | {'category': 'object', 'word_length': 3, 'star... | {'category': 'object', 'word_length': 3, 'star... | {'category': 'animal', 'word_length': 4, 'star... |
| 1 | {'category': 'place', 'word_length': 3, 'start... | {'category': 'animal', 'word_length': 6, 'star... | {'category': 'animal', 'word_length': 5, 'star... | {'category': 'animal', 'word_length': 5, 'star... |
As described in the fingerprint tutorial, the features
data
structure is used to estimate how subjects cluster their recall
responses with respect to the features of the encoded stimuli. Briefly,
these estimates are derived by computing the similarity of neighboring
recall words along each feature dimension. For example, if you recall
“dog”, and then the next word you recall is “cat”, your clustering by
category score would increase because the two recalled words are in the
same category. Similarly, if after you recall “cat” you recall the word
“can”, your clustering by starting letter score would increase, since
both words share the first letter “c”. This logic can be extended to any
number of feature dimensions.
Similarity between stimuli can be computed in a number of ways. By
default, the distance function for all textual features (like category,
starting letter) is binary. In other words, if the words are in the same
category (cat, dog), there similarity would be 1, whereas if they are in
different categories (cat, can) their similarity would be 0. For
numerical features (such as word length), by default similarity between
words is computed using Euclidean distance. However, the point of this
digression is that you can define your own distance functions by passing
a dist_func
dictionary to the Egg
class. This could be for all
feature dimensions, or only a subset. Let’s see an example:
In [16]:
dist_funcs = {
'word_length' : lambda x,y: (x-y)**2
}
egg = quail.Egg(pres=presented_words, rec=recalled_words, dist_funcs=dist_funcs)
In the example code above, similarity between words for the word_length feature dimension will now be computed using this custom distance function, while all other feature dimensions will be set to the default.
egg
¶Lastly, we can add meta data to the egg
. We added this field to help
researchers keep their eggs organized by adding custom meta data to the
egg
object. The data is added to the egg
by passing the meta
key word argument when creating the egg
:
In [17]:
meta = {
'Researcher' : 'Andy Heusser',
'Study' : 'Egg Tutorial'
}
egg = quail.Egg(pres=presented_words, rec=recalled_words, meta=meta)
egg.info()
Number of subjects: 1
Number of lists per subject: 2
Number of words per list: 4
Date created: Tue Jul 31 10:27:11 2018
Meta data: {'Researcher': 'Andy Heusser', 'Study': 'Egg Tutorial'}
listgroup
and subjgroup
to an egg
¶While the listgroup
and subjgroup
arguments can be used within
the analyze
function, they can also be attached directly to the
egg
, allowing you to save condition labels for easy organization and
easy data sharing.
To do this, simply pass one or both of the arguments when creating the
egg
:
In [18]:
# presented words
sub1_presented=[['cat', 'bat', 'hat', 'goat'],['zoo', 'animal', 'zebra', 'horse']]
sub2_presented=[['cat', 'bat', 'hat', 'goat'],['zoo', 'animal', 'zebra', 'horse']]
# recalled words
sub1_recalled=[['bat', 'cat', 'goat', 'hat'],['animal', 'horse', 'zoo']]
sub2_recalled=[['cat', 'goat', 'bat', 'hat'],['horse', 'zebra', 'zoo', 'animal']]
# combine subject data
presented_words = [sub1_presented, sub2_presented]
recalled_words = [sub1_recalled, sub2_recalled]
# create Egg
multisubject_egg = quail.Egg(pres=presented_words,rec=recalled_words, subjgroup=['condition1', 'condition2'],
listgroup=['early','late'])
egg
¶Once you have created your egg, you can save it for use later, or to
share with colleagues. To do this, simply call the save
method with
a filepath:
multisubject_egg.save('myegg')
To load this egg later, simply call the load_egg
function with the
path of the egg:
egg = quail.load('myegg')
eggs
¶We now have two separate eggs, each with a single subject’s data. Let’s
combine them by passing a list
of eggs
to the stack_eggs
function:
In [19]:
# subject 1 data
sub1_presented=[['cat', 'bat', 'hat', 'goat'],['zoo', 'animal', 'zebra', 'horse']]
sub1_recalled=[['bat', 'cat', 'goat', 'hat'],['animal', 'horse', 'zoo']]
# create subject 2 egg
subject1_egg = quail.Egg(pres=sub1_presented, rec=sub1_recalled)
# subject 2 data
sub2_presented=[['cat', 'bat', 'hat', 'goat'],['zoo', 'animal', 'zebra', 'horse']]
sub2_recalled=[['cat', 'goat', 'bat', 'hat'],['horse', 'zebra', 'zoo', 'animal']]
# create subject 2 egg
subject2_egg = quail.Egg(pres=sub2_presented, rec=sub2_recalled)
In [20]:
stacked_eggs = quail.stack_eggs([subject1_egg, subject2_egg])
stacked_eggs.get_pres_items()
Out[20]:
| 0 | 1 | 2 | 3 | ||
|---|---|---|---|---|---|
| Subject | List | ||||
| 0 | 0 | cat | bat | hat | goat |
| 1 | zoo | animal | zebra | horse | |
| 1 | 0 | cat | bat | hat | goat |
| 1 | zoo | animal | zebra | horse |
eggs
¶You can use the crack_egg
function to slice out a subset of subjects
or lists:
In [21]:
cracked_egg = quail.crack_egg(stacked_eggs, subjects=[1], lists=[0])
cracked_egg.get_pres_items()
Out[21]:
| 0 | 1 | 2 | 3 | ||
|---|---|---|---|---|---|
| Subject | List | ||||
| 0 | 0 | cat | bat | hat | goat |
Alternatively, you can use the crack
method, which does the same
thing:
In [22]:
stacked_eggs.crack(subjects=[0,1], lists=[1]).get_pres_items()
Out[22]:
| 0 | 1 | 2 | 3 | ||
|---|---|---|---|---|---|
| Subject | List | ||||
| 0 | 0 | zoo | animal | zebra | horse |
| 1 | 0 | zoo | animal | zebra | horse |


--- layout: default pagetitle: home ---
CoffeeGrind keeps track of what you do.
Never forget to track time again.
Tracks your time by file.
Go outside and play or grab a cup of coffee. CoffeeGrind will pause while you're away.
Automatically groups time in your git project files.
Works with any app including: Sketch, Illustrator,
Sublime Text, and Vim.
For Mac OSX 10.9+


| C_02_trellis.par.get {lattice} | R Documentation |
Functions used to query, display and modify graphical parameters for fine control of Trellis displays. Modifications are made to the settings for the currently active device only.
trellis.par.set(name, value, ..., theme, warn = TRUE, strict = FALSE) trellis.par.get(name = NULL) show.settings(x = NULL)
name |
A character string giving the name of a component. If unspecified
in |
value |
a list giving the desired value of the component. Components that
are already defined as part of the current settings but are not
mentioned in |
theme |
a list decribing how to change the settings, similar to what is
returned by As in |
... |
Multiple settings can be specified in |
warn |
A logical flag, indicating whether a warning should be issued when
|
strict |
Usually a logical flag, indicating whether the An even stricter interpretation is allowed by specifying
|
x |
optional list of components that change the settings (any valid
value of |
The various graphical parameters (color, line type, background etc)
that control the look and feel of Trellis displays are highly
customizable. Also, R can produce graphics on a number of devices, and
it is expected that a different set of parameters would be more suited
to different devices. These parameters are stored internally in a
variable named lattice.theme
, which is a list whose components
define settings for particular devices. The components are idenified
by the name of the device they represent (as obtained by
.Device
), and are created as and when new devices are opened
for the first time using trellis.device
(or Lattice plots are
drawn on a device for the first time in that session).
The initial settings for each device defaults to values appropriate
for that device. In practice, this boils down to three distinct
settings, one for screen devices like x11
and windows
,
one for black and white plots (mostly useful for postscript
)
and one for color printers (color postcript
, pdf
).
Once a device is open, its settings can be modified. When another
instance of the same device is opened later using
trellis.device
, the settings for that device are reset to its
defaults, unless otherwise specified in the call to
trellis.device
. But settings for different devices are treated
separately, i.e., opening a postscript device will not alter the x11
settings, which will remain in effect whenever an x11 device is
active.
The functions trellis.par.*
are meant to be interfaces to the
global settings. They always apply on the settings for the currently
ACTIVE device.
trellis.par.get
, called without any arguments, returns the full
list of settings for the active device. With the name
argument
present, it returns that component only. trellis.par.get
sets
the value of the name
component of the current active device
settings to value
.
trellis.par.get
is usually used inside trellis functions to get
graphical parameters before plotting. Modifications by users via
trellis.par.set
is traditionally done as follows:
add.line <- trellis.par.get("add.line")
add.line$col <- "red"
trellis.par.set("add.line", add.line)
More convenient (but not S compatible) ways to do this are
trellis.par.set(list(add.line = list(col = "red")))
and
trellis.par.set(add.line = list(col = "red"))
The actual list of the components in trellis.settings
has not
been finalized, so I'm not attempting to list them here. The current
value can be obtained by print(trellis.par.get())
. Most names
should be self-explanatory.
show.settings
provides a graphical display summarizing some of
the values in the current settings.
trellis.par.get
returns a list giving parameters for that
component. If name
is missing, it returns the full list.
Most of the settings are graphical parameters that control various elements of a lattice plot. For details, see the examples below. The more unusual settings are described here.
Grid graphical parameters that are in effect globally unless overridden by specific settings.
A list of two components (each a numeric scalar),
text
and points
, for text and symbols
respectively.
A list of two components (each a character string,
either "on"
or "off"
), panel
and
strip
.
In some ways, trellis.par.get
and trellis.par.set
together are a replacement for the par
function used in
traditional R graphics. In particular, changing par
settings
has little (if any) effect on lattice output. Since lattice plots are
implemented using Grid graphics, its parameter system does have
an effect unless overridden by a suitable lattice parameter setting.
Such parameters can be specified as part of a lattice theme by
including them in the grid.pars
component (see
gpar
for a list of valid parameter names).
Deepayan Sarkar<EMAIL_ADDRESS>show.settings() tp <- trellis.par.get() unusual <- c("grid.pars", "fontsize", "clip", "axis.components", "layout.heights", "layout.widths") for (u in unusual) tp[[u]] <- NULL names.tp <- lapply(tp, names) unames <- sort(unique(unlist(names.tp))) ans <- matrix(0, nrow = length(names.tp), ncol = length(unames)) rownames(ans) <- names(names.tp) colnames(ans) <- unames for (i in seq(along = names.tp)) ans[i, ] <- as.numeric(unames %in% names.tp[[i]]) ans <- ans[, order(-colSums(ans))] ans <- ans[order(rowSums(ans)), ] ans[ans == 0] <- NA levelplot(t(ans), colorkey = FALSE, scales = list(x = list(rot = 90)), panel = function(x, y, z, ...) { panel.abline(v = unique(as.numeric(x)), h = unique(as.numeric(y)), col = "darkgrey") panel.xyplot(x, y, pch = 16 * z, ...) }, xlab = "Graphical parameters", ylab = "Setting names")


AllocationCreate
class AllocationCreate extends AbstractAllocation
Create a new allocation record
Constants
| ALLOCATE_BY_PERCENTAGE |
|
| ALLOCATE_BY_ABSOLUTE |
|
Methods
__construct(string $controlId = null)
Initializes the class with the given parameters.
from AbstractFunction
Details
in AbstractFunction at line line 35
getControlId()
Get control ID
in AbstractFunction at line line 46
setControlId($controlId = null)
Set control ID
in AbstractFunction at line line 67
__construct(string $controlId = null)
Initializes the class with the given parameters.
at line line 35
writeXml(XMLWriter $xml)
Write the function block XML
in AbstractAllocation at line line 57
string
getAllocationId()
Get allocation ID
in AbstractAllocation at line line 67
setAllocationId(string $allocationId)
Set allocation ID
in AbstractAllocation at line line 77
string
getDescription()
Get description
in AbstractAllocation at line line 87
setDescription(string $description)
Set description
in AbstractAllocation at line line 97
string
getDocumentNo()
Get document number
in AbstractAllocation at line line 107
setDocumentNo(string $documentNo)
Set document number
in AbstractAllocation at line line 117
string
getAllocateBy()
Get allocate by
in AbstractAllocation at line line 128
setAllocateBy(string $allocateBy)
Set allocate by
in AbstractAllocation at line line 138
string
getAttachmentsId()
Get attachments ID
in AbstractAllocation at line line 148
setAttachmentsId(string $attachmentsId)
Set attachments ID
in AbstractAllocation at line line 158
boolean
isActive()
Get active
in AbstractAllocation at line line 168
setActive(boolean $active)
Set active
in AbstractAllocation at line line 178
AbstractAllocationLine[]
getLines()
Get allocation lines
in AbstractAllocation at line line 188
setLines(array $lines)
Set allocation lines


tripletpairs documentation¶
About¶
This package provides the tools needed to simulate time-resolved and steady-state excited state populations within the framework of the Merrifield Model (or variations on it).
This package provides the tools needed to simulate time-resolved and steady-state excited state populations within the framework of the Merrifield Model (or variations on it).


Home
Categories
CATEGORIES
CHILDREN'S CLOTHING
CHILDREN'S CLOTHING
CHILDREN'S CLOTHING
CHILDREN'S CLOTHING
CHILDREN'S CLOTHING
CHILDREN'S CLOTHING
CHILDREN'S CLOTHING
CHILDREN'S CLOTHING


If you would like more information or a call back from one of our team
or you can call us today
0161 7911 233
The first step is to speak with a Estate Planner here at Money Matters Online to identify any potential inheritance tax bill which may become due.
For more information regarding your Inheritance Tax issues, fill-in your email address and we'll contact you by email/phone.
We and our Financial Services Partners specialise in ways of protecting your wealth against Inheritance Tax, be that a simple regime of gifting cash each year or completing Trust arrangements, again protecting your wealth for you now and for your family in the future.
In the 1980’s former Labour Chancellor Roy Jenkins infamously said “inheritance tax is a voluntary levy paid by those who distrust their heirs more than they dislike the Inland Revenue”. The sentiment expressed that Inheritance tax is voluntary, remains true today, and Inheritance tax can be managed, minimised and/or eliminated in most cases.
Every year HMRC receives billions of pounds in “voluntary” inheritance tax payments. April 2017 saw the introduction of an additional allowance for passing on the family home, however, in spite of this inheritance tax is increasingly a consideration for many people as house prices rise with no corresponding rise in the nil rate band.
If you would like more information or a call back from one of our team
or you can call us today
0161 7911 233
Do you want to pay inheritance tax? It is voluntary after all. You can choose not to pay with careful planning, that’s another area where we help.


ELATHON
Home
Random Generator
Crypted Notepad
Subjects Notes
Account
▼
Random Number Generator
Minimum *
Maximum *
Number of Generations *
Number of Groups *
Duplicates
Generate
Number will be here


Pressing LOAD ONE normally loads the currently selected {_program} bank from the external drive into the Chroma. First, it prompts the user with a display like the following:
{load-one-prompt.png}
"new 13" means that 13 of the programs on the external drive don't exist in the Chroma.
"chg 11" means that 11 of the programs on the external drive also exist in the Chroma, but they are changed, as indicated by their having different timestamps.
"del 3" means that 3 of the programs in the Chroma don't exist on the external drive, and will therefore be deleted.
If there are programs on the external drive that match those in the Chroma, they aren't shown or copied.
"Store=Y, Set Split=N" tells you to press the STORE switch if you wish to copy the bank, or press SET SPLIT if you want to skip it. Both LEDs flash, as a reminder that you can press either switch. While copying, the display flashes a message saying what bank it is copying. When done, the display shows the results with a display like the following:
{load-one-result.png}
If there are any errors accessing the device, it will also show the number of operations that failed. The display reverts to the current parameter whenever the parameter slider is moved, or most any other panel operation is performed.
Holding PROG SELECT and pressing 1 to 9 temporarily selects a different bank (and puts 100 to 900 in the program number display). Pressing LOAD ONE then loads from and to that bank instead of the currently selected bank.
Holding LOAD ONE and pressing 1 to 9 changes what bank on the external drive will be loaded, allowing programs to be moved from one bank to another. You can do this even after holding PROG SELECT and pressing 1 to 9 to select a different internal bank, for complete flexibility. For instance, holding PROG SELECT and pressing 3, then holding LOAD ONE and pressing 5, will load external bank 5 into bank 3.
So remember, PROG SELECT plus a number sets both the internal and external bank, LOAD ONE plus a number sets only the external bank.


We are working to build a new classfinder interface for WWU to ease your life and the work load on Western's servers. Everybody wins!
If you want to request a feature then email the project organizer.


Tester test case files must have correct names.
Nette Tester searches for files with the phpt extension, or, starting from 2.0, files with the php extension and Test name suffix.
phpt
php
Test