更改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
Share Dialog
Share Dialog
<100 subscribers
<100 subscribers
估值102亿融资5.45亿的Alchemy 项目,大学每周任务逐步开始。持有大学生早期卡的伙伴们可以开始大学生活了:
官方大佬的 lens ,可以关注下:
第三周实际操作的只有一节内容:
1: Run Callback
查看要求:

输入:
/**
* Runs a callback function immediately
* @param {function} callbackFunction
*/
function runCallback(callbackFunction) {
callbackFunction();
}
module.exports = runCallback;
点击运行。
2: Run Callback Async
查看要求:

输入:
/**
* Runs a callback function immediately
* @param {function} callbackFunction
*/
function runCallback(callbackFunction) {
setTimeout(callbackFunction, 1000);
}
module.exports = runCallback;
点击运行。
3: Dialog Callback
查看要求:

输入:
class Dialog {
onClose(callbackFunction) {
this.c = callbackFunction;
}
close() {
this.c();
}
}
module.exports = Dialog;
点击运行。
4: Dialog Callbacks
查看要求:

class Dialog {
onClose(callbackFunction) {
this.carr = this.carr || [];
this.carr.push(callbackFunction);
}
close() {
for (let i = 0; i < this.carr.length; i++) {
this.carr[i]();
}
}
}
module.exports = Dialog;
点击运行。
5: For Each Callback
查看要求:

输入:
function forEach(arr, callback) {
for (let i = 0; i < arr.length; i++) {
callback(arr[i], i);
}
}
module.exports = forEach;
点击运行。
6: Map Callback
查看要求:

输入:
function map(arr, callback) {
let a = [];
for (let i = 0; i < arr.length; i++) {
a.push(callback(arr[i]));
}
return a;
}
module.exports = map;
点击运行。
1: Request Order
查看要求:

输入:
const { makeFood } = require('./Kitchen');
class Order {
constructor() {
this.isReady = false;
}
request(food) {
const promise = makeFood(food);
promise.then( (food) => {
this.isReady = true;
});
}
}
module.exports = Order;
点击运行。
2: Catch Error
查看要求:

输入:
const { makeFood } = require('./Kitchen');
class Order {
constructor() {
this.isReady = false;
}
request(food) {
const promise = makeFood(food);
promise.then( (food) => {
this.isReady = true;
});
promise.catch((err) => {
this.error = err;
});
}
}
module.exports = Order;
点击运行。
3: Create Promise
查看要求:

function timer() {
const promise = new Promise(function(resolve, reject) {
resolve('resolve');
});
return promise;
}
module.exports = timer;
点击运行。
4: Asynchronous Timer
查看要求:

输入:
function timer() {
const promise = new Promise(function(resolve, reject) {
setTimeout(function() {
resolve('resolve');
}, 1000);
});
return promise;
}
module.exports = timer;
点击运行。
5: Async Await
查看要求:

输入:
const { getResults } = require('./lab');
const { sendResults } = require('./messaging');
const { logResponse, logError } = require('./logs');
async function handleResults(patientId) {
const res = await getResults(patientId);
const r = await sendResults(patientId, res);
await logResponse(r);
}
module.exports = handleResults;
点击运行。
6: Catch Await
查看要求:

输入:
const { getResults } = require('./lab');
const { sendResults } = require('./messaging');
const { logResponse, logError } = require('./logs');
async function handleResults(patientId) {
try {
const res = await getResults(patientId);
const r = await sendResults(patientId, res);
await logResponse(r);
} catch (ex) {
logError(ex);
}
}
module.exports = handleResults;
点击运行。
1: Then and Catch
查看要求:

输入:
class Pact {
constructor(fn) {
this.catchs = [];
this.thens = [];
this.f1 = (value)=> {
for (let i = 0; i < this.thens.length; i++) {
this.thensi;
}
};
this.f2 = (value)=> {
for (let i = 0; i < this.catchs.length; i++) {
this.catchsi;
}
};
fn(this.f1, this.f2);
}
catch(c) {
this.catchs.push(c);
}
then(t) {
this.thens.push(t);
}
}
module.exports = Pact;
点击运行。
2: Executor Function
查看要求:

输入:
class Pact {
constructor(fn) {
this.catchs = [];
this.thens = [];
this.f1 = (value)=> {
for (let i = 0; i < this.thens.length; i++) {
this.thensi;
}
};
this.f2 = (value)=> {
for (let i = 0; i < this.catchs.length; i++) {
this.catchsi;
}
};
fn(this.f1, this.f2);
}
catch(c) {
this.catchs.push(c);
}
then(t) {
this.thens.push(t);
}
}
module.exports = Pact;
点击运行。
3: Then... What?
查看要求:

输入:
class Pact {
constructor(fn) {
this.catchs = [];
this.thens = [];
this.f1 = (value)=> {
for (let i = 0; i < this.thens.length; i++) {
this.thensi;
}
};
this.f2 = (value)=> {
for (let i = 0; i < this.catchs.length; i++) {
this.catchsi;
}
};
fn(this.f1, this.f2);
}
catch(c) {
this.catchs.push(c);
}
then(t) {
this.thens.push(t);
}
}
module.exports = Pact;
点击运行。
4: Catch the Rejection
查看要求:

输入:
class Pact {
constructor(fn) {
this.catchs = [];
this.thens = [];
this.f1 = (value)=> {
for (let i = 0; i < this.thens.length; i++) {
this.thensi;
}
};
this.f2 = (value)=> {
for (let i = 0; i < this.catchs.length; i++) {
this.catchsi;
}
};
fn(this.f1, this.f2);
}
catch(c) {
this.catchs.push(c);
}
then(t) {
this.thens.push(t);
}
}
module.exports = Pact;
点击运行。
5: Multiple Callbacks
查看要求:

输入:
class Pact {
constructor(fn) {
this.catchs = [];
this.thens = [];
this.f1 = (value)=> {
for (let i = 0; i < this.thens.length; i++) {
this.thensi;
}
};
this.f2 = (value)=> {
for (let i = 0; i < this.catchs.length; i++) {
this.catchsi;
}
};
fn(this.f1, this.f2);
}
catch(c) {
this.catchs.push(c);
}
then(t) {
this.thens.push(t);
}
}
module.exports = Pact;
点击运行。
6: Immediate Resolve
查看要求:

输入:
const STATUS = {
PENDING: 0,
RESOLVED: 1,
REJECTED: 2,
}
class Pact {
constructor(fn) {
this.catchs = [];
this.thens = [];
this.status = STATUS.PENDING;
this.f1 = (value)=> {
this.resolvedValue = value;
this.status = STATUS.RESOLVED;
for (let i = 0; i < this.thens.length; i++) {
this.thensi;
}
};
this.f2 = (value)=> {
this.rejectedValue = value;
this.status = STATUS.REJECTED;
for (let i = 0; i < this.catchs.length; i++) {
this.catchsi;
}
};
fn(this.f1, this.f2);
}
catch(c) {
if (this.status === STATUS.PENDING) {
this.catchs.push(c);
}
else if (this.status === STATUS.REJECTED) {
c(this.rejectedValue);
}
}
then(t) {
if (this.status === STATUS.PENDING) {
this.thens.push(t);
}
else if (this.status === STATUS.RESOLVED) {
t(this.resolvedValue);
}
}
}
module.exports = Pact;
点击运行。
7: Chaining Callbacks
查看要求:

输入:
const STATUS = {
PENDING: 0,
RESOLVED: 1,
REJECTED: 2,
}
class Pact {
constructor(fn) {
this.catchs = [];
this.thens = [];
this.status = STATUS.PENDING;
this.f1 = (value)=> {
this.resolvedValue = value;
this.status = STATUS.RESOLVED;
for (let i = 0; i < this.thens.length; i++) {
this.thensi;
}
};
this.f2 = (value)=> {
this.rejectedValue = value;
this.status = STATUS.REJECTED;
for (let i = 0; i < this.catchs.length; i++) {
this.catchsi;
}
};
fn(this.f1, this.f2);
}
catch(c) {
if (this.status === STATUS.PENDING) {
this.catchs.push(c);
}
else if (this.status === STATUS.REJECTED) {
c(this.rejectedValue);
}
}
then(t) {
if (this.status === STATUS.PENDING) {
return new Pact((resolve, reject) => {
this.thens.push((val) => {
if (val instanceof Pact) {
val.then((val) => resolve(t(val)));
}
else {
resolve(t(val));
}
});
});
}
else if (this.status === STATUS.RESOLVED) {
t(this.resolvedValue);
}
}
}
module.exports = Pact;
点击运行。
8: Chaining Promises
查看要求:

输入:
const STATUS = {
PENDING: 0,
RESOLVED: 1,
REJECTED: 2,
}
class Pact {
constructor(fn) {
this.catchs = [];
this.thens = [];
this.status = STATUS.PENDING;
this.f1 = (value)=> {
this.resolvedValue = value;
this.status = STATUS.RESOLVED;
for (let i = 0; i < this.thens.length; i++) {
this.thensi;
}
};
this.f2 = (value)=> {
this.rejectedValue = value;
this.status = STATUS.REJECTED;
for (let i = 0; i < this.catchFn.length; i++) {
this.catchsi;
}
};
fn(this.f1, this.f2);
}
catch(c) {
if (this.status === STATUS.PENDING) {
this.catchs.push(c);
}
else if (this.status === STATUS.REJECTED) {
c(this.rejectedValue);
}
}
then(t) {
if (this.status === STATUS.PENDING) {
return new Pact((resolve, reject) => {
this.thens.push((val) => {
if (val instanceof Pact) {
val.then((val) => resolve(t(val)));
}
else {
resolve(t(val));
}
});
});
}
else if (this.status === STATUS.RESOLVED) {
t(this.resolvedValue);
}
}
}
module.exports = Pact;
点击运行。
以上第三周的课程学习完成。
未完待续……
了解更多,请关注作者:https://twitter.com/bitc2024
估值102亿融资5.45亿的Alchemy 项目,大学每周任务逐步开始。持有大学生早期卡的伙伴们可以开始大学生活了:
官方大佬的 lens ,可以关注下:
第三周实际操作的只有一节内容:
1: Run Callback
查看要求:

输入:
/**
* Runs a callback function immediately
* @param {function} callbackFunction
*/
function runCallback(callbackFunction) {
callbackFunction();
}
module.exports = runCallback;
点击运行。
2: Run Callback Async
查看要求:

输入:
/**
* Runs a callback function immediately
* @param {function} callbackFunction
*/
function runCallback(callbackFunction) {
setTimeout(callbackFunction, 1000);
}
module.exports = runCallback;
点击运行。
3: Dialog Callback
查看要求:

输入:
class Dialog {
onClose(callbackFunction) {
this.c = callbackFunction;
}
close() {
this.c();
}
}
module.exports = Dialog;
点击运行。
4: Dialog Callbacks
查看要求:

class Dialog {
onClose(callbackFunction) {
this.carr = this.carr || [];
this.carr.push(callbackFunction);
}
close() {
for (let i = 0; i < this.carr.length; i++) {
this.carr[i]();
}
}
}
module.exports = Dialog;
点击运行。
5: For Each Callback
查看要求:

输入:
function forEach(arr, callback) {
for (let i = 0; i < arr.length; i++) {
callback(arr[i], i);
}
}
module.exports = forEach;
点击运行。
6: Map Callback
查看要求:

输入:
function map(arr, callback) {
let a = [];
for (let i = 0; i < arr.length; i++) {
a.push(callback(arr[i]));
}
return a;
}
module.exports = map;
点击运行。
1: Request Order
查看要求:

输入:
const { makeFood } = require('./Kitchen');
class Order {
constructor() {
this.isReady = false;
}
request(food) {
const promise = makeFood(food);
promise.then( (food) => {
this.isReady = true;
});
}
}
module.exports = Order;
点击运行。
2: Catch Error
查看要求:

输入:
const { makeFood } = require('./Kitchen');
class Order {
constructor() {
this.isReady = false;
}
request(food) {
const promise = makeFood(food);
promise.then( (food) => {
this.isReady = true;
});
promise.catch((err) => {
this.error = err;
});
}
}
module.exports = Order;
点击运行。
3: Create Promise
查看要求:

function timer() {
const promise = new Promise(function(resolve, reject) {
resolve('resolve');
});
return promise;
}
module.exports = timer;
点击运行。
4: Asynchronous Timer
查看要求:

输入:
function timer() {
const promise = new Promise(function(resolve, reject) {
setTimeout(function() {
resolve('resolve');
}, 1000);
});
return promise;
}
module.exports = timer;
点击运行。
5: Async Await
查看要求:

输入:
const { getResults } = require('./lab');
const { sendResults } = require('./messaging');
const { logResponse, logError } = require('./logs');
async function handleResults(patientId) {
const res = await getResults(patientId);
const r = await sendResults(patientId, res);
await logResponse(r);
}
module.exports = handleResults;
点击运行。
6: Catch Await
查看要求:

输入:
const { getResults } = require('./lab');
const { sendResults } = require('./messaging');
const { logResponse, logError } = require('./logs');
async function handleResults(patientId) {
try {
const res = await getResults(patientId);
const r = await sendResults(patientId, res);
await logResponse(r);
} catch (ex) {
logError(ex);
}
}
module.exports = handleResults;
点击运行。
1: Then and Catch
查看要求:

输入:
class Pact {
constructor(fn) {
this.catchs = [];
this.thens = [];
this.f1 = (value)=> {
for (let i = 0; i < this.thens.length; i++) {
this.thensi;
}
};
this.f2 = (value)=> {
for (let i = 0; i < this.catchs.length; i++) {
this.catchsi;
}
};
fn(this.f1, this.f2);
}
catch(c) {
this.catchs.push(c);
}
then(t) {
this.thens.push(t);
}
}
module.exports = Pact;
点击运行。
2: Executor Function
查看要求:

输入:
class Pact {
constructor(fn) {
this.catchs = [];
this.thens = [];
this.f1 = (value)=> {
for (let i = 0; i < this.thens.length; i++) {
this.thensi;
}
};
this.f2 = (value)=> {
for (let i = 0; i < this.catchs.length; i++) {
this.catchsi;
}
};
fn(this.f1, this.f2);
}
catch(c) {
this.catchs.push(c);
}
then(t) {
this.thens.push(t);
}
}
module.exports = Pact;
点击运行。
3: Then... What?
查看要求:

输入:
class Pact {
constructor(fn) {
this.catchs = [];
this.thens = [];
this.f1 = (value)=> {
for (let i = 0; i < this.thens.length; i++) {
this.thensi;
}
};
this.f2 = (value)=> {
for (let i = 0; i < this.catchs.length; i++) {
this.catchsi;
}
};
fn(this.f1, this.f2);
}
catch(c) {
this.catchs.push(c);
}
then(t) {
this.thens.push(t);
}
}
module.exports = Pact;
点击运行。
4: Catch the Rejection
查看要求:

输入:
class Pact {
constructor(fn) {
this.catchs = [];
this.thens = [];
this.f1 = (value)=> {
for (let i = 0; i < this.thens.length; i++) {
this.thensi;
}
};
this.f2 = (value)=> {
for (let i = 0; i < this.catchs.length; i++) {
this.catchsi;
}
};
fn(this.f1, this.f2);
}
catch(c) {
this.catchs.push(c);
}
then(t) {
this.thens.push(t);
}
}
module.exports = Pact;
点击运行。
5: Multiple Callbacks
查看要求:

输入:
class Pact {
constructor(fn) {
this.catchs = [];
this.thens = [];
this.f1 = (value)=> {
for (let i = 0; i < this.thens.length; i++) {
this.thensi;
}
};
this.f2 = (value)=> {
for (let i = 0; i < this.catchs.length; i++) {
this.catchsi;
}
};
fn(this.f1, this.f2);
}
catch(c) {
this.catchs.push(c);
}
then(t) {
this.thens.push(t);
}
}
module.exports = Pact;
点击运行。
6: Immediate Resolve
查看要求:

输入:
const STATUS = {
PENDING: 0,
RESOLVED: 1,
REJECTED: 2,
}
class Pact {
constructor(fn) {
this.catchs = [];
this.thens = [];
this.status = STATUS.PENDING;
this.f1 = (value)=> {
this.resolvedValue = value;
this.status = STATUS.RESOLVED;
for (let i = 0; i < this.thens.length; i++) {
this.thensi;
}
};
this.f2 = (value)=> {
this.rejectedValue = value;
this.status = STATUS.REJECTED;
for (let i = 0; i < this.catchs.length; i++) {
this.catchsi;
}
};
fn(this.f1, this.f2);
}
catch(c) {
if (this.status === STATUS.PENDING) {
this.catchs.push(c);
}
else if (this.status === STATUS.REJECTED) {
c(this.rejectedValue);
}
}
then(t) {
if (this.status === STATUS.PENDING) {
this.thens.push(t);
}
else if (this.status === STATUS.RESOLVED) {
t(this.resolvedValue);
}
}
}
module.exports = Pact;
点击运行。
7: Chaining Callbacks
查看要求:

输入:
const STATUS = {
PENDING: 0,
RESOLVED: 1,
REJECTED: 2,
}
class Pact {
constructor(fn) {
this.catchs = [];
this.thens = [];
this.status = STATUS.PENDING;
this.f1 = (value)=> {
this.resolvedValue = value;
this.status = STATUS.RESOLVED;
for (let i = 0; i < this.thens.length; i++) {
this.thensi;
}
};
this.f2 = (value)=> {
this.rejectedValue = value;
this.status = STATUS.REJECTED;
for (let i = 0; i < this.catchs.length; i++) {
this.catchsi;
}
};
fn(this.f1, this.f2);
}
catch(c) {
if (this.status === STATUS.PENDING) {
this.catchs.push(c);
}
else if (this.status === STATUS.REJECTED) {
c(this.rejectedValue);
}
}
then(t) {
if (this.status === STATUS.PENDING) {
return new Pact((resolve, reject) => {
this.thens.push((val) => {
if (val instanceof Pact) {
val.then((val) => resolve(t(val)));
}
else {
resolve(t(val));
}
});
});
}
else if (this.status === STATUS.RESOLVED) {
t(this.resolvedValue);
}
}
}
module.exports = Pact;
点击运行。
8: Chaining Promises
查看要求:

输入:
const STATUS = {
PENDING: 0,
RESOLVED: 1,
REJECTED: 2,
}
class Pact {
constructor(fn) {
this.catchs = [];
this.thens = [];
this.status = STATUS.PENDING;
this.f1 = (value)=> {
this.resolvedValue = value;
this.status = STATUS.RESOLVED;
for (let i = 0; i < this.thens.length; i++) {
this.thensi;
}
};
this.f2 = (value)=> {
this.rejectedValue = value;
this.status = STATUS.REJECTED;
for (let i = 0; i < this.catchFn.length; i++) {
this.catchsi;
}
};
fn(this.f1, this.f2);
}
catch(c) {
if (this.status === STATUS.PENDING) {
this.catchs.push(c);
}
else if (this.status === STATUS.REJECTED) {
c(this.rejectedValue);
}
}
then(t) {
if (this.status === STATUS.PENDING) {
return new Pact((resolve, reject) => {
this.thens.push((val) => {
if (val instanceof Pact) {
val.then((val) => resolve(t(val)));
}
else {
resolve(t(val));
}
});
});
}
else if (this.status === STATUS.RESOLVED) {
t(this.resolvedValue);
}
}
}
module.exports = Pact;
点击运行。
以上第三周的课程学习完成。
未完待续……
了解更多,请关注作者:https://twitter.com/bitc2024
No activity yet