更改Google Chrome 用户文件存储目录User Data 最简单方法
当前位置正文更改Google Chrome 用户文件存储目录User Data 最简单方法 1.在你想要存放数据的盘符下创建文件夹,假设为E:\Google\Chrome 2.把已经存在的User Data数据复制到E:\Google\Chrome中 3.开始->附件->命令提示符(右键以管理员身份运行) 4.输入CD C:\Users\你的用户名\AppData\Local\Google\Chrome 5.输入RMDIR /S “User Data”,提示是否删除输入Y 6.输入MKLINK /J “User Data” “E:\Google\Chrome” 7.重启浏览器,大功告成。
a16z领投3000万美元的去中心化社交协议Farcaster教程
Step 1: 设置环境在编写代码之前,您需要设置一个 Node.js 环境,推荐使用 replit ,它是一个基于 IDE 进行编程的浏览器。 1.在 repli 上注册一个免费帐户并登录; 2.点击左上角的create创建;3.出现提示时选择 Node.js,然后点击Create Repl。还需要一个以太坊节点来与 Facaster Registry 合约对话。 建议使用 Alchemy 。 如果您是第一次注册,以下步骤可能会略有不同: 1.注册 Alchemy.com ,并登录。2.选择以太坊作为区块链,点击get started。3.team name和app name随便取,网络选择Rinkeby,点击Create APP。4.选择第一个免费的,点击continue。5.点击跳过。6.继续点击跳过。7.点击continue。8.随便输入什么,点击let‘s go。9.点击view details。10.点击view key。11.找到HTTP的URL,复制v2/后面那部分代码,将其保存在某个地方。12.切换回 Replit 并转到右侧窗格中的 Shell 选项卡并运行以...
更改Google Chrome 用户文件存储目录User Data 最简单方法
当前位置正文更改Google Chrome 用户文件存储目录User Data 最简单方法 1.在你想要存放数据的盘符下创建文件夹,假设为E:\Google\Chrome 2.把已经存在的User Data数据复制到E:\Google\Chrome中 3.开始->附件->命令提示符(右键以管理员身份运行) 4.输入CD C:\Users\你的用户名\AppData\Local\Google\Chrome 5.输入RMDIR /S “User Data”,提示是否删除输入Y 6.输入MKLINK /J “User Data” “E:\Google\Chrome” 7.重启浏览器,大功告成。
a16z领投3000万美元的去中心化社交协议Farcaster教程
Step 1: 设置环境在编写代码之前,您需要设置一个 Node.js 环境,推荐使用 replit ,它是一个基于 IDE 进行编程的浏览器。 1.在 repli 上注册一个免费帐户并登录; 2.点击左上角的create创建;3.出现提示时选择 Node.js,然后点击Create Repl。还需要一个以太坊节点来与 Facaster Registry 合约对话。 建议使用 Alchemy 。 如果您是第一次注册,以下步骤可能会略有不同: 1.注册 Alchemy.com ,并登录。2.选择以太坊作为区块链,点击get started。3.team name和app name随便取,网络选择Rinkeby,点击Create APP。4.选择第一个免费的,点击continue。5.点击跳过。6.继续点击跳过。7.点击continue。8.随便输入什么,点击let‘s go。9.点击view details。10.点击view key。11.找到HTTP的URL,复制v2/后面那部分代码,将其保存在某个地方。12.切换回 Replit 并转到右侧窗格中的 Shell 选项卡并运行以...

Subscribe to andrecronje

Subscribe to andrecronje
<100 subscribers
<100 subscribers
Share Dialog
Share Dialog
估值102亿融资5.45亿的Alchemy 项目,大学每周任务逐步开始。持有大学生早期卡的地址可以进入以下官网,开始大学生活:
官方大佬的 lens ,可以关注下:
1: Numbers Ascending
查看要求:给定一个数字数组,对数字进行升序排序 (1,2,3...) 并返回排序后的数组:

输入:
function sortUp(array) {
return array.sort(function comparison(a, b) {
if (b < a) {
return 1;
}
if (a < b) {
return -1;
}
return 0;
});
}
module.exports = sortUp;
点击运行。
2: Numbers Descending
查看要求,给定一个数字数组,将它们按降序排序并返回数组:

输入:
function sortDown(array) {
return array.sort(function comparison(a, b) {
if (b < a) {
return -1;
}
if (a < b) {
return 1;
}
return 0;
});
}
module.exports = sortDown;
点击运行。
3: Strings Ascending
查看要求,给定一个字符串数组,将它们按升序排序 ('a','b','c'...) 并返回排序后的数组:

输入:
function sortStringsUp(array) {
return array.sort(function comparison(a, b) {
return a.localeCompare(b);
});
}
module.exports = sortStringsUp;
点击运行。
4: Strings Descending
查看要求,给定一个字符串数组,按降序对字符串进行排序 ('c','b','a'...) , 并返回结果排序后的数组:

输入:
function sortStringsDown(array) {
return array.sort(function comparison(a, b) {
if (a.localeCompare(b) === 1) {
return -1;
}
if (a.localeCompare(b) === -1) {
return 1;
}
return a.localeCompare(b);
});
}
module.exports = sortStringsDown;
点击运行。
5: Sort Students
查看要求,给定一组学生,如例子所示,首先按毕业程度排序,然后按年级排序:

输入:
function sortStudents(students) {
return students.sort(function comparison(a, b){
if (a.graduated !== b.graduated) {
if (a.graduated) {
return -1;
} else {
return 1;
}
}
if (a.grade > b.grade) {
return -1;
}
if (a.grade < b.grade) {
return 1;
}
return 0;
});
}
module.exports = sortStudents;
点击运行。
6: Sort By Month
查看要求,给定事件数组,按事件发生的月份对它们进行排序并返回排序后的数组:

输入:
const MONTHS = [
'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN',
'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'
];
function sortByMonth(events) {
return events.sort(function comparison(a, b){
let ai = MONTHS.indexOf(a.month);
let bi = MONTHS.indexOf(b.month);
if (ai < bi) {
return -1;
}
if (ai > bi) {
return 1;
}
return 0;
});
}
module.exports = sortByMonth;
点击运行。
1: Plus One
查看要求,获取数组 arr 并将每个元素加一,返回结果数组:

输入:
function plusOne(arr) {
return arr.map(function(x){
return (x + 1);
});
}
module.exports = plusOne;
点击运行。
2: Square Root
查看要求,使用 squareRoot 函数,将数组 arr 中的每个元素映射到它的平方根。返回新数组:

输入:
function squareRoot(arr) {
return arr.map(function(x){
return Math.sqrt(x);
});
}
module.exports = squareRoot;
点击运行。
3: Squared
查看要求,取一个数字 n 并返回 n 的平方:

输入:
/**
* Given a number n, square it.
*
* @param {number} n
* @return {number} n squared
*/
function squared(n) {
return (n * n);
}
module.exports = squared;
点击运行。
4: Squared Map
查看要求,给定一个集合,要求集合中所有元素都变为平方数:

输入:
const squared = require('./squared');
function squaredMap(arr) {
return arr.map(squared);
}
module.exports = squaredMap;
点击运行。
5: Add Score
查看要求,给定一组玩家,将他们的分数加 10。返回一个包含这些附加点的新数组:

输入:
function addScore(players) {
return players.map(function(player){
let one = player;
one.score = one.score + 10;
return one;
});
}
module.exports = addScore;
点击运行。
6: Add Score Index
查看要求,修改 addScore 函数,只给前 3 名玩家加 10 分:

输入:
function addScore(players) {
let i = 0;
return players.map(function(player){
i++;
let one = player;
if (i < 4) {
one.score = one.score + 10;
}
return one;
});
}
module.exports = addScore;
点击运行。
1: Less Than 5
查看要求,给定一个元素数组,找到值小于 5 的元素,返回结果数组:

输入:
function lessThanFive(array) {
return array.filter(function(e){
return (e < 5);
});
}
module.exports = lessThanFive;
点击运行。
2: Only True
查看要求:给定一个布尔值数组,只保留真值:

输入:
function onlyTrue(array) {
return array.filter(function(e){
return e;
});
}
module.exports = onlyTrue;
点击运行。
3: Short Strings
查看要求,给定一个字符串数组,只保留长度最多为 3 的字符串:

输入:
function shortStrings(array) {
return array.filter(function(e){
return (e.length <= 3);
});
}
module.exports = shortStrings;
点击运行。
4: Top Students
查看要求,查找分数至少为 90 的学生:

输入:
function topStudents(array) {
return array.filter(function(e){
return (e.grade >= 90);
});
}
module.exports = topStudents;
点击运行。
5: First Three
查看要求,给定一个元素数组,只保留前 3 个元素:

输入:
function firstThree(array) {
let i = 0;
return array.filter(function(e){
i++;
if (i < 4) {
return true;
} else {
return false;
}
});
}
module.exports = firstThree;
点击运行。
6: Unique
查看要求,给定一个值数组,返回一个唯一值数组:

输入:
function unique(array) {
let a = [];
return array.filter(function(e){
if (a.indexOf(e) === -1) {
a.push(e);
return true;
}
return false;
});
}
module.exports = unique;
点击运行。
1: Sum
查看要求,应用所学知识,通过将累加器和 currentValue 相加来完成函数 sum:

输入 :
// numbers is an array full of numbers
// let's add all the numbers and return the sum
// i.e. [1,2,3,4,5] => 15
function sum(numbers) {
return numbers.reduce((accumulator, currentValue) => {
accumulator = accumulator + currentValue;
return accumulator;
});
}
module.exports = sum;
点击运行。
2: Largest
查看要求:

输入:
// numbers is an array full of numbers
// let's find the largest and return it
// i.e. [2,3,5,1,4] => 5
function largest(numbers) {
return numbers.reduce((accumulator, currentValue) => {
if (accumulator < currentValue) {
return currentValue;
} else {
return accumulator;
}
}, 1);
}
module.exports = largest;
点击运行。
3: Largest Positive
查看要求:

输入:
// numbers is an array full of numbers
// let's find the largest and return it
// i.e. [2,3,5,1,4] => 5
function largest(numbers) {
return numbers.reduce((accumulator, currentValue) => {
if (accumulator > currentValue) {
return accumulator;
} else {
return currentValue;
}
}, 1);
}
module.exports = largest;
点击运行。
4: Remove Duplicates
查看要求:

输入:
// numbers is an array full of numbers
// let's remove any duplicates and return it
// i.e. [2,2,3,5,1,3,4] => [2,3,5,1,4]
function removeDuplicates(numbers) {
return numbers.reduce((accumulator, currentValue) => {
if (-1 === accumulator.indexOf(currentValue)) {
accumulator.push(currentValue);
}
return accumulator;
}, []);
}
module.exports = removeDuplicates;
点击运行。
5: Group
查看要求:

输入:
// food is an array full of food objects
// let's group them by "type" and return them
function group(foods) {
return foods.reduce((accumulator, currentValue) => {
accumulator[currentValue.type] = accumulator[currentValue.type] || [];
accumulator[currentValue.type].push(currentValue.food);
return accumulator;
}, {});
}
module.exports = group;
点击运行。
6: Is Unique
查看要求:

输入:
// numbers is an array full of integers
// let's figure if all the numbers are unique
// i.e. [1,2,3,1] => false
// [1,2,3] => true
function allUnique(numbers) {
return numbers.reduce((accumulator, currentValue, index) => {
if (! accumulator) {
return false;
}
c = numbers.indexOf(currentValue);
return (c === index);
}, true);
}
module.exports = allUnique;
点击运行。
以上 Array Manipulation 的课程学习结束。
未完待续……
了解更多,请关注作者:https://twitter.com/bitc2024
估值102亿融资5.45亿的Alchemy 项目,大学每周任务逐步开始。持有大学生早期卡的地址可以进入以下官网,开始大学生活:
官方大佬的 lens ,可以关注下:
1: Numbers Ascending
查看要求:给定一个数字数组,对数字进行升序排序 (1,2,3...) 并返回排序后的数组:

输入:
function sortUp(array) {
return array.sort(function comparison(a, b) {
if (b < a) {
return 1;
}
if (a < b) {
return -1;
}
return 0;
});
}
module.exports = sortUp;
点击运行。
2: Numbers Descending
查看要求,给定一个数字数组,将它们按降序排序并返回数组:

输入:
function sortDown(array) {
return array.sort(function comparison(a, b) {
if (b < a) {
return -1;
}
if (a < b) {
return 1;
}
return 0;
});
}
module.exports = sortDown;
点击运行。
3: Strings Ascending
查看要求,给定一个字符串数组,将它们按升序排序 ('a','b','c'...) 并返回排序后的数组:

输入:
function sortStringsUp(array) {
return array.sort(function comparison(a, b) {
return a.localeCompare(b);
});
}
module.exports = sortStringsUp;
点击运行。
4: Strings Descending
查看要求,给定一个字符串数组,按降序对字符串进行排序 ('c','b','a'...) , 并返回结果排序后的数组:

输入:
function sortStringsDown(array) {
return array.sort(function comparison(a, b) {
if (a.localeCompare(b) === 1) {
return -1;
}
if (a.localeCompare(b) === -1) {
return 1;
}
return a.localeCompare(b);
});
}
module.exports = sortStringsDown;
点击运行。
5: Sort Students
查看要求,给定一组学生,如例子所示,首先按毕业程度排序,然后按年级排序:

输入:
function sortStudents(students) {
return students.sort(function comparison(a, b){
if (a.graduated !== b.graduated) {
if (a.graduated) {
return -1;
} else {
return 1;
}
}
if (a.grade > b.grade) {
return -1;
}
if (a.grade < b.grade) {
return 1;
}
return 0;
});
}
module.exports = sortStudents;
点击运行。
6: Sort By Month
查看要求,给定事件数组,按事件发生的月份对它们进行排序并返回排序后的数组:

输入:
const MONTHS = [
'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN',
'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'
];
function sortByMonth(events) {
return events.sort(function comparison(a, b){
let ai = MONTHS.indexOf(a.month);
let bi = MONTHS.indexOf(b.month);
if (ai < bi) {
return -1;
}
if (ai > bi) {
return 1;
}
return 0;
});
}
module.exports = sortByMonth;
点击运行。
1: Plus One
查看要求,获取数组 arr 并将每个元素加一,返回结果数组:

输入:
function plusOne(arr) {
return arr.map(function(x){
return (x + 1);
});
}
module.exports = plusOne;
点击运行。
2: Square Root
查看要求,使用 squareRoot 函数,将数组 arr 中的每个元素映射到它的平方根。返回新数组:

输入:
function squareRoot(arr) {
return arr.map(function(x){
return Math.sqrt(x);
});
}
module.exports = squareRoot;
点击运行。
3: Squared
查看要求,取一个数字 n 并返回 n 的平方:

输入:
/**
* Given a number n, square it.
*
* @param {number} n
* @return {number} n squared
*/
function squared(n) {
return (n * n);
}
module.exports = squared;
点击运行。
4: Squared Map
查看要求,给定一个集合,要求集合中所有元素都变为平方数:

输入:
const squared = require('./squared');
function squaredMap(arr) {
return arr.map(squared);
}
module.exports = squaredMap;
点击运行。
5: Add Score
查看要求,给定一组玩家,将他们的分数加 10。返回一个包含这些附加点的新数组:

输入:
function addScore(players) {
return players.map(function(player){
let one = player;
one.score = one.score + 10;
return one;
});
}
module.exports = addScore;
点击运行。
6: Add Score Index
查看要求,修改 addScore 函数,只给前 3 名玩家加 10 分:

输入:
function addScore(players) {
let i = 0;
return players.map(function(player){
i++;
let one = player;
if (i < 4) {
one.score = one.score + 10;
}
return one;
});
}
module.exports = addScore;
点击运行。
1: Less Than 5
查看要求,给定一个元素数组,找到值小于 5 的元素,返回结果数组:

输入:
function lessThanFive(array) {
return array.filter(function(e){
return (e < 5);
});
}
module.exports = lessThanFive;
点击运行。
2: Only True
查看要求:给定一个布尔值数组,只保留真值:

输入:
function onlyTrue(array) {
return array.filter(function(e){
return e;
});
}
module.exports = onlyTrue;
点击运行。
3: Short Strings
查看要求,给定一个字符串数组,只保留长度最多为 3 的字符串:

输入:
function shortStrings(array) {
return array.filter(function(e){
return (e.length <= 3);
});
}
module.exports = shortStrings;
点击运行。
4: Top Students
查看要求,查找分数至少为 90 的学生:

输入:
function topStudents(array) {
return array.filter(function(e){
return (e.grade >= 90);
});
}
module.exports = topStudents;
点击运行。
5: First Three
查看要求,给定一个元素数组,只保留前 3 个元素:

输入:
function firstThree(array) {
let i = 0;
return array.filter(function(e){
i++;
if (i < 4) {
return true;
} else {
return false;
}
});
}
module.exports = firstThree;
点击运行。
6: Unique
查看要求,给定一个值数组,返回一个唯一值数组:

输入:
function unique(array) {
let a = [];
return array.filter(function(e){
if (a.indexOf(e) === -1) {
a.push(e);
return true;
}
return false;
});
}
module.exports = unique;
点击运行。
1: Sum
查看要求,应用所学知识,通过将累加器和 currentValue 相加来完成函数 sum:

输入 :
// numbers is an array full of numbers
// let's add all the numbers and return the sum
// i.e. [1,2,3,4,5] => 15
function sum(numbers) {
return numbers.reduce((accumulator, currentValue) => {
accumulator = accumulator + currentValue;
return accumulator;
});
}
module.exports = sum;
点击运行。
2: Largest
查看要求:

输入:
// numbers is an array full of numbers
// let's find the largest and return it
// i.e. [2,3,5,1,4] => 5
function largest(numbers) {
return numbers.reduce((accumulator, currentValue) => {
if (accumulator < currentValue) {
return currentValue;
} else {
return accumulator;
}
}, 1);
}
module.exports = largest;
点击运行。
3: Largest Positive
查看要求:

输入:
// numbers is an array full of numbers
// let's find the largest and return it
// i.e. [2,3,5,1,4] => 5
function largest(numbers) {
return numbers.reduce((accumulator, currentValue) => {
if (accumulator > currentValue) {
return accumulator;
} else {
return currentValue;
}
}, 1);
}
module.exports = largest;
点击运行。
4: Remove Duplicates
查看要求:

输入:
// numbers is an array full of numbers
// let's remove any duplicates and return it
// i.e. [2,2,3,5,1,3,4] => [2,3,5,1,4]
function removeDuplicates(numbers) {
return numbers.reduce((accumulator, currentValue) => {
if (-1 === accumulator.indexOf(currentValue)) {
accumulator.push(currentValue);
}
return accumulator;
}, []);
}
module.exports = removeDuplicates;
点击运行。
5: Group
查看要求:

输入:
// food is an array full of food objects
// let's group them by "type" and return them
function group(foods) {
return foods.reduce((accumulator, currentValue) => {
accumulator[currentValue.type] = accumulator[currentValue.type] || [];
accumulator[currentValue.type].push(currentValue.food);
return accumulator;
}, {});
}
module.exports = group;
点击运行。
6: Is Unique
查看要求:

输入:
// numbers is an array full of integers
// let's figure if all the numbers are unique
// i.e. [1,2,3,1] => false
// [1,2,3] => true
function allUnique(numbers) {
return numbers.reduce((accumulator, currentValue, index) => {
if (! accumulator) {
return false;
}
c = numbers.indexOf(currentValue);
return (c === index);
}, true);
}
module.exports = allUnique;
点击运行。
以上 Array Manipulation 的课程学习结束。
未完待续……
了解更多,请关注作者:https://twitter.com/bitc2024
No activity yet