+1 i'm fine with this
Consider dropping the hard gnode dependency
In response to #433 and #445, I think it's time to consider dropping gnode
throughout the duo libs:
 It's becoming more common for devs to use ES6 transpilers, and our hard coupling with gnode prevents others (like babel) from being used easily (#445)
 Some bugs have been really tricky to pin down, (#433) but that problem would have been solved much faster if we just got a syntax error right away
 Stack traces get really confusing when gnode is pulled in automatically
 node 0.12 is now the official stable version, and iojs has generators enabled w/o the flag, so I don't think we need to put as much effort into supporting node 0.10 (we should still support it, but we use gnode only for our CI tests)
 We already expose _duo
as the raw node script, making it easy to support other transpilers (and even gnode if people so desire) to execute duo's CLI in a specific env
该提问来源于开源项目：duojs/duo
 点赞
 写回答
 关注问题
 收藏
 复制链接分享
 邀请回答
7条回答

采纳
点赞 评论 复制链接分享

采纳
I'm going to push forward on this soon, it seems like lots of weird edgecases are cropping up because of gnode/regenerator. (and with people using node 0.12 more often, the errors mentioned here really obscure the fact that the
harmonygenerators
flag was left out)点赞 评论 复制链接分享 
采纳
sgtm!
点赞 评论 复制链接分享 
采纳
+1 from me, but unfortunately, a lot of my team is still using node 0.10... and it's what we've got in production.
i'll either get people to move to iojs/node 0.12, or try to hack something together on my end using gnode.
点赞 评论 复制链接分享 
采纳
yeah, my team still has node 0.10 around as well. (though we're using 0.11 more often) Thankfully, all you need to do if you know you're using node 0.10 is to add
gnode
to your build command. (you guys use make right?)点赞 评论 复制链接分享 
采纳
yep, we'll just:
Makefile build.js: ... $(BIN)/gnode $(BIN)/_duo ...
点赞 评论 复制链接分享 
采纳
The last dependency including gnode is duotest, but since that's a subcommand it doesn't affect duo core anymore.
点赞 评论 复制链接分享
相关推荐
 回答 1 已采纳 Description You have N stones (1 ≤ N ≤ 10), each stone is characterized by weight pi and cost vi (i = 1, ... , N). You should drop these stones by a gutter into one of the two bunkers: A or В. The mechanism of receiving bunkers switching works as follows. The stones are dropping into one of the bunkers until the weight of this bunker’s content will exceed the weight of stones in other bunker by more than D. Then the gutter switches to the other bunker. At the beginning both bunkers are empty, and the first stone falls into the bunker А. The task is to collect stones with maximum total cost in bunker B after all stones have been dropped. Input The input consists of N + 1 lines. The first line contains values N and D separated by one or several spaces. The next lines contain values pi and vi, also separated by spaces. All input data (except N) are integers from 0 to 10000. Output The output contains a single line with total cost of stones in the bunker B. Sample Input 4 2 2 2 2 2 1 1 1 1 Sample Output 3
 4年前回答 1 已采纳 Problem Description The inhabitants of a small Caribbean island in the region known as Bermuda's Triangle love to spend their warm summer nights playing cards. As a tribute to the region where they live, all of their card games have some connection to triangles. One of the most popular games in the island is known as Triples, and has very simple rules. The game is played between two players, with a set of standard playing cards. Cards are distinguished only by their values, from 1 (Ace) to 13 (King). The cards are shuffled and placed as a pile in the center of the table, face down. This pile is called the stock. The two players take turns at playing. At each turn, a player ●draws the top card from the stock, adding it to her/his hand; and ●decides whether she/he wants to "drop some triples" Dropping a triple consists of choosing three cards (a triple) from the hand and placing them on the table, face up. The dropped triples stay on the table until the end of the game. Only some sets of three cards form a valid triple. There are two types of valid triples: ●Perfect triples are made of three cards whose values represent the length of sides of an equilateral triangle; ●Common triples are made by three cards whose values represent the length of sides of any other (not equilateral) triangle. The figure below shows examples of perfect triples (a), common triples (b), and invalid triples(c). Only valid triples can be dropped, but a player may drop any number of triples at a given turn. In particular, since players know the number of cards in the stock at every turn, a player may decide to drop all triples in her/his last turn. Some players, however, normally drop some triples during the game, to maintain as few cards in their hands as possible. The game finishes when the stock is empty. The winner is the player that dropped the largest number of perfect triples. If both players dropped the same number of perfect triples, the winner is the player that dropped the largest number of common triples. If both players dropped the same number of perfect triples and the same number of common triples, the result is a tie. Given the description of the cards in the stock, write a program that determines the winner of a game of Triples, considering both players play as best as possible. Input The input contains several test cases. The first line of a test case contains one integer N representing the number of cards in the stock (6 <= N <= 104). The next line contains N integers Xi, separated by single spaces, representing the cards in the stock (1 <= Xi <= 13, for 1 <= i <= N). The cards are given in the order they are drawn by the players: the first card in the input (X1) is the first card drawn, the second card in the input (X2) is the second card drawn, and so on. Several cards with the same value may be present in the stock, and not necessarily all card values are present in the stock. The end of input is indicated by N = 0. Output For each test case your program must output a single line, containing '1' if the first player to play wins the game, '2' if the second player wins, or '0' if there is a tie. Sample Input 7 5 6 5 6 5 6 8 12 13 13 13 13 13 13 1 3 2 9 3 9 12 1 2 1 2 1 2 3 1 4 2 5 3 0 Sample Output 0 2 1
 回答 1 已采纳 Description The Advancement of Collegiate Mastermind (hey, that's ACM again...weird!) is an organization which (among other things) holds classes for college students to improve their Mastermind skills. Recall that basic Mastermind is a twoplayer game which works as follows: The first player – the codemaker – creates a secret 4color code, each color taken from one of six colors (we'll use A, B, C, D, E and F for the colors). The other player – the codebreaker – now must try to guess the codemaker's code. After each guess, the codemaker uses black and white pegs to tell the codebreaker two things: the number of correct colors in the correct positions (the black pegs), and the number of remaining correct colors that are in the wrong positions (the white pegs). For example, if the true code is ABCC, and the codebreaker makes the guess ACCD, then the response would be 2 black and 1 white; if the guess was CCAA, the response would be 3 white. The codebreaker continues making guesses until he receives 4 blacks. More advanced versions of Mastermind increase both the length of the code and the number of colors to choose from. The ACM's master instructor is Dee Sifer, and she has a unique ability: when given a set of n guesses and responses, she can immediately determine what the best (n + 1)st guess should be. For each possible (n + 1)st guess, Dee calculates (in her head) the number of codes left for each possible response she could get to that guess. The maximum of these numbers over all responses is called the uncertainty of the guess. The "best" guess is the one with the minimum uncertainty. For example, suppose that you get to a point in a game where you've narrowed down the answer to only three possible codes: ABBB, ABBC or ABCB. If your next guess is ABBB, there would be two possible responses: 4 blacks (leaving 0 remaining possibilities left) or 3 blacks (leaving 2 remaining possibilities – ABBC and ABCB). However, if instead of ABBB you try ABBC, then there are 3 possible responses: 4 blacks (leaving 0 possibilities), 3 blacks (leaving 1 possibility – ABBB) and 2 blacks and 2 whites (also leaving 1 possibility – ABCB). Thus ABBC would be a better guess in this case, since the uncertainty it leaves is 1, whereas the uncertainty for ABBB is 2. This is all well and good, except for one thing. You have been selected as Dee's successor, and you do NOT have Dee's ability to pick the minimum uncertainty guess. Dee has been dropping hints (in code) that she plans to retire soon, so you need a program to help you simulate her ability. Input Input will consist of multiple test cases. The first line of the input file will contain a single integer indicating the number of test cases. Each test case will consist of several lines. The first line will contain three integers: l c n, where l is the length of the code being guessed, c is the number of colors to choose from, and n is the number of guesses made so far. These values will satisfy 1 ≤ l ≤ 15, 1 ≤ c ≤ 20, 0 ≤ n ≤ 10. The values of l and c will be such that the total possible number of codes will be 32768. After this will come n lines of the form : guess b w where guess is a lengthl character string specifying a guess, and b and w are the number of black and white pegs in the response. All colors will be uppercase letters taken from the first c letters of the alphabet. For each test case, the guesses given will limit the total number of possible solutions to 1500. Output For each test case, output a single line containing the best guess and its uncertainty. Use a single blank to separate the guess from the uncertainty. If there is more than one guess with the same minimum uncertainty, use the one which comes first lexicographically. Sample Input 3 4 6 2 AABC 1 2 BEAC 0 3 4 6 1 ABCD 0 0 3 20 4 ABE 1 0 ROM 1 0 INK 1 0 MOB 0 2 Sample Output ABCD 4 AEEE 3 IBM 0
 4年前回答 2 已采纳 Problem Description The town of W has N people. Each person takes two magic balls A and B every day. Each ball has the volume ai and bi. People often stand together. The wizard will find the longest increasing subsequence in the ball A. The wizard has M energy. Each point of energy can change the two balls’ volume.(swap(ai,bi)).The wizard wants to know how to make the longest increasing subsequence and the energy is not negative in last. In order to simplify the problem, you only need to output how long the longest increasing subsequence is. Input The first line contains a single integer T(1≤T≤20)(the data for N>100 less than 6 cases), indicating the number of test cases. Each test case begins with two integer N(1≤N≤1000) and M(0≤M≤1000),indicating the number of people and the number of the wizard’s energy. Next N lines contains two integer ai and bi(1≤ai,bi≤109),indicating the balls’ volume. Output For each case, output an integer means how long the longest increasing subsequence is. Sample Input 2 5 3 5 1 4 2 3 1 2 4 3 1 5 4 5 1 4 2 3 1 2 4 3 1 Sample Output 4 4
 4年前回答 2 已采纳 Problem Description Farmer John's farm has N barns, and there are some cows that live in each barn. The cows like to drop around, so John wants to build some roads to connect these barns. If he builds roads for every pair of different barns, then he must build N * (N  1) / 2 roads, which is so costly that cheapskate John will never do that, though that's the best choice for the cows. Clever John just had another good idea. He first builds two transferring point S1 and S2, and then builds a road connecting S1 and S2 and N roads connecting each barn with S1 or S2, namely every barn will connect with S1 or S2, but not both. So that every pair of barns will be connected by the roads. To make the cows don't spend too much time while dropping around, John wants to minimize the maximum of distances between every pair of barns. That's not the whole story because there is another troublesome problem. The cows of some barns hate each other, and John can't connect their barns to the same transferring point. The cows of some barns are friends with each other, and John must connect their barns to the same transferring point. What a headache! Now John turns to you for help. Your task is to find a feasible optimal roadbuilding scheme to make the maximum of distances between every pair of barns as short as possible, which means that you must decide which transferring point each barn should connect to. We have known the coordinates of S1, S2 and the N barns, the pairs of barns in which the cows hate each other, and the pairs of barns in which the cows are friends with each other. Note that John always builds roads vertically and horizontally, so the length of road between two places is their Manhattan distance. For example, saying two points with coordinates (x1, y1) and (x2, y2), the Manhattan distance between them is x1  x2 + y1  y2. Input The first line of input consists of 3 integers N, A and B (2 <= N <= 500, 0 <= A <= 1000, 0 <= B <= 1000), which are the number of barns, the number of pairs of barns in which the cows hate each other and the number of pairs of barns in which the cows are friends with each other. Next line contains 4 integer sx1, sy1, sx2, sy2, which are the coordinates of two different transferring point S1 and S2 respectively. Each of the following N line contains two integer x and y. They are coordinates of the barns from the first barn to the last one. Each of the following A lines contains two different integers i and j(1 <= i < j <= N), which represent the ith and jth barns in which the cows hate each other. The same pair of barns never appears more than once. Each of the following B lines contains two different integers i and j(1 <= i < j <= N), which represent the ith and jth barns in which the cows are friends with each other. The same pair of barns never appears more than once. You should note that all the coordinates are in the range [1000000, 1000000]. Output You just need output a line containing a single integer, which represents the maximum of the distances between every pair of barns, if John selects the optimal roadbuilding scheme. Note if there is no feasible solution, just output 1. Sample Input 4 1 1 12750 28546 15361 32055 6706 3887 10754 8166 12668 19380 15788 16059 3 4 2 3 Sample Output 53246
 回答 2 已采纳 ![图片说明](https://imgask.csdn.net/upload/202007/23/1595487778_75785.jpg) 两个节点的创世块文件相同，networkid也相同。有前辈遇到过类似的问题吗？
 3年前回答 2 已采纳 Variations on this are pretty common questions, but all my googlefu has left me stumped. I would like to calculate the odds of a fair dice roll, but I want to do it efficiently. There are lots of examples out there of how to do this, but all the algorithms I've found are too computationally expensive (exponential time) to work for large numbers of dice with many sides. The Simple Problem: Calculate the odds of a roll of n, on x y sided dice. The Simple Solution: Create the nary Cartesian product of the roll, sum each product, count the number of times the sum is the target, do a little division and voila. Example of a Simple Solution in Go: https://play.golang.org/p/KNUS4YBQC0g The Simple Solution works perfectly. I extended it to allow for cases like dropping the highest/lowest n faces, and the results hold up to spot testing. But consider {Count: 20,Sides: 20,DropHighest: 0,DropLowest:0, Target: 200}. If I evaluated that with the previous solution, my "table" would have 104 some odd septillion cells and will max the CPU pretty easily. Is there a more efficient way to calculate probability for large numbers of dice with many sides? If so, can it account for more complex selection of "success" conditions like dropping some dice? I'm convinced it's possible due to the existence of this beautiful website: https://anydice.com/program/969 EDIT: The solution that worked best for me was David Eisenstat's answer, which I ported to go: https://play.golang.org/p/cpD51opQf5h
 4年前回答 2 已采纳 This problem is inspired by Pachinko, a popular game in Japan. A traditional Pachinko machine is a cross between a vertical pinball machine and a slot machine. The player launches small steel balls to the top of the machine using a plunger as in pinball. A ball drops through a maze of pins that deflect the ball, and eventually the ball either exits at a hole in the bottom and is lost, or lands in one of many gates scattered throughout the machine which reward the player with more balls in varying amounts. Players who collect enough balls can trade them in for prizes. For the purposes of this problem, a linear Pachinko machine is a sequence of one or more of the following: holes ("."), floor tiles ("_"), walls (""), and mountains ("/\"). A wall or mountain will never be adjacent to another wall or mountain. To play the game, a ball is dropped at random over some character within a machine. A ball dropped into a hole falls through. A ball dropped onto a floor tile stops immediately. A ball dropped onto the left side of a mountain rolls to the left across any number of consecutive floor tiles until it falls into a hole, falls off the left end of the machine, or stops by hitting a wall or mountain. A ball dropped onto the right side of a mountain behaves similarly. A ball dropped onto a wall behaves as if it were dropped onto the left or right side of a mountain, with a 50% chance for each. If a ball is dropped at random over the machine, with all starting positions being equally likely, what is the probability that the ball will fall either through a hole or off an end? For example, consider the following machine, where the numbers just indicate character positions and are not part of the machine itself: 123456789 /\.__/\. The probabilities that a ball will fall through a hole or off the end of the machine are as follows, by position: 1=100%, 2=100%, 3=100%, 4=50%, 5=0%, 6=0%, 7=0%, 8=100%, 9=100%. The combined probability for the whole machine is just the average, which is approximately 61.111%. Input: The input consists of one or more linear Pachinko machines, each 1–79 characters long and on a line by itself, followed by a line containing only "#" that signals the end of the input. Output: For each machine, compute as accurately as possible the probability that a ball will fall through a hole or off the end when dropped at random, then output a single line containing that percentage truncated to an integer by dropping any fractional part. Example input: Example output: /\.__/\. _._/\_.__/\./\_ ... ___ ./\. _/\_ _._._._ _________ # 61 53 100 0 100 50 53 10
 zhangrelay的博客 hardware world but my colleagues working on the higher level software tend think all of the above is necessary for dealing with the hundreds of packages and dependency hell that come with the "modular...
 csuk022288的博客 consider teaching Python 3 first and then introducing the differences in Python 2 afterwards (if necessary), since Python 3 eliminates many quirks that can unnecessarily trip up beginning ...
 datamonday的博客 论文原文：LINK 论文被引：10131(11/09/2020) 文章目录 SSD: Single Shot MultiBox Detector Abstract 1 Introduction 2 The Single Shot Detector (SSD) 2.1 Model 2.2 Training 3 Experimental Results 3.1 PASCAL...
 SQLplusDB的博客 add_stale_mv_to_dependency_list add stale mv to dependency list TRUE _add_trim_for_nlssort add trimming for fixed char semantics TRUE _addm_auto_actions_enabled determines if ADDM can automatically ...
 sanlinux的博客 http://lwn.net/Articles/372419/ Greg KroahHartman: Android and the Linux kernel community [Posted February 3, 2010 by jake]
 他乡觅知音的博客 Use the MKDG command to restore the disk group with the same configuration as the backedup disk group name and same set of disks and failure group configuration, and use RMAN to restore the data. E....
 3年前weixin_30485291的博客 Spring Data JPA  Reference DocumentationOliver GierkeThomas DarimontChristoph StroblMark PaluchVersion 2.0.4.RELEASE,20180219© 20082016 The original authors. Copies of th...
 weixin_30248399的博客 In this post, I will give a list of all undocumented parameters in Oracle 12.1.... Here is a query to see all the parameters (documented and undocumented) which contain the string you enter when pro...
 4年前yy27590845的博客 The advent of the ISO/ANSI C++ standard marked the beginning of a new era for C++ programmers. The standard offers many new facilities and opportunities, but how can a realworld programmer find ...
 longyu_wlz的博客 and the latest version 2018/9/16 0:13 15 DPDK core dev@dpdk.org CONFIRMED  Kernel crash after "Detected Tx Unit Hang" report 2018/2/6 14:28 56 DPDK other dev@dpdk.org RESOLVED FIXED crash when ...
 mebaraba的博客 HOMEPAGE FAQ CONTRIBUTE BUGS QUESTIONS Git for Windows v2.22.0 Release Notes Latest update: June 8th 2019 ...These release notes describe issues specific to the Git for Windows releas...
 gaoxiangnumber1的博客 Please indicate the source: http://blog.csdn.net/gaoxiangnumber1 Welcome to my github: https://github.com/gaoxiangnumber12.1 PROCESSES In any multiprogramming system, the CPU switches from process to