#JavaScript Array
2Array.prototype.push()
3Array.prototype.indexOf()
4Array.prototype.slice()
5Array.prototype.toString()
6Array.prototype.filter()
7Array.prototype.join()
8Array.prototype.splice()
9Array.prototype.forEach()
10Array.prototype.concat()
11Array.prototype.shift()
12Array.prototype.unshift()
13Array.prototype.map()
14Array.prototype.sort()
15Array.prototype.pop()
16Array.prototype.reduce()
17Array.prototype.some()
18Array.prototype.lastIndexOf()
19Array.prototype.reduceRight()
20Array.prototype.every()
21Array.prototype.reverse()
The array consists of one or more elements, each having a numbered position inside of the array. This is also called the index. Any given array element can hold any type offered by the JavaScript language. In other words, you can mix and match the various types inside of the same array. Just like most programming languages, arrays in JavaScript are zero based. This means they start at 0 and move up from there. Arrays in JavaScript grow and shrink like magic. That is to say, you do not have to specify the array size ahead of time before placing values in the array. As you add elements, the array dynamically grows for you. The same happens when you remove elements. All JavaScript arrays have a link to Array.prototype which is how we get access to all of the very useful functions we’ll cover here in this tutorial. In true JavaScript style, these functions work not only on any array, but also any “array-like” object.
array.push(element1, …, elementN)
The push() function appends the arguments given to it, in order, to the end of the array. It modifies the array directly, rather than creating a new array.
When you make a call to push(), it returns the total number of items in the array, after any provided arguments have been added to the end of the array.
`
``js
let characters = [‘Darth Vader’, ‘Yoda’, ‘Boba Fett’];
let total = characters.push(‘Luke Skywalker’, ‘Han Solo’);
console.log(characters); // [“Darth Vader”, “Yoda”, “Boba Fett”, “Luke Skywalker”, “Han Solo”]
console.log(total); // 5
```
array.indexOf(searchElement, fromIndex = 0,fromIndex=0)
Overview
The JavaScript indexOf() function searches an array for an element that contains a specific value, then returns the very first index that contains that value. You can provide a starting index to the function if you like, otherwise searching will begin from index 0.
What indexOf() returns
The lowest index that is greater than or equal to the start of the array at which the element is equal to the given value. If no match is found, the indexOf() function returns -1.
array.indexOf() function examples
let starwars = [‘Episode 4: A New Hope’,
‘Episode 5: The Empire Strikes Back’,
‘Episode 6: Return of the Jedi’,
‘Episode 1: The Phantom Menace’,
‘Episode 2: Attack of the Clones’,
‘Episode 3: Revenge of the Sith’,
‘Episode 7: The Force Awakens’];
console.log(starwars.indexOf(‘Episode 7: The Force Awakens’)); // 6
console.log(starwars.indexOf(‘Episode 3: Revenge of the Sith’)); // 5
console.log(starwars.indexOf(‘Episode 2: Attack of the Clones’, 3)); // 4
console.log(starwars.indexOf(‘Episode 1: The Phantom Menace’, -4)); // 3
let locatedat = [];
let enemies = [‘Kylo Ren’, ‘Darth Vader’, ‘Storm Trooper’, ‘General Hux’, ‘Emperor Palpatine’, ‘Storm Trooper’];
let enemy = ‘Storm Trooper’;
let enemylocation = enemies.indexOf(enemy);
while (enemylocation != -1) {
locatedat.push(enemylocation);
enemylocation = enemies.indexOf(enemy, enemylocation + 1);
}
console.log(locatedat); // 2, 5
The example above is a little more tricky. We have an array of enemies, and there might be multiple of a given enemy. By making use of indexOf(), we can find all instances of ‘Storm Trooper’ in our array of enemies. Running the code shows us that we have found a Storm Trooper at index 2 and index 5 of our array.
function theGoodSide(goodguys, goodguy) {
if (goodguys.indexOf(goodguy) === -1) {
goodguys.push(goodguy);
console.log(‘The new goodguys are’ + goodguys);
} else if (goodguys.indexOf(goodguy) > -1) {
console.log(goodguy + ’ is already part of the goodguys.’);
}
}
let thegoodguys = [‘Luke Skywalker’, ‘Han Solo’, ‘Princess Leia’];
theGoodSide(thegoodguys, ‘Han Solo’); // Han Solo is already part of the goodguys.
theGoodSide(thegoodguys, ‘Yoda’); // The new goodguys are Luke Skywalker,Han Solo,Princess Leia,Yoda
theGoodSide(thegoodguys, ‘Ben Kenobi’); // The new goodguys are Luke Skywalker,Han Solo,Princess Leia,Yoda,Ben Kenobi
theGoodSide(thegoodguys, ‘R2-D2’); // The new goodguys are Luke Skywalker,Han Solo,Princess Leia,Yoda,Ben Kenobi,R2-D2
theGoodSide(thegoodguys, ‘Luke Skywalker’); // Luke Skywalker is already part of the goodguys.
This example makes use of a custom function that we can use to make sure our good guys are all accounted for. We check to see if the character exists in our collection, and if not, we add them to our good side.
array.slice(ParseError: KaTeX parse error: Undefined control sequence: [ at position 6: begin\̲[̲, end])
Overview
The JavaScript slice() function takes a start and end argument. It uses these start and end points to reach into the array, and remove a specific number of elements. The position you reference by start is included in the results, but the end is not included. In other words all elements are returned from the start right up to, but not including the end element. If you do not provide an end value, slice() will return the rest of the array starting from the given starting point. The original array is left in tact.
What slice() returns
The slice() function returns a new array that contains all of the elements of the original array from the element specified by the starting point provided, and up to but not including, the element specified by the ending point provided.
array.slice() function examples
let vaderparts = [‘helmet’, ‘left arm’, ‘right arm’, ‘left leg’, ‘right leg’];
let chopped = vaderparts.slice(2,3);
console.log(chopped); // right arm
array.toString()
The toString() function converts all elements in an array to strings and outputs one big string as a comma separated list of items.
array.toString() function examples
let spacecraft = [‘X Wing’, ‘Death Star’, ‘Millenium Falcon’, ‘Jedi Interceptor’];
let allspacecraft = spacecraft.toString();
console.log(allspacecraft);
// X Wing,Death Star,Millenium Falcon,Jedi Interceptor
array.filter(callback, thisArg,thisArg)
Overview
The JavaScript filter() function is very useful for doing exactly what it says, filtering down a collection of elements based on a given test. When you call the filter() function, you need to pass it a callback. This callback is executed against every element in the array. If that callback results in a true value, that particular element is added to a new array. The original array is left unchanged.
What filter() returns
filter() returns a new array that contains only the elements of the original array that returned true when the provided callback ran.
array.filter() function examples
let summer = [10, 20, 30, 40, 50, 60, 70, 80].filter(function niceweather(temperature) {
return temperature >= 70;
});
console.log(summer); // 70, 80
let spacecraft = [
{name: ‘Tie Fighter’, speed: 200000},
{name: ‘Super Star Destroyer’, speed: 300000},
{name: ‘Death Star’, speed: 400000},
{name: ‘T65 X Wing Star fighter’, speed: 500000},
{name: ‘T47 Air (snow) Speeder’, speed: 600000},
{name: ‘74-Z Speeder Bike’, speed: 700000},
{name: ‘Millenium Falcon’, speed: 800000}
];
function filterBySpeed(spacecraft) {
return spacecraft.speed > 450000;
}
let fleet = spacecraft.filter(filterBySpeed);
fleet.forEach(function (craft) {
console.log(craft.name);
});
// T65 X Wing Star fighter
// T47 Air (snow) Speeder
// 74-Z Speeder Bike
// Millenium Falcon
string = array.join(separator = ’,’separator=′,′)
Overview
The join() function converts each element of an array to a string and then concatenates those strings together. If the separator string was provided, it gets inserted between all elements in the final string.
What join() returns
The string that results from converting each element of the original array to a string and then joining them together, with the separator string between elements.
array.join() function examples
let wisdom = [‘Yoda Says’, ‘Fear is the path to the dark side. Fear leads to anger. Anger leads to hate. Hate leads to suffering.’];
wisdom = wisdom.join(‘:’);
console.log(wisdom);
// Yoda Says: Fear is the path to the dark side. Fear leads to anger. Anger leads to hate. Hate leads to suffering.
let wisdom = [‘Do. Or do not. There is no try’, ‘Luminous beings are we…not this crude matter’, ‘Wars not make one great’, ‘Judge me by my size, do you?’, ‘Truly wonderful, the mind of a child is’];
let wisdom = wisdom.join(’ <=***=> ’);
console.log(wisdom);
// Do. Or do not. There is no try <==> Luminous beings are we…not this crude matter <==> Wars not make one great <==> Judge me by my size, do you? <==> Truly wonderful, the mind of a child is
years = [1977, 1980, 1983, 1999, 2002, 2005, 2015];
years = years.join(‘,’);
console.log(‘New Star Wars movies came out in’ + years);
// New Star Wars movies came out in 1977, 1980, 1983, 1999, 2002, 2005, 2015
array.splice(start, deleteCountParseError: KaTeX parse error: Undefined control sequence: [ at position 8: , item1\̲[̲, item2[, …]])
Overview
The splice() function deletes zero or more elements beginning from the provided start location, and replaces those elements with zero or more new values that were provided. Existing items in the array are shifted as needed to make room for any added or deleted elements. The thing to remember about the splice() function, is that it does modify the original array directly.
Returns
An array which contains any elements that may have been deleted from the array.
array.splice() function examples
let darkSide = ['Darth Vader', 'Grand Moff Tarkin', 'Boba Fett', 'Emperor Palpatine'];
//-----------------------------------------------------//
// removes 0 elements from index 2, and inserts 'Jabba the Hutt'
let removed = darkSide.splice(2, 0, 'Jabba the Hutt');
console.log(darkSide);
// ['Darth Vader', 'Grand Moff Tarkin', 'Jabba the Hutt', 'Boba Fett', 'Emperor Palpatine']
console.log(removed);
// [], no elements removed
//-----------------------------------------------------//
// removes 1 element from index 3
removed = darkSide.splice(3, 1);
console.log(darkSide);
// ['Darth Vader', 'Grand Moff Tarkin', 'Jabba the Hutt', 'Emperor Palpatine']
console.log(removed);
// ['Boba Fett']
//-----------------------------------------------------//
// removes 1 element from index 2, and inserts 'Darth Maul'
removed = darkSide.splice(2, 1, 'Darth Maul');
console.log(darkSide);
// ['Darth Vader', 'Grand Moff Tarkin', 'Darth Maul', 'Emperor Palpatine']
console.log(removed);
// ['Jabba the Hutt']
//-----------------------------------------------------//
// removes 2 elements from index 0, and inserts 'Count Dooku', 'General Grievous' and 'Asajj Ventress'
removed = darkSide.splice(0, 2, 'Count Dooku', 'General Grievous', 'Asajj Ventress');
console.log(darkSide);
// ['Count Dooku', 'General Grievous', 'Asajj Ventress', 'Darth Maul', 'Emperor Palpatine']
console.log(removed);
// ['Darth Vader', 'Grand Moff Tarkin']
//-----------------------------------------------------//
// removes 2 elements from index 3
removed = darkSide.splice(3, darkSide.length);
console.log(darkSide);
// ['Count Dooku', 'General Grievous', 'Asajj Ventress']
console.log(removed);
// ['Darth Maul', 'Emperor Palpatine']
array.forEach(callback, thisArg,thisArg)
The forEach() function executes a provided function on each element of the array. forEach() has no return value and does not return the original array. forEach() is related to the map(), filter(), every(), and some() functions and as such they share some related details. They all expect a callback function as the first argument. The optional second argument is a way to specify the this value for the callback function. All of these functions check the length of the array before looping. If the provided callback adds elements to the array during it’s execution, those elements are not included for looping by the forEach(). Also of interesting note is that if the callback changes values in the original array before they are looped over, those changed values will be passed during their callback execution. You can also check out the Higher Order Functions In JavaScript tutorial.
array.forEach() function examples
21
22
23
24
25
26
27
28
29
let planetsAndMoons = [‘Alderaan’, ‘Bespin’, ‘Coruscant’, ‘DQar’, ‘Dagobah’, ‘Endor’, ‘Geonosis’, ‘Hosnian Prime’, ‘Hoth’, ‘Jakku’, ‘Kamino’, ‘Kashyyyk’, ‘Lothal’, ‘Mustafar’, ‘Naboo’, ‘Sullust’, ‘Takodana’, ‘Tatooine’, ‘Utapau’, ‘Yavin’, ‘Yavin 4’];
function listPlanets(element, index, array) {
console.log(‘planetsAndMoons[’ + index + ’] =’ + element);
}
planetsAndMoons.forEach(listPlanets);
// planetsAndMoons[0] = Alderaan
// planetsAndMoons[1] = Bespin
// planetsAndMoons[2] = Coruscant
// planetsAndMoons[3] = DQar
// planetsAndMoons[4] = Dagobah
// planetsAndMoons[5] = Endor
// planetsAndMoons[6] = Geonosis
// planetsAndMoons[7] = Hosnian Prime
// planetsAndMoons[8] = Hoth
// planetsAndMoons[9] = Jakku
// planetsAndMoons[10] = Kamino
// planetsAndMoons[11] = Kashyyyk
// planetsAndMoons[12] = Lothal
// planetsAndMoons[13] = Mustafar
// planetsAndMoons[14] = Naboo
// planetsAndMoons[15] = Sullust
// planetsAndMoons[16] = Takodana
// planetsAndMoons[17] = Tatooine
// planetsAndMoons[18] = Utapau
// planetsAndMoons[19] = Yavin
// planetsAndMoons[20] = Yavin 4
let numbers = [2, 4, 6];
numbers.original = [];
numbers.forEach(function (element, index, numbers) {
numbers[index] *= 2;
numbers.original.push(element);
});
function listNumbers(element, index) {
console.log(‘index’ + index + ’ has element ’ + element);
}
numbers.original.forEach(listNumbers);
numbers.forEach(listNumbers);
// index0 has element 2
// index1 has element 4
// index2 has element 6
// index0 has element 4
// index1 has element 8
// index2 has element 12
let new_array = old_array.concat(value1ParseError: KaTeX parse error: Undefined control sequence: [ at position 9: , value2\̲[̲, …[, valueN]])
Overview
concat() is a function that creates a new array which is the result of adding the supplied arguments to the original array. The original array is left intact, and the new array is the original plus any added elements. If any of the arguments to the concat() function are themselves an array, then the elements of that supplied array are added, rather than the entire array itself.
Returns
A new array, which is created by adding each of the supplied arguments to the original array.
array.concat() function examples
let legoStarWarsGames = [‘Empire Vs Rebels’, ‘Ultimate Rebel’, ‘The Quest for R2-D2’];
let legoStarWarsSets = [10188, 75111, 75110, 75109];
let gamesAndSets = legoStarWarsGames.concat(legoStarWarsSets);
console.log(gamesAndSets);
// [“Empire Vs Rebels”, “Ultimate Rebel”, “The Quest for R2-D2”, 10188, 75111, 75110, 75109]
let legoStarWarsGames = [‘Empire Vs Rebels’, ‘Ultimate Rebel’, ‘The Quest for R2-D2’];
let legoStarWarsSets = [10188, 75111, 75110, 75109];
let availablePlatforms = [‘Wii’, ‘Xbox’, ‘Playstation’];
let gamesSetsPlatforms = legoStarWarsGames.concat(legoStarWarsSets, availablePlatforms);
console.log(gamesSetsPlatforms);
// [“Empire Vs Rebels”, “Ultimate Rebel”, “The Quest for R2-D2”, 10188, 75111, 75110, 75109, “Wii”, “Xbox”, “Playstation”]
array.shift()
Overview
The shift() function removes and returns the first element of the original array. All remaining elements in the array get shifted one slot to the left in order to fill the hole created by removing the first element. If you try to apply this function to an empty array, it will do nothing and simply return undefined. The shift() function does not create a new array, it modifies the original array directly.
Returns
shift() returns the first element from the original array.
array.shift() function examples
let starWarsCreatures = [‘Tach’, ‘Kath hound’, ‘Ruggers’, ‘Spice spider’];
console.log(‘starWarsCreatures before:’ + starWarsCreatures);
// “starWarsCreatures before: Tach,Kath hound,Ruggers,Spice spider”
let shifted = starWarsCreatures.shift();
console.log(‘starWarsCreatures after:’ + starWarsCreatures);
// “starWarsCreatures after: Kath hound,Ruggers,Spice spider”
console.log(‘Removed this element:’ + shifted);
// “Removed this element: Tach”
array.unshift(ParseError: KaTeX parse error: Undefined control sequence: [ at position 9: element1\̲[̲, …[, elementN]])
Overview
A direct opposite to the shift() function which we just discussed, is the unshift() function. unshift() inserts any arguments you pass to it into the beginning of the array. All of the existing elements need to shift to the right in order to make room for the new elements. Each argument passed to unshift() gets added in order starting from index 0. In addition, unshift() is modifying the original array directly.
Returns
The new length of the array.
array.unshift() function examples
let starWarsCreatures = [‘Eopie’, ‘Acklay’, ‘Talortai’, ‘Boma’];
console.log(‘starWarsCreatures before:’ + starWarsCreatures);
// starWarsCreatures before: Eopie,Acklay,Talortai,Boma
let newcount = starWarsCreatures.unshift(‘Climbing tauntaun’);
console.log(‘starWarsCreatures after:’ + starWarsCreatures);
// starWarsCreatures after: Climbing tauntaun,Eopie,Acklay,Talortai,Boma
console.log(‘The array now has:’ + newcount + ’ elements’);
// The array now has: 5 elements
21
let starWarsCreatures = [‘Eopie’, ‘Acklay’, ‘Talortai’, ‘Boma’];
console.log(‘starWarsCreatures before:’ + starWarsCreatures);
// starWarsCreatures before: Eopie,Acklay,Talortai,Boma
let newcount = starWarsCreatures.unshift(‘Climbing tauntaun’);
console.log(‘starWarsCreatures after:’ + starWarsCreatures);
// starWarsCreatures after: Climbing tauntaun,Eopie,Acklay,Talortai,Boma
console.log(‘The array now has:’ + newcount + ’ elements’);
// The array now has: 5 elements
newcount = starWarsCreatures.unshift([‘Gullipuds’, ‘Mynock’]);
console.log(‘starWarsCreatures after:’ + starWarsCreatures);
// starWarsCreatures after: Gullipuds,Mynock,Climbing tauntaun,Eopie,Acklay,Talortai,Boma
console.log(‘The array now has:’ + newcount + ’ elements’);
// The array now has: 6 elements
array.map(callback, thisArg,thisArg)
Overview
This is a very useful JavaScript function, and made use of all the time in professional software. The map() function loops over every element in the array, executing a callback function on each item. Once map() has completed looping through the array, it takes the results from each callback applied to each element, and returns those results in their entirety as an array. You are left with a new array with updated values, and an old array which has the original values. These two arrays are equal in length. When the callback is invoked, it is done so with three arguments. Those are the value of the element, the index of the element, and the Array object being traversed. If the optional second parameter is provided to map(), it will be used as the this value for each execution of the callback.
note: The map() and forEach() functions seem like they are the same, but they are in fact different. The difference is that forEach() iterates over an array and applies some operation with side effects to each array member such as saving each one to the database, or some other side effect. map() on the other hand iterates over an array, updates each member of that array, and returns another array of the same size with the transformed members (such as converting an array of strings to all lowercase).
Returns
map() returns a new array with elements computed by the provided callback function.
array.map() function examples
let starwars = [‘star wars’, ‘the phantom menace’, ‘the force awakens’];
let swModified = starwars.map(function (element) {
return element.toUpperCase();
});
console.log(swModified);
// [“STAR WARS”, “THE PHANTOM MENACE”, “THE FORCE AWAKENS”]
let one = [3, 5, 7];
let two = one.map(function (number) {
return number * number;
});
console.log(one); // [3, 5, 7]
console.log(two); // [9, 25, 49]
let str = ‘The Clone Wars’;
let arr = Array.prototype.map.call(str, function (el) {
return el;
});
console.log(str); // The Clone Wars
console.log(arr); // [“T”, “h”, “e”, " “,”C“,”l“,”o“,”n“,”e“,” “,”W“,”a“,”r“,”s"]
array.sort(compareFunctioncompareFunction)
Overview
If you want to sort an array in JavaScript, then you can do so with the built in sort() function. sort() applies the sort directly to the original array, no copy of the array is made. You can optionally provide a callback function that will determine the behavior of the sort. If you do not provide one, the sort() function will first convert all elements to strings, and then sort based on something called the Unicode code point value. Basically that means alphabetical, but with some special rules such as capital letters coming before lowercase.
Returns
sort() returns a reference to the original array.
array.sort() function examples
21
let creatures = [‘Pug jumper’, ‘Rong boars’, ‘Wamba’, ‘Oslet’];
creatures.sort(); //
let nums = [1, 10, 2, 21, 33, 04, 12, 09, 300];
nums.sort(); // [1, 10, 2, 21]
// Watch out that 10 comes before 2,
// because ‘10’ comes before ‘2’ in Unicode code point order.
let spacecraft = [‘Lambda Class Shuttle’, ‘imperial landing craft’, ‘4 Tantive’];
spacecraft.sort();
// In Unicode, numbers come before upper case letters,
// which come before lower case letters.
console.log(creatures);
// [“Oslet”, “Pug jumper”, “Rong boars”, “Wamba”]
console.log(nums);
// [1, 10, 12, 2, 21, 300, 33, 4, 9]
console.log(spacecraft);
// [“4 Tantive”, “Lambda Class Shuttle”, “imperial landing craft”]
As we can see from the above example, when you do not supply a callback function to the sort method, ordering may not be what you expect. The rules for ordering in Unicode are a bit unique. For example, numbers come before upper case letters and uppercase letters come before lowercase letters. In addition, an array of numbers is converted to strings before sorting, so this is why we see 33 coming before 4 and 9 in the example above. Here is a callback function example to show ordering numbers how you might expect.
let nums = [1, 10, 2, 21, 33, 04, 12, 09, 300];
nums.sort(numsasexpected);
function numsasexpected(one, two) {
return one - two;
}
console.log(nums);
// [1, 2, 4, 9, 10, 12, 21, 33, 300]
array.pop()
Overview
The opposite of the push() function would be the pop() function. The pop() function removes the last element from an array, decrements the length of the array, and returns the value which was removed from the array. If you try to apply the pop() to an empty array, you will simply get undefined returned.
Returns
pop() returns the last element of the array it is called on.
array.pop() function examples
let usefulFunctions = [‘push’, ‘indexOf’, ‘slice’, ‘toString’, ‘filter’, ‘join’];
console.log(‘usefulFunctions initially has:’ + usefulFunctions);
// usefulFunctions initially has: push,indexOf,slice,toString,filter,join
let firstpop = usefulFunctions.pop();
console.log(‘after one pop, usefulFunctions has:’ + usefulFunctions);
// after one pop, usefulFunctions has: push,indexOf,slice,toString,filter
let poptwo = usefulFunctions.pop();
console.log(‘after two pops, usefulFunctions has:’ + usefulFunctions);
// after two pops, usefulFunctions has: push,indexOf,slice,toString
console.log(‘popone contains:’ + firstpop);
// popone contains: join
console.log(‘poptwo contains:’ + poptwo);
// poptwo contains: filter
array.reduce(callback, initialValue,initialValue)
Overview
reduce() accepts a function as the first parameter which acts like a binary operator. This callback function takes two values, operates on them, and returns a result. The number of times the callback function runs is always one less than the total length of the original array. For example if the original array has a length of 10, the callback will run 9 times. The final result is one combined value.
Returns
The reduced value of the array, which is the return value of the last time the callback function is executed.
array.reduce() function examples
In this example, we will use array.reduce() to operate on values contained within a simple array of objects. array.reduce() is a little more challenging than some of the other useful array functions, so spend some extra time on this one if it doesn’t click immediately.
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
let skills = [
{
name: ‘Tom’,
skill: ‘CSS’,
yearsExperience: 3,
category: ‘Web Design’
},
{
name: ‘Jim’,
skill: ‘HTML’,
yearsExperience: 10,
category: ‘Web Design’
},
{
name: ‘Sue’,
skill: ‘JavaScript’,
yearsExperience: 5,
category: ‘Web Development’
},
{
name: ‘Maria’,
skill: ‘PHP’,
yearsExperience: 7,
category: ‘Web Development’
},
{
name: ‘John’,
skill: ‘Photoshop’,
yearsExperience: 1,
category: ‘Web Design’
},
{
name: ‘David’,
skill: ‘Writing’,
yearsExperience: 12,
category: ‘Content’
},
{
name: ‘Ellen’,
skill: ‘Editor’,
yearsExperience: 5,
category: ‘Content’
}
];
let totalexperience = skills.reduce(function (prev, current) {
return prev + current.yearsExperience;
}, 0);
console.log(‘The team has a cumulative experience of:’ + totalexperience + ’ years!’);
// The team has a cumulative experience of: 43 years!
let categoryExperienceTotals = skills.reduce(function (groupedByCategory, worker) {
let category = worker.category;
if (!groupedByCategory[category]) {
groupedByCategory[category] = 0;
}
groupedByCategory[category] += worker.yearsExperience;
return groupedByCategory;
}, {});
console.log(‘Our workers have’ + categoryExperienceTotals[‘Web Design’] + ’ years of Web Design Experience, ’
categoryExperienceTotals[‘Web Development’] + ’ years of Web Development Experience, and ’
categoryExperienceTotals[‘Content’] + ’ years of Content production Experience!’
);
// Our workers have 14 years of Web Design Experience, 12 years of Web Development Experience,
// and 17 years of Content production Experience!
let workersByCategory = skills.reduce(function (groupedByWorkers, worker) {
if (!groupedByWorkers[worker.category]) {
groupedByWorkers[worker.category] = 0;
}
groupedByWorkers[worker.category]++;
return groupedByWorkers;
}, {});
console.log(‘We have’ + workersByCategory[‘Web Design’] + ’ employees in Web Design, ’
workersByCategory[‘Web Development’] + ’ in Web Development, and ’
workersByCategory[‘Content’] + ’ working in Content production!’
);
// We have 3 employees in Web Design, 2 in Web Development, and 2 working in Content production!
array.some(callback, thisArg,thisArg)
Overview
As we can see from the signature above, the some() function takes a callback as the first argument, and an optional second argument. The second argument, if provided, specifies the this value for invocations of the supplied callback. The some() function runs the provided callback on each element in the array, and if the callback returns true, then the some() function stops right away and returns true. If all callback iterations return false, then some() returns false.
Returns
some() either returns true or false. At least one item in the array must return true when the callback is applied in order for some() to return true.
array.some() function examples
function jsarrayfuncs(element, index, array) {
return element === ‘javascript array functions’;
}
let one = [‘the good parts’, ‘the better parts’, ‘has no parts’, ‘atwood loves php’];
let two = [‘life is good’, ‘arrays for all’, ‘node for win’, ‘javascript array functions’];
console.log(one.some(jsarrayfuncs)); // false
console.log(two.some(jsarrayfuncs)); // true
array.lastIndexOf(searchElement, fromIndex = arr.length – 1,fromIndex=arr.length–1)
Overview
The lastIndexOf() function searches through an array backwards for a supplied value. Once the function finds that value, it returns the index position of where that value exists in the array. If you provide the optional second argument to the lastIndexOf() function, searching will begin from that starting point and go backwards. If you do not supply this second argument, searching starts at the end of the array. If no match is found, -1 is returned.
Returns
The highest index position that is less than or equal to the start of the array where the element is === to the value you are looking for, or -1 if there are no matches found.
array.lastIndexOf() function examples
let starwars = [‘Episode 4: A New Hope’,
‘Episode 5: The Empire Strikes Back’,
‘Episode 6: Return of the Jedi’,
‘Episode 1: The Phantom Menace’,
‘Episode 2: Attack of the Clones’,
‘Episode 3: Revenge of the Sith’,
‘Episode 7: The Force Awakens’];
console.log(starwars.lastIndexOf(‘Episode 7: The Force Awakens’)); // 6
console.log(starwars.lastIndexOf(‘Episode 3: Revenge of the Sith’)); // 5
console.log(starwars.lastIndexOf(‘Episode 2: Attack of the Clones’, 3)); // -1
console.log(starwars.lastIndexOf(‘Episode 1: The Phantom Menace’, -4)); // 3
let locatedat = [];
let enemies = [‘Kylo Ren’, ‘Darth Vader’, ‘Storm Trooper’, ‘General Hux’, ‘Emperor Palpatine’, ‘Storm Trooper’];
let enemy = ‘Storm Trooper’;
let enemylocation = enemies.lastIndexOf(enemy);
while (enemylocation != -1) {
locatedat.push(enemylocation);
enemylocation = enemies.lastIndexOf(enemy, enemylocation - 1);
}
console.log(locatedat); // 5, 2
array.reduceRight(callback, initialValue,initialValue)
Overview
The reduceRight() function works just like reduce() with one key difference. reduceRight() enumerates array elements from right to left (from highest index to lowest) rather than left to right (lowest to highest).
array.reduceRight() function example
let sum = [0, 10, 20, 30].reduceRight(function (one, two) {
return one + two;
});
console.log(sum); // 60
let flat = [[0, 10], [20, 30, [1, 2, 3, 4]], [40, 50]].reduceRight(function (one, two) {
return one.concat(two);
}, []);
console.log(flat);
// [40, 50, 20, 30, [1, 2, 3, 4], 0, 10]
array.every(callback, thisArg,thisArg)
Overview
You can use the every() function to test whether a condition is true for all elements in an array. As like with most looping functions in JavaScript, you are expected to provide a callback function which will run on each element in the array from lowest to highest index. If all iterations return true when the callback runs, then the every() function itself will return true. If however an interation of the callback returns a false value, then every() stops right away and returns false.
array.every() function example
function greaterThan100(element, index, array) {
return element > 100;
}
arr1 = [200, 150, 550, 300, 101];
arr2 = [330, 120, 100, 508, 102];
console.log(arr1.every(greaterThan100)); // true
console.log(arr2.every(greaterThan100)); // false
Array.prototype.reverse()
array.reverse()
Overview
The reverse() function does exactly what you think it would do. It reverses the order of the elements of they array it is applied to. The reverse() function does this right on the original array, no new array is created or returned. In addition keep in mind that if there are many references to a particular array in your program, and you reverse that array, all references now also see an array which has been reversed. Perhaps that is why this function appears lower on our most useful JavaScript array functions list. Remember, the lower on the list a function appears, the less times we found it in use in popular open source software.
array.reverse() function example
let javascriptArray = [‘eat’, ‘sleep’, ‘breathe’, ‘javascript’];
javascriptArray.reverse();
console.log(javascriptArray);
// [“javascript”, “breathe”, “sleep”, “eat”]
Most Useful JavaScript Array Functions Summary
In this episode we took a look at all of the many useful JavaScript Array Functions you’re likely to make use of and find helpful during your JavaScript programming. We used a method of analyzing popular JavaScript source code repositories hosted on Github, the well known open source software sharing and collaboration website. We found that the most useful JavaScript functions according to the number of times they were used in popular JavaScript frameworks to be Array.push(), Array.indexOf(), Array.slice(), Array.toString(), Array.filter(), Array.join(), Array.splice(), Array.forEach(), Array.concat(), Array.shift(), Array.unshift(), Array.map(), Array.sort(), Array.pop(), Array.reduce(), Array.some(), Array.lastIndexOf(), Array.reduceRight(), Array.every(), and finally, Array.reverse(). It would make sense to memorize as many of these as you can, or at least be very familiar with the ones that appear at the top of the list.
Source
Overview
What push() returns
array.push() function examples
Overview
What indexOf() returns
array.indexOf() function examples
Overview
What slice() returns
array.slice() function examples
array.toString() function examples
Overview
What filter() returns
array.filter() function examples
Overview
What join() returns
array.join() function examples
Overview
Returns
array.splice() function examples
Overview
array.forEach() function examples
Overview
Returns
array.concat() function examples
Overview
Returns
array.shift() function examples
Overview
Returns
array.unshift() function examples
Overview
Returns
array.map() function examples
Overview
Returns
array.sort() function examples
Overview
Returns
array.pop() function examples
Overview
Returns
array.reduce() function examples
Overview
Returns
array.some() function examples
Overview
Returns
array.lastIndexOf() function examples
Overview
array.reduceRight() function example
Overview
array.every() function example
Overview
array.reverse() function example


This notice describes our Privacy Policy. By visiting OliverYarbrough.com, you are accepting the practices described in this Privacy Policy.
What Personal Information About Customers Do We Gather?
Here are the types of information we gather.
- Information You Give Us: We receive and store any information you enter on our Web site or give us in any other way. You can choose not to provide certain information, but then you might not be able to take advantage of many of our features. We use the information that you provide for such purposes as responding to your requests and communicating with you.
- Automatic Information: We receive and store certain types of information whenever you interact with us. For example, like many Web sites, we use “cookies,” and we obtain certain types of information when your Web browser accesses our Web site.
What About Cookies?
- Cookies are alphanumeric identifiers that we transfer to your computer’s hard drive through your Web browser to enable our systems to recognize your browser, to provide certain features, and to allow storage of items in your shopping cart between visits.
- The Help portion of the toolbar on most browsers will tell you how to prevent your browser from accepting new cookies, how to have the browser notify you when you receive a new cookie, or how to disable cookies altogether.
Do We Share the Information We Receive?
We share information as described below.
- Businesses and Individuals: We work closely with other businesses and individuals, and we may share information about you with those businesses and individuals.
- Third-Party Service Providers: We may employ other companies and individuals to perform functions on our behalf. Examples include providing Web site services, fulfilling orders, delivering packages, sending postal mail and e-mail, processing credit card payments, and providing customer service. They have access to personal information needed to perform their functions, but may not use it for other purposes.
- Business Transfers: As we continue to develop our business, we might sell or buy stores, subsidiaries, or business units. In such transactions, customer information generally is one of the transferred business assets but remains subject to the promises made in any pre-existing Privacy Policy (unless, of course, the customer consents otherwise).
- Our Protection and Protection of Others: We release account and other personal information when we believe release is appropriate to comply with the law; enforce or apply our Terms of Use and other agreements; or protect our rights, property, or safety and those of our users, and others. This includes exchanging information with other companies and organizations for fraud protection and credit risk reduction.
- With Your Consent: Other than as set out above, you will receive notice when information about you might go to third parties, and you will have an opportunity to choose not to share the information.
How Secure Is Information About Me?
- Your information is protected during transmission by Secure Sockets Layer (SSL) software, which encrypts information you input.
- Only the last four digits of your credit card numbers are revealed when confirming an order. Of course, the entire credit card number is transmitted to the appropriate credit card company during order processing.
- It is important for you to protect against unauthorized access to your password and to your computer. Be sure to sign off when finished using a shared computer.
What Choices Do I Have?
- As discussed above, you can always choose not to provide information, even though it might be needed to make a purchase or to take advantage of certain features.
- The Help portion of the toolbar on most browsers will tell you how to prevent your browser from accepting new cookies, how to have the browser notify you when you receive a new cookie, or how to disable cookies altogether.
Terms of Use, Notices, and Revisions
If you choose to visit OliverYarbrough.com, your visit and any dispute over privacy is subject to this Privacy Policy and our Terms of Use, including limitations on damages, resolution of disputes, and application of the law of the
state of Georgia. Our business changes constantly, and our Privacy Policy and the Terms of Use will change also. Unless stated otherwise, our current Privacy Policy applies to all information that we have about you and your account.
You agree to indemnify and hold Oliver Yarbrough and our subsidiaries, affiliates, officers, directors, agents, and employees, harmless from any claim or demand (including legal expenses and the expenses of other professionals)
made by a third party due to or arising out of your breach of this Terms of Use or the documents it incorporates by reference, or your violation of any law or the rights of a third party. Oliver Yarbrough, reserves the right to postpone/cancel
an event, or change the location of an event because of insufficient enrollments, instructor illness or force majeure events (like floods, earthquakes, political instability, etc.). You agree to indemnify and hold Oliver Yarbrough and our
subsidiaries, affiliates, officers, directors, agents, and employees, harmless from any claim or demand (including legal expenses and the expenses of other professionals) made by a third party due to or arising out of your breach of this
Terms of Use or the documents it incorporates by reference, or your violation of any law or the rights of a third party.


FF123456C
State Pension overview
Has never been contracted out
5 full (qualifying) years £0 a week
(Needs 10 years)
(Needs 10 years)
May get some pension by filling gaps
National Insurance record
- 5 full years
- 10 gaps in record
-
2016-17This year is not available yet
-
2015-16£722 shortfall
-
2014-15£50 shortfall
-
2013-14£355 shortfall
-
2012-13£400 shortfall
-
2011-12£150 shortfall
-
2009-10£100 shortfall
-
2008-09£150 shortfall
-
2007-08£150 shortfall
-
2005-06It’s too late to pay for this year
-
2004-05It’s too late to pay for this year


Your transaction has been submitted to MonoeciGuard and is awaiting authorization.
Authorize Transaction


FROM THE DESK OF OKOFOR DAVID Branch Accounts Manager, Prudent Bank Nigeria Limited, Falomo Office Complex, Ikoyo, Lagos. Nigeria. DEAR FRIEND, On SUNDAY, February 2, 2003, a bomb blast explosion took place on the Lagos Island, right inside My bank; So far a total lost of about US$20.5 million has been recorded, this includes both cash and property of the bank. Please View the Link below: http://www.cnn.com/2003/WORLD/africa/02/03/lagos.explosion/index.html However as the Accounts Manager of the BANK,I discovered Most of our Data on accounts has been lost as well, as there has not been anyback up or network trace even from the HEADQUARTERS;therefore all losses would be artributed to the! Explosion. The lagos State Government has taken charges to pay for all losses. I found out i still have Data's of foreign Customers who are contractors in Nigeria and who own accounts with the Branch, Particularly that of an American oil contractor Hsu Ben, who was reported Dead in a plane crash[Korean Air Flight 801] with the whole passengers aboard on August 6,1997.And for your perusal you can view this website: http://www.cnn.com/WORLD/9708/06/guam.passenger.list/ who's contract payments has been Made and would be tranfered to his foreign accounts from the CENTRAL BANK OF NIGERIA, upon our confirmation of his foreign designated account as well as a beneficiary to his funds and payments. Mr Hsu Ben, while our customer never left a trace of his next of kin, and His contract Payment which is about US$15M, would be made to no one as we( the bank) has! none of his Data/next of kin's contact. My proposal is that I will like you as a foriegner to stand in as the next of kin to Mr Hsu Ben, so that the fruits of this old man's labor will not get into the hands of some corrupt government officials, Besides the Bank which i work in has been blown up, i have no Job for now, i have to make a living and only me knows the information so far about this. This is simple, I will like you to provide immediately your full names and address so that the Attorney will prepare the necessary documents and affidavits which will put you in place as the next of kin. We shall employ the service of an Attorney for drafting and notarization of the WILL and to obtain the necessary documents and letter of probate/administration in your favour for the transfer. A bank account in any part of the world which you will provide will then facilitate the transfer of this money to you as the beneficiary/next of kin. The money will be paid into your account as payment for his Contract by t! he CENTRAL BANK OF NIGERIA upon my submission of the Contract information and your application as his next of kin for us to share in the ratio of 70% for me, 20% for you and 10% will be use to cover all the expensives that will come-up in the course of this transaction. There is no risk at all as all the paperwork for this transaction will be done by the Attorney and my position as the Branch Accounts Manager guarantees the successful execution of this transaction. Upon your response, I shall then provide you with more details and relevant documents that will help you understand the transaction. Please observe utmost confidentiality, and rest assured that this transaction would be most profitable for both of us because I shall require your assistance to invest my share in your country. Your phone and fax number are need for easy communication. Awaiting your urgent response. Your Faithfully. MR. OKOFOR DAVID


Hello My name is red and I like to be a good crewmate.
What? I was in admin doing my task!
Hello My name is red and I like to be a good crewmate.
What? I was in admin doing my task!
Hello My name is red and I like to be a good crewmate.
What? I was in admin doing my task!


📅 (2023-04-01 01:44:31 UTC)
# Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 2 Virtual package relying on perl coq 8.7.1 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.05.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.05.0 Official 4.05.0 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.6 A library manager for OCaml # opam file: opam-version: "2.0" maintainer<EMAIL_ADDRESS>homepage: "https://github.com/clarus/coq-of-ocaml" dev-repo: "git+https://github.com/clarus/coq-of-ocaml.git" bug-reports: "https://github.com/clarus/coq-of-ocaml/issues" authors: ["Guillaume Claret"] license: "MIT" build: [ ["sh" "-c" "cd OCaml && ./configure.sh"] [make "-C" "OCaml" "-j%{jobs}%"] [make "-j%{jobs}%"] ] install: [make "-C" "OCaml" "install"] depends: [ "conf-ruby" {build} "coq" {>= "8.5" & < "8.14~"} "ocaml" {>= "4.05.0" & < "4.06.0"} "ocamlbuild" {build} "smart-print" "yojson" ] tags: [ "date:2015-08-31" "keyword:compilation" "keyword:OCaml" ] synopsis: "Compile OCaml to Coq" extra-files: ["coq-of-ocaml.install" "md5=aaa1f52ec40bedefd2674f46a44cd578"] url { src: "https://github.com/clarus/coq-of-ocaml/archive/1.2.1.tar.gz" checksum: "md5=e8cb5565b8ce622d2afa5bcc59873ad2" }
true
Dry install with the current Coq version:
opam install -y --show-action coq-of-ocaml.1.2.1 coq.8.7.1
Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:
true
opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-of-ocaml.1.2.1 coq.8.7.1
opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-of-ocaml.1.2.1 coq.8.7.1
# Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 2 Virtual package relying on perl conf-ruby 1.0.0 Virtual package relying on Ruby coq 8.7.1 Formal proof management system cppo 1.6.9 Code preprocessor like cpp for OCaml dune 3.7.0 Fast, portable, and opinionated build system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.05.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.05.0 Official 4.05.0 release ocaml-config 1 OCaml Switch Configuration ocaml-secondary-compiler 4.08.1-1 OCaml 4.08.1 Secondary Switch Compiler ocamlbuild 0.14.2 OCamlbuild is a build system with builtin rules to easily build most OCaml projects ocamlfind 1.9.1 A library manager for OCaml ocamlfind-secondary 1.9.1 Adds support for ocaml-secondary-compiler to ocamlfind seq 0.3.1 Compatibility package for OCaml's standard iterator type starting from 4.07 smart-print 0.3.0 A pretty-printing library in OCaml yojson 2.0.2 Yojson is an optimized parsing and printing library for the JSON format [NOTE] Package coq is already installed (current version is 8.7.1). The following actions will be performed: - install coq-of-ocaml 1.2.1 <><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><> Processing 1/1: [coq-of-ocaml.1.2.1: http] [coq-of-ocaml.1.2.1] downloaded from https://github.com/clarus/coq-of-ocaml/archive/1.2.1.tar.gz Processing 1/1: <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> Processing 1/2: [coq-of-ocaml: sh] + /home/bench/.opam/opam-init/hooks/sandbox.sh "build" "sh" "-c" "cd OCaml && ./configure.sh" (CWD=/home/bench/.opam/ocaml-base-compiler.4.05.0/.opam-switch/build/coq-of-ocaml.1.2.1) Processing 1/2: [coq-of-ocaml: make OCaml] + /home/bench/.opam/opam-init/hooks/sandbox.sh "build" "make" "-C" "OCaml" "-j7" (CWD=/home/bench/.opam/ocaml-base-compiler.4.05.0/.opam-switch/build/coq-of-ocaml.1.2.1) - make: Entering directory '/home/bench/.opam/ocaml-base-compiler.4.05.0/.opam-switch/build/coq-of-ocaml.1.2.1/OCaml' - COQDEP OCaml.v - COQDEP List.v - COQDEP Libraries.v - COQDEP Effect.v - COQDEP Basics.v - COQC Libraries.v - COQC Effect.v - COQC Basics.v - COQC List.v - COQC OCaml.v - make: Leaving directory '/home/bench/.opam/ocaml-base-compiler.4.05.0/.opam-switch/build/coq-of-ocaml.1.2.1/OCaml' Processing 1/2: [coq-of-ocaml: make] + /home/bench/.opam/opam-init/hooks/sandbox.sh "build" "make" "-j7" (CWD=/home/bench/.opam/ocaml-base-compiler.4.05.0/.opam-switch/build/coq-of-ocaml.1.2.1) - ocamlbuild src/coqOfOCaml.native -lflags -I,+compiler-libs,ocamlcommon.cmxa -use-ocamlfind -package smart_print,compiler-libs,yojson,str - ocamlfind ocamldep -package smart_print,compiler-libs,yojson,str -modules src/coqOfOCaml.ml > src/coqOfOCaml.ml.depends - ocamlfind ocamldep -package smart_print,compiler-libs,yojson,str -modules src/effect.ml > src/effect.ml.depends - ocamlfind ocamldep -package smart_print,compiler-libs,yojson,str -modules src/boundName.ml > src/boundName.ml.depends - ocamlfind ocamldep -package smart_print,compiler-libs,yojson,str -modules src/name.ml > src/name.ml.depends - ocamlfind ocamldep -package smart_print,compiler-libs,yojson,str -modules src/error.ml > src/error.ml.depends - ocamlfind ocamldep -package smart_print,compiler-libs,yojson,str -modules src/loc.ml > src/loc.ml.depends - ocamlfind ocamlc -c -package smart_print,compiler-libs,yojson,str -I src -o src/loc.cmo src/loc.ml - + ocamlfind ocamlc -c -package smart_print,compiler-libs,yojson,str -I src -o src/loc.cmo src/loc.ml - findlib: [WARNING] Interface topdirs.cmi occurs in several directories: /home/bench/.opam/ocaml-base-compiler.4.05.0/lib/ocaml, /home/bench/.opam/ocaml-base-compiler.4.05.0/lib/ocaml/compiler-libs - ocamlfind ocamlc -c -package smart_print,compiler-libs,yojson,str -I src -o src/error.cmo src/error.ml - + ocamlfind ocamlc -c -package smart_print,compiler-libs,yojson,str -I src -o src/error.cmo src/error.ml - findlib: [WARNING] Interface topdirs.cmi occurs in several directories: /home/bench/.opam/ocaml-base-compiler.4.05.0/lib/ocaml, /home/bench/.opam/ocaml-base-compiler.4.05.0/lib/ocaml/compiler-libs - ocamlfind ocamldep -package smart_print,compiler-libs,yojson,str -modules src/pathName.ml > src/pathName.ml.depends - ocamlfind ocamlc -c -package smart_print,compiler-libs,yojson,str -I src -o src/name.cmo src/name.ml - + ocamlfind ocamlc -c -package smart_print,compiler-libs,yojson,str -I src -o src/name.cmo src/name.ml - findlib: [WARNING] Interface topdirs.cmi occurs in several directories: /home/bench/.opam/ocaml-base-compiler.4.05.0/lib/ocaml, /home/bench/.opam/ocaml-base-compiler.4.05.0/lib/ocaml/compiler-libs - File "src/name.ml", line 83, characters 22-26: - Error: Unbound type constructor json - Command exited with code 2. - Hint: Recursive traversal of subdirectories was not enabled for this build, - as the working directory does not look like an ocamlbuild project (no - '_tags' or 'myocamlbuild.ml' file). If you have modules in subdirectories, - you should add the option "-r" or create an empty '_tags' file. - - To enable recursive traversal for some subdirectories only, you can use the - following '_tags' file: - - true: -traverse - <dir1> or <dir2>: traverse - - make: *** [Makefile:6: default] Error 10 [ERROR] The compilation of coq-of-ocaml failed at "/home/bench/.opam/opam-init/hooks/sandbox.sh build make -j7". #=== ERROR while compiling coq-of-ocaml.1.2.1 =================================# # context 2.0.1 | linux/x86_64 | ocaml-base-compiler.4.05.0 | file:///home/bench/run/opam-coq-archive/released # path ~/.opam/ocaml-base-compiler.4.05.0/.opam-switch/build/coq-of-ocaml.1.2.1 # command ~/.opam/opam-init/hooks/sandbox.sh build make -j7 # exit-code 2 # env-file ~/.opam/log/coq-of-ocaml-8947-335865.env # output-file ~/.opam/log/coq-of-ocaml-8947-335865.out ### output ### # [...] # Hint: Recursive traversal of subdirectories was not enabled for this build, # as the working directory does not look like an ocamlbuild project (no # '_tags' or 'myocamlbuild.ml' file). If you have modules in subdirectories, # you should add the option "-r" or create an empty '_tags' file. # # To enable recursive traversal for some subdirectories only, you can use the # following '_tags' file: # # true: -traverse # <dir1> or <dir2>: traverse # # make: *** [Makefile:6: default] Error 10 <><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> +- The following actions failed | - build coq-of-ocaml 1.2.1 +- - No changes have been performed # Run eval $(opam env) to update the current shell environment 'opam install -y -v coq-of-ocaml.1.2.1 coq.8.7.1' failed.
No files were installed.
true


Driving Range
问题描述 :
These days, many carmakers are developing cars that run on electricity instead of gasoline. The batteries used in these cars are generally very heavy and expensive, so designers must make an important tradeoffs when determining the battery capacity, and therefore the range, of these vehicles. Your task is to help determine the minimum range necessary so that it is possible for the car to travel between any two cities on the continent.
The road network on the continent consists of cities connected by bidirectional roads of different lengths. Each city contains a charging station. Along a route between two cities, the car may pass through any number of cities, but the distance between each pair of consecutive cities along the route must be no longer than the range of the car. What is the minimum range of the car so that there is a route satisfying this constraint between every pair of cities on the continent?
The road network on the continent consists of cities connected by bidirectional roads of different lengths. Each city contains a charging station. Along a route between two cities, the car may pass through any number of cities, but the distance between each pair of consecutive cities along the route must be no longer than the range of the car. What is the minimum range of the car so that there is a route satisfying this constraint between every pair of cities on the continent?
输入:
The input consists of a sequence of road networks. The first line of each road network contains two positive integers n and m, the number of cities and roads. Each of these integers is no larger than one million. The cities are numbered from 0 to n-1. The first line is followed by m more lines, each describing a road. Each such line contains three non-negative integers. The first two integers are the numbers of the two cities connected by the road. The third integer is the length of the road. The last road network is followed by a line containing two zeros, indicating the end of the input.
输出:
The input consists of a sequence of road networks. The first line of each road network contains two positive integers n and m, the number of cities and roads. Each of these integers is no larger than one million. The cities are numbered from 0 to n-1. The first line is followed by m more lines, each describing a road. Each such line contains three non-negative integers. The first two integers are the numbers of the two cities connected by the road. The third integer is the length of the road. The last road network is followed by a line containing two zeros, indicating the end of the input.
样例输入:
3 3 0 1 3 1 2 4 2 1 5 2 0 0 0
样例输出:
4 IMPOSSIBLE
(adsbygoogle = window.adsbygoogle || []).push({});
炎帝 。。。。
都是一些基础题啊
网站不错
有意思，有难度
失误失误，转载错了。已经改正，抱歉。
很棒的网站，加油！⛽
这是研发类的题还是算法类？
大致看了下，算法的时间复杂度没有很本性的提升，算不上高效。
map[nodes .index][nodes .index] == 0 就是判断不相邻的。这个是可以证明的。
很好的思路，可以借鉴
不错的代码！
换句话说，A[k/2-1]不可能大于两数组合并之后的第k小值，所以我们可以将其抛弃。
应该是，不可能小于合并后的第K小值吧
没敢用map，总怕stl用着会超时
这个应该是比较简单的解法了，如果有更好的办法可以告诉我
map[nodes .index][nodes .index] == 0 就是判断不相邻的。这个是可以证明的。


{% extends "site_base.html" %} {% block extra_style %} {% endblock %} {% block body %} {% block banner %}
Upload your product photos and target user features. All users with application can see your product!
Detailed analysis is provided for your product! We help to know better about your design!
Suitable users are shot and higher accuracy is obtainable. Cost is small but returned data is detailed and large in quantity


Nieves v. Secretary, DOC
Description
ORDER denying 1 Petition for writ of habeas corpus and dismissing case with prejudice; clerk is directed to enter judgment accordingly and close the case. Signed by Judge Gregory A. Presnell on 8/20/2009. (TKW)
TRUE INTRODUCTION I. BACKGROUND KAREN NELSON MOORE, Circuit Judge. A Michigan jury convicted Willie James Jones of second-degree murder, as well as both conspiracy to commit and solicitation to commit first-degree murder. The district court denied Jones’s habeas petition on all grounds, but issued a certificate of appealability on three claims: Jones’s trial counsel was ineffective because she opened the door to previously excluded testimony; Jones’s multiple punishments for the same actions placed him in double jeopardy; and inadequate evidence supported his convictions. For the reasons explained below, we AFFIRM. TRUE STATEMENT OF FACTS A. Substantive Facts On February 17, 2001, Kenneth Flowers (Flowers) was murdered by a man who has never been identified. The shooter asked Flowers’s brother if he was Flowers, and when the brother said no, the shooter departed. Soon the shooter returned, asked Flowers “What’s up?” and fatally shot Flowers. R. 16 (06/16/03 Trial Tr., Dequan Flowers at 159–61). Flowers’s mother, Emma Flowers, and her neighbor, Lucretia Adams (Adams), told an officer that they suspected Willie James Jones, whom they knew by the nickname “Nookie.” McLister Trice was the link between Flowers and Jones. She had dated and had a child with Jones, and dated Flowers from October 2000 to January 2001. After breaking up with Flowers three weeks before the murder, Trice filed several police reports about Flowers vandalizing her car and stalking her. She also obtained a personal protective order against him. Tensions escalated in early February 2001, when Flowers followed Trice into a liquor store. Jones was with Trice, and an argument ensued. Flowers struck Trice’s head, and in return Trice hit Flowers with a wine bottle. Flowers ran from the store and told his companion, Jeff Adams, that Flowers had punched Jones and that Jones had a gun. Jeff Adams testified to these facts, though he had not witnessed the fight. Trice, however, insisted that Jones was not involved and did not have a gun.Around 10 a.m. on the morning of the shooting, Trice drove to the home of her stepmother,Patricia Wilson. Flowers, who lived across the street, approached Trice’s car and punched her window. Adams testified that she overheard Trice tell Flowers “B----, you going to die today. Nook -- my baby daddy Nook is setting it up now.” R. 17 (06/17/03 Trial Tr., Adams at 113). Emma Flowers’s testimony was substantially similar. Id. (E. Flowers at 132) (“‘B----, you going to die today. My baby daddy Nook is out making arrangements for you to be killed.’”). Trice denied making these statements, and Jones denied telling Trice that he planned to kill Flowers. TRUE LEGAL FRAMEWORK Legal Framework Afterward, Trice called her stepmother, Patricia Wilson. Wilson later testified that Trice told her about the incident with Flowers and “that Nook was going to take care of it that day.” Id. (Wilson at 103).Around noon, Jones stopped by Trice’s workplace. Trice told Jones and other people about the encounter with Flowers. Around 4 p.m., Jones called Trice to say that “[t]he order had been taken care of.” Id. (Trice at 40). Trice responded “[d]on’t go over there bothering him,” but Jones said “I paid the n-----.” Id. at 40, 45. Three hours later and after the shooting, Jones visited Trice at work again. Trice asked Jones whether he had “anything to do with it.” Id. at 44. Jones seemed to be drinking and his response was ambiguous: “[w]hat you thought.” Id. TRUE PROCEDURE B. Procedure Before Jones’s trial, the trial court excluded testimony from Emma Flowers and Adams about Trice’s statement (“you going to die today; Nook is setting it up now”) because it appeared to be double hearsay, lack foundation, and might fall outside of Michigan’s then-existing state-of-mind exception to the hearsay prohibition. The trial court withheld judgment on whether the evidence could be introduced to impeach Trice. The court also excluded Wilson’s testimony that Trice had told her that Jones would take care of Trice’s problem with Flowers. The evidentiary issue reemerged at trial. On direct examination, Trice could not recall the time at which she spoke to Jones. The government referenced a statement that Trice had given to police after the shooting when she had been arrested for her own alleged involvement. The government offered the statement to Trice to refresh her recollection. Trice then testified that, at 4 p.m., Jones had said “[t]he order had been taken care of” and “[h]e already paid someone.” Id. at 40. The government asked whether Trice had said anything to Flowers that morning, but the judge sent the jury away before Trice answered. The judge informed the government’s counsel that it would not permit questioning on an irrelevant point as a means of creating an innocuous inconsistency from which to introduce Emma Flowers’s and Adams’s statements “under the guise of impeachment.” Id. at 47. The judge then cautioned the defense attorney to constrain her questions to avoid “open[ing] the door for the admission . . . of the heretofore barred . . . statements.” Id. at 56–57.On cross-examination, Trice claimed that she did not know what Jones was talking about when he mentioned paying someone to take care of an order. Defense counsel also asked a series of questions to undermine the credibility of Trice’s statement to the police: she had been arrested, was poorly treated, did not write the statement herself, and signed it while scared, threatened, and hungry. Based on this latter set of questions, the trial court ruled that defense counsel had opened the door to the hearsay statements, permitting the government to rehabilitate Trice with her consistent, pre-arrest statements. Wilson, Emma Flowers, and Adams testified to the statements “that Nook was going to take care of it that day,” id. (Wilson at 103), and “[b]----, you going to die today. Nook -- my baby daddy Nook is setting it up now,” id. (Adams at 113); see also id. (E. Flowers at 132). Defense counsel objected specifically to Adams’s testimony but the judge admitted it both as a prior consistent statement and for impeachment. The attorney did not request a limiting instruction. The jury convicted Jones of second-degree murder, conspiracy to commit first-degree murder, and solicitation of first-degree murder. He is serving concurrent sentences of life imprisonment for conspiracy, nineteen-to-thirty years of imprisonment for second-degree murder, and nineteen-to-thirty years of imprisonment for solicitation of first-degree murder. The Michigan Court of Appeals affirmed the convictions, People v. Jones, No. 250326,2005 WL 657578
(Mich. Ct. App. March 22, 2005) (unpublished opinion), and the Michigan Supreme Court declined leave to appeal. Following his direct appeal, Jones filed his habeas petition with the district court. The district court denied relief but granted a certificate of appealability on the three issues that are now before this court: ineffective assistance of trial counsel, multiple punishments in violation of the Double Jeopardy Clause, and sufficiency of the evidence. Jones v. Harry, No. 06-13465,2009 WL 275728
(E.D. Mich. 2009) (unpublished opinion). TRUE ANALYSIS II. ANALYSIS TRUE STANDARD OF REVIEW A. Standard of Review “In a habeas corpus proceeding, this Court reviews a district court’s legal conclusions de novo and its factual findings for clear error.” Goff v. Bagley,601 F.3d 445
, 455 (6th Cir. 2010) (quotation omitted). Michigan state courts adjudicated the merits of Jones’s claims, and the Antiterrorism and Effective Death Penalty Act (AEDPA) applies. As a result, we can afford relief on the ineffective- assistance and double-jeopardy claims only if the Michigan decision was “contrary to, or involved an unreasonable application of, clearly established Federal law, as determined by the Supreme Court of the United States.” 28 U.S.C. § 2254(d)(1). As to the sufficiency of the evidence, we review the Michigan decision to see if it was “based on an unreasonable determination of the facts in light of the evidence presented in the State court proceeding.” 28 U.S.C. § 2254(d)(2). TRUE STATEMENT OF THE CASE B. Ineffective Assistance in the case Jones challenges the assistance of his trial counsel on two bases. First, he asserts that his attorney provided ineffective assistance by opening the door for Trice’s prior statements to come into evidence by discrediting Trice’s statement to the police, even though her statement to the police was not actually admitted into evidence. Second, he complains that his attorney did not request that the judge instruct the jury to consider Wilson’s, Adams’s, and Emma Flowers’s testimony only for its impeachment value. To succeed on his ineffective-assistance claim, Jones must show that the state courts unreasonably applied Strickland v. Washington,466 U.S. 668
, 687 (1984), which requires both deficient performance and prejudice to the defense. Attorney performance is deficient if “counsel’s representation fell below an objective standard of reasonableness” by making “errors so serious that counsel was not functioning as the ‘counsel’ guaranteed . . . by the Sixth Amendment.” Id. at 687–88. “Our review of counsel’s performance is highly deferential and counsel is strongly presumed to have rendered adequate assistance and made all significant decisions in the exercise of reasonable professional judgment.” Johnson v. Bell,525 F.3d 466
, 487 (6th Cir. 2008) (internal quotation marks omitted). TRUE JURISDICTIONAL STATEMENT 1. Opening the Door For Prejudicial Hearsay Opening the door to damaging testimony can constitute deficient performance. See, e.g., White v. Thaler,610 F.3d 890
, 900 (5th Cir. 2010). Here, however, the Michigan Court of Appeals found that opening the door was a necessary consequence of the defense’s much-needed attack on Trice’s credibility. That consequence was damaging, but we consider it in context, alongside the beneficial results of the strategy and in light of counsel’s slim options. See Wiggins v. Smith,539 U.S. 510
, 523 (2003) (using “a context-dependent consideration of the challenged [attorney] conduct”). TRUE DISCUSSION III. DISCUSSION On direct examination, Trice had testified to Jones’s statements that “[t]he order had been taken care of,” “[h]e already paid someone,” and he had done “[w]hat you thought.” R. 17 (06/17/03 Trial Tr., Trice at 40, 44). Although Trice’s police statement had not been admitted into evidence, the jury was aware of her statement to police because the prosecution had referenced it when refreshing Trice’s recollection. Jones admits that direct examination implied that the police report was consistent with Trice’s statements. Doing nothing to counter these damaging claims and implications on cross-examination would not have been a wise choice, despite what Jones argues now. The Michigan Court of Appeals did not unreasonably determine that, “[b]ecause of the nature of [Trice’s statements on direct], defense counsel would have been remiss not to address the statements on cross-examination and attempt to explain them.” Jones,2005 WL 657578
, at *3. TRUE ACT C. Precedent Under Federal Communications Acts Debunking the police report removed any enhanced credibility that the police report had added to Trice’s testimony. Jones argues that his attorney performed deficiently because she acted on the false belief that the police report was in evidence. But his attorney explicitly confirmed her understanding that the statement was not in evidence. R. 17 at 79 (“THE COURT: ‘You know, her statement is actually not in evidence, [defense counsel]. Her trial testimony is.’ [DEFENSE COUNSEL]: ‘I understand.’”). Defense counsel’s cross-examination was directed at “what the prosecutor said when he was asking [Trice] questions. He asked about her [police] statement, what she said in her statement.” Id. Some portions of the cross-examination strategy did not depend on the police report. For example, the defense attorney extracted from Trice that she did not know what Jones was talking about when he referenced the order that he had taken care of or when he said that he had paid someone. The judge had warned the defense attorney about the risk of opening the door to previously excluded testimony. In hindsight, perhaps refraining from asking about the police report would have been a better strategy. But given the deference with which we review attorney decisions, we cannot say that the state courts were unreasonable in concluding that the choice was not constitutionally deficient. The circumstances of the police report—Trice’s own arrest as well as her maltreatment—make her statements dubious. That line of questioning may have had more force than did Trice’s admission that she felt that Jones’s statements were ambiguous. Also, each of the hearsay statements relies on Trice’s credibility as a declarant. Jones’s trial counsel reasonably might have decided that the benefit of casting doubt on Trice’s testimony outweighed the harm of new witnesses testifying to statements similar to what that the jury had already heard. TRUE APPLICATION III. Application The Michigan Court of Appeals held that “[c]ounsel’s strategy was clearly to try to show that Trice did not know what defendant meant by the statements. Given counsel’s limited options, this strategy was not unsound.” Jones,2005 WL 657578
, at *3. The attorney’s strategy was somewhat broader in that it probed the circumstances of the police report, but the state court was not unreasonable in determining that the attorney exercised professional judgment and provided constitutionally adequate assistance. Thus, Jones cannot demonstrate ineffective assistance of counsel. TRUE STATEMENT OF FACTS 2. Fact of Failing to Request A Limiting Instruction Although Jones briefs the issue on appeal, his habeas petition does not allege that trial counsel’s performance was deficient for failing to request a limiting instruction for the testimony of Wilson, Emma Flowers, or Adams. While the claim bears some resemblance to his first ineffective- assistance claim, his petition did not fairly raise the issue of limiting instructions. We therefore may not review the claim. See Seymour v. Walker,224 F.3d 542
, 561 (6th Cir. 2000), cert. denied,532 U.S. 989
(2001). TRUE STATEMENT OF FACTS 3. Double Jeopardy Fact The Fifth Amendment ensures that no one may “be subject for the same offence to be twice put in jeopardy of life or limb.” U.S. CONST . amend. V. That clause protects criminal defendants from prosecution following conviction or acquittal for the same offense, and also prohibits infliction of “multiple punishments for the same offense imposed in a single proceeding.” Jones v. Thomas,491 U.S. 376
, 381 (1989) (internal quotation marks omitted). “With respect to cumulative sentences imposed in a single trial, the Double Jeopardy Clause does no more than prevent the sentencing court from prescribing greater punishment than the legislature intended.” Missouri v. Hunter,459 U.S. 359
, 366 (1983). In fact, “the Court has never held or intimated that the constitutional bar against double jeopardy circumscribes the legislative prerogative to define crimes and prescribe punishment in the context of a single prosecution.” White v. Howes,586 F.3d 1025
, 1032 (6th Cir. 2009), cert. denied,130 S. Ct. 3370
(2010). “Even if the crimes are the same under Blockburger [v. United States,284 U.S. 299
(1932)], if it is evident that a state legislature intended to authorize cumulative punishments, a court’s inquiry is at an end.” Ohio v. Johnson,467 U.S. 493
, 499 n.8 (1984); see also White, 586 F.3d at 1032 (denying habeas even though the panel “agree[d] . . . that the two statutes at issue . . . punish the same offense under Blockburger”).We owe the Michigan courts deference even if, as seems to be the case, Jones’s appeal was the first time that they ruled on the issue. Because “the only question for the [Michigan] Court of Appeals was what the legislature had intended,” any error in its reasoning “is purely a matter of state law.” McCloud v. Deppisch,409 F.3d 869
, 874 (7th Cir.), cert. denied,546 U.S. 1063
(2005); see also Banner v. Davis,886 F.2d 777
, 782 (6th Cir. 1989) (holding that we may not “independently evaluate the scope of the Tennessee statutes here, the Tennessee Court of Criminal Appeals and [Tennessee] Supreme Court having already held that the legislature intended cumulative punishments”).1 “[T]he fact that the state court’s interpretation of state law happens to be central Jones points to language in Banner limiting its relevance when the state courts “failed to give a clear expression on the issue of cumulative punishment.” Banner, 886 F.2d at 782. Banner used that language to distinguish Pryor v. Rose,724 F.2d 525
(6th Cir. 1984) (en banc), an opinion to the double jeopardy analysis does not permit us to review the [Michigan] Court of Appeals’ construction of [its own] law.” McCloud, 409 F.3d at 875. It does not matter, as Jones argues, that the state appellate decision was not precedential or that only a state’s supreme court can issue a binding interpretation of state law. The state court’s decision of state law is not cognizable on habeas review. TRUE INTRODUCTION BACKGROUND Jones cites Brown v. Ohio,432 U.S. 161
(1977), as an example of the Supreme Court reviewing the state court’s reasoning on a double jeopardy claim. In that case, the Court said that it “agree[d] with the Ohio Court of Appeals that joyriding and auto theft, as defined by the [state] court, constitute the same statutory offense within the meaning of the Double Jeopardy Clause.” Id. at 168. Put differently, the Court agreed that, given the lack of legislative authorization for multiple punishments, the convictions in Brown violated the Double Jeopardy Clause.A multiple- punishments challenge takes root only if the legislature did not authorize multiple punishments. When it has, there is no federal issue with which a federal court can agree or disagree. See Banner, 886 F.2d at 782 (rejecting the reading of Brown advocated by Jones).In this case, we must accept the Michigan Court of Appeals’ construction of the Michigan statutes: the murder statute “protect[s] human life and prohibit[s] wrongful slayings”; the conspiracy statute “protect[s] society from the increased danger presented by group activity”; and the solicitation that did not make clear how—or whether—the state court had decided the double-jeopardy question. Banner, 886 F.2d at 782 & n.2. The Banner panel resolved the confusion by holding that we must defer to state-court holdings when the state “courts have carefully considered and analyzed the scope of the [state] statutes.” Id. at 782. The Michigan Court of Appeals did so in this case, and we are bound by Banner. statute “pr[o]scribe[s] the inducement of another to commit an offense.” Jones,2005 WL 657578
, at *5. A federal court reviewing a habeas petition may not, as Jones requests, reexamine the role of Michigan’s rule of lenity, the level of generality at which to examine the purpose of each statute, or whether Michigan’s legislature intended to punish a single act of procurement under three statutes. Given the distinct purposes of the statutes of conviction, there is no colorable argument that the Double Jeopardy Clause protects Jones from being convicted under all three statutes. TRUE STATEMENT OF FACTS D. Sufficiency of the Evidence Fact Under AEDPA, challenges to the sufficiency of the evidence used to convict a petitioner must survive “two layers of deference to groups who might view facts differently than we would.” Brown v. Konteh,567 F.3d 191
, 205 (6th Cir. 2009), cert. denied,130 S. Ct. 1081
(2010). Id. (citations omitted). Jones challenges each of his three convictions, but he disputes the sufficiency of the evidence only as to (1) his intent and (2) his performance of acts that assisted in or his encouragement of the murder. Sufficient evidence supports both elements. TRUE ACT C. Precedent Under Federal Communications Acts. One element of second-degree murder is the “intent to kill, . . . inflict great bodily harm, or . . . create a very high risk of death with the knowledge that the act probably will cause death or great bodily harm.” People v. Bailey,549 N.W.2d 325
, 331 (Mich. 1996). Under an aiding-and-abetting theory of liability, the intent component is satisfied by, among other options, proof that “the defendant intended the commission of the crime.” People v. Robinson,715 N.W.2d 44
, 47–48 (Mich. 2006) (internal quotation and alteration marks removed).  People v. Crawford,591 N.W.2d 669
, 673 (Mich. Ct. App. 1998). Similarly, conspiracy requires specific intent “to combine with others” and “to accomplish the illegal objective.” People v. Carter,330 N.W.2d 314
, 319 (Mich. 1982), overruled in part on other grounds, People v. Robideau,55 N.W.2d 592
(Mich. 1984). In this case, a jury could reasonably find that Jones intended to have the victim killed and intended to make an agreement to kill the victim. Adams and Emma Flowers both testified that, based on the statement that they overheard Trice make, Jones was arranging to have the victim killed. Jones’s statements to Trice—that “[t]he order had been taken care of,” that he had “paid the n-----,” and, when asked “whether he had anything to do with” the victim’s death, he responded “[w]hat you thought,” R. 17 (06/17/03 Trial Tr., Trice at 40, 42–45)—could be interpreted as evidence of intent. The liquor-store conflict and Trice’s difficulties with the victim also supply limited circumstantial support. Resolving factual disputes in favor of the prosecution, we cannot conclude that it was unreasonable for the Michigan Court of Appeals to determine that a rational trier of fact could find that Jones had intended to kill Flowers. TRUE ACT B. The Pole Attachment Act. For similar reasons, the Michigan Court of Appeals was not unreasonable in finding that Jones performed acts or gave encouragement to the shooter, as is required under an aiding-and- abetting theory, Robinson, 715 N.W.2d at 47–48, and that Jones made an agreement to commit murder, which is required for a conspiracy conviction, Carter, 330 N.W.2d at 319. Trice testified that Jones told her that he had paid someone and “taken care of” the “order.” R. 17 (06/17/03 Trial Tr., Trice at 40). Her testimony provides a sufficient basis for the Michigan Court of Appeals to have found that a reasonable jury could have convicted Jones. TRUE CONCLUSION III. CONCLUSION For the reasons explained above, we AFFIRM the district court’s denial of habeas relief. 14


This is a repost of an article I wrote for Brett Clark’s 12 Days of Dreaming series. f you have kids, know people with kids, or work with kids, you know that they will face some painful days as they grow. First comes teething, which I’ve heard is a nightmare. Then, the awkward pubic years when bones are stretching faster than the brain’s balanc... Read more 20 Dec 2012 - 2 minute read
Today, I came to the realization that I’m approaching burnout, and that I need to do something to stay healthy for the break and the second semester. I’ve also learned this year that I need a creative outlet to stay healthy, which is problem numero uno. I haven’t taken time to truly be creative since the summer. So, I’m turning my needs around ... Read more 17 Dec 2012 - 1 minute read
My wife showed me this video the other night. If you haven’t seen it, consider taking thirty seconds to watch it. I’ll wait. At the time, I was entertained. The ending really surprised me, and the video itself was engaging. But, as soon as it was over, I wasn’t thinking about buying a refrigerator or dishwasher any more than I had been before t... Read more 14 Dec 2012 - 1 minute read
I’m going to take a hiatus from Twitter. I love sharing learning with my network. Lately, Twitter has become somewhat of a frustration for me. Being involved is great, but I think it also narrows my vision and I begin to focus on fitting a particular mold or norm based on what my network is doing at the time rather than trusting my own decision... Read more 04 Dec 2012 - less than 1 minute read
I want to preface this post by saying that in my perfect world, we wouldn’t grade at all. But currently, that isn’t my reality. I will continue to do the best I can with the rules and requirements placed on me. My ever-present clipboard We have progress reports coming up this week and as I was sitting and staring at my spreadsh... Read more 03 Dec 2012 - 2 minute read
I don’t mean the “point” of learning in why we need to learn. I mean the actual cognitive place we must find in order to learn. This year has been the hardest year of school I’ve ever had. I fight battles every single day with students over the simple act of thinking. I have had some begin to see the value, but 90% are still pushing back on nea... Read more 27 Nov 2012 - 2 minute read
Schools and children are dictated by the bell schedule. Classes are 57 minutes, except for math and English, which are 87 minutes, because they’re tested at the end of the year. You have three minutes to get to your next class, where you then wash, rinse and repeat. Unless we can break the cycles that drive our schools and really model the real... Read more 05 Nov 2012 - 2 minute read
This Halloween, I did a demonstration in chemistry that’s usually called “Genie in a Bottle.” This year, I decided to tell a short parable along with the demo. I’d like to hear your thoughts in the comments. The Well When the well went sour, no one knew what to do. The water left a rash on the skin, burnt the eyes, and turned the stomach. Som... Read more 31 Oct 2012 - 1 minute read
This may be the longest stretch I’ve gone without writing anything on the blog. My last post was on September 26th, and for various reasons, I haven’t been able to add any new content. Now, because I know there are throngs of people waiting with bated breath to see what happens next, this is more of a digest of the past month in an effort to cle... Read more 15 Oct 2012 - 2 minute read
Every day, I carry a small black journal around to jot down thoughts, changes, and quick reminders to myself. It’s something kids find intriguing for some reason, possibly because I let them read it if they want to. They’re surprised to see how often I think about school and how much I write down about the things they’re working on. What I have... Read more 26 Sep 2012 - 2 minute read


Many times when you're training it will not be what you want to be doing at the time. You'll have great days where you're motivated and ready to train but the days where you don't it is very important to train anyway. Most of the successful ninjas will give you this advice.
When filming your submission video, Meagan Martin, a coach on ANWJr and a competitor on the adult show says, "Be creative and a little funny."
Another ANW competitor Ian Dory says, "Don't try to be someone you're not."
ANW competitor Mike Meyers came up with a fun Thanksgiving workout that you can use at any holiday or family event.
Season 10 competitor Jessica Clayton knows about the importance keeping a clear head and having a good workout or competition. “You have to have the mental capacity to push past the physical limitations. If you’re too afraid to even try something, that’s the biggest killer. You get to something and you look and you’re like, ‘I’m going to do what? I’m going to jump and hang, and I’m going to fall.’
Kacy Catanzaro (above) was the first woman to make it up the warped wall. Another strong female competitor, Jessie Graff, gave advice for tackling the cargo net (also above). She said "Get low, but throw your feet high and lean back. This would help you avoid a long climb down the net, but keep your feet out of the water."


RipEnc: Optional Scripts
There are three extra scripts in this folder, mostly for geeks and special purposes. They're not well honed and I offer no guarantees or warrantees. Be careful! To use a script, move it to ~/config/bin and type its name from Terminal.AddMP3Index
This is the same script that gets run the first time you run RipEnc. Its purpose is to add indexes to a filesystem corresponding to the MP3 attributes in the FileTypes panel, so you can search that volume on arbitrary criteria.Use this script if you have more than one BFS volume, such as one you might be using for MP3 storage. Open a Terminal, cd to your new MP3 volume, e.g.:
cd /mp3and type AddMP3Index. The alert boxes will guide you. You may see some error messages if you try to add an index where you've already got one.ProcessTracks
This script is useful if you've got a lot of pre-existing MP3s and you haven't been religiously setting your MP3 attributes all along, or if you transfer your files to a non-attribute-savvy filesystem, then back to BeOS, and want your attributes back. It will only work with files that already have ID3 tags.It works by finding a list of all MP3 files in a given directory structure, then making sure each one has the correct MIME type (audio/x-mpeg), then copying those files' ID3 tags to attributes and adding appropriate indexes to disk volumes if necessary. processtracks depends on the presence of id3attr being in your path. Edit the first line of processtracks before running it and make sure the path is the shortest path to an MP3 storage location.
TestEnc
TestEnc will generate a pile of MP3s of the same input file at different bitrates so you can run bitrate/quality comparisons. Current output bitrates are 64 96 128 160 192 256. You can change that by editing this line in the script:for i in 64 96 128 160 192 256; doRun TestEnc from the working directory with the input filename as an argument, but leave off the .wav extenstion. e.g. If you want to encode noseblow.wav, run:
TestEnc noseblowIf your input filename has spaces in it, remember to enclose the filename in 'strong quotes' on the command line.


My Name is Alex
I'm in my fifth semester of a Double Major in Geography and Computer Science. I currently work at Spark Ventures as Software Developer. I want to ship code that makes peoples lives easier. I want to solve big problems. I'm always looking for a new way to test myself, I love a good challenge, particularly if it requires a bit of lateral thinking.
Study
Planet Earth is awesome. I want to learn as much about it as I can - I'm passionate about Glacial / Periglacial environments, Coastal Processes and Deserts. I'm also very interested in technology, particularly as it relates to the Visualisation of Big Data (life feels like one big graph at times). I am also interested in UI / UX, Distributed Systems and Geographical Analysis through Simulations and GIS
Experience
A large number of skills and drills that the Army equipped me with, are directly transferable to the Civilian sector. Things like a love of hard work and the results that come from it, the ability to multitask as part of a team or while in sole charge positions, leadership, dedication and the pursuit of excellence - all these things set me apart from my peers. Having secured an internship, my goal for 2015 is another internship! Perhaps in a Geography Related role. Intern Cartographer has a nice ring to it!
Culture
I'm an adrenaline junkie who loves being in the great outdoors - white water rafting, skydiving, rock climbing, if it gets the heart pumping then sign me up. Of course I also enjoy the simpler things, sharing a beer after work, enjoying some down time and spending time with friends and family.


HTML, CSS, JavaScript, jQuery, PHP, SQL, C#, .NET, and Bootstrap are some of the few things that I put to work when developing web applications. I am also experienced with deploying and managing web servers such as Apache and Microsoft IIS.
Storing data is essential. I'm well versed in SQL and have deployed and managed a few different databases including MySQL, Oracle, and Microsoft SQL Server.
Xamarin allows me to develop for iOS, Android, and Windows devices with a single C# codebase. I also have experience developing apps natively with Xcode and the new Swift programming language.
I have done extensive work in modeling, animation, rendering, motion capture, video game development, and 3D graphical programming (OpenGL, DirectX). I'm also fascinated with mixed/virtual reality, so I got myself an Oculus Rift DK2 and plan to develop for it in the future.
With over a decade of experience in digital graphics, I'm able to create and edit all of the assets for my projects. With these skills, I'm able to plan and execute designs from an end-to-end perspective. I also do my own photography with my handy Canon T4i.
Utilizing the Shopify application, I've created Closet Swaggy in order to sell some of the clothes that I've grown out of. One of my other work in progresses is an ecommerce site that will utilize Drupal and the open source Ubercart application.
2014 - Present (Board Member)
This organization was founded in 1989 with the goal of helping young Asian Americans build leadership skills. We organize an annual conference at the Rice University where 144 high schoolers come from all over the United States in order to participate.
2015
This is the world's largest game jam event, it's basically a 48 hour hackathon focused on game development. I was one of two programmers but I also assisted with some of the art assets. We created the game inside of Unity and utilized a fully 3D level, but with animated 2D sprites for the characters. See more here.
2007
During my senior year of high school, I participated in SkillUSA's 3D Animation competition and won 1st place in regionals, and 3rd place at state.
2007
I competed in BPA's Video Production Team event along with three others. We placed first in the regional competition.
2014 - Present (Salesforce.com Certified Developer)
I obtained this certification after attending a week-long training course. I utilize these skills everyday at HP on the transformation project I'm currently assigned to.
2015 - Present (White Belt Certified)
After attending a seminar, I received my Lean Six Sigma White Belt certification. They taught us the core principles and how to apply them in the workplace in order to work more efficiently. I was also awarded first place for my creative solution to a unique problem that we were faced with during the training.
Spring & Fall 2012
I was recognized by the university during my last year of college for my exceptional overall GPA.
Web Developer & Software Engineer


Written by;
{{quote.personSubmitted}}
Posted {{quote.entryDate|dateCount}} Days Ago
LIKE
{{quote.upvote}}
DISLIKE
{{quote.downvote}}
DELETE