尝试将Node.js应用程序部署到heroku但是在使用时
git push heroku master
我获得了以下跟踪(仅显示了整个跟踪的一部分,但它是我认为是问题的部分 - 如果不让我知道的话):
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: Some possible problems:
remote:
remote: - Dangerous semver range (>) in engines.node
remote: https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:
remote: Love,
remote: Heroku
remote:
remote:
remote: ! Push rejected, failed to compile Node.js app
Run Code Online (Sandbox Code Playgroud)
package.json文件适用于其他人的heroku,所以这似乎不是问题.
任何想法让我知道.
谢谢
好吧基本上我正在尝试编写一个GUI应用程序,在其主窗口中绘制2个圆圈和2个矩形.我试图得到它,以便每当用户在圆圈或矩形内点击时,该特定圆或矩形变为另一种随机颜色.
目前我已经得到它,以便MouseClick事件(屏幕上的任何地方)导致所有的圆形或矩形将颜色改变为相同的颜色.这是我到目前为止所得到的:
import java.awt.Color;
import java.awt.Graphics;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Point;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.Random;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class Question2 {
public static void main(String[] args) {
SecondFrame f = new SecondFrame("Draw and Fill");
f.init();
}
}
class SecondFrame extends JFrame{
SecondFrame(String title) {
super(title);
}
private JPanel mainPanel;
private GridBagConstraints gbc = new GridBagConstraints();
private GridBagLayout gbLayout = new GridBagLayout();
void init() {
mainPanel = new JPanel();
mainPanel.setLayout(gbLayout);
this.setExtendedState(JFrame.MAXIMIZED_BOTH);
this.setContentPane(mainPanel);
gbc.gridheight = …Run Code Online (Sandbox Code Playgroud) 所以我在JPanel中绘制了一个图像,它本身被添加到JFrame中.但是,当第一次绘制图像时,它看起来非常小.我不确定这是面板的问题还是图像有问题.如下图所示:![在此处输入图像说明] [1]
我在图像周围画了一个矩形.
现在JPanel应该包含在JFrame中.如上所示,JFrame不应该被着色.JPanel的大小约为JFrame的四分之一,图像应该占据几乎所有的JPanel.
你能告诉我这是问题的形象还是小组.对不起,如果它显而易见.
等待SSCCE
我正在用方案编码一个函数,但我收到一个“应用程序:不是过程;期望一个可以应用于参数的过程”错误。我假设我没有正确使用条件语句:
(define find-allocations
(lambda (n l)
(if (null? l)
'()
(cons ((if (<=(get-property (car l) 'capacity) n)
(cons (car l) (find-allocations (- n (get-property (car l) 'capacity)) (cdr l)))
'()))
(if (<=(get-property (car l) 'capacity) n)
(cons (car l) (find-allocations (n (cdr l))))
'())))))
Run Code Online (Sandbox Code Playgroud)
如果有人能指出我的错误,将不胜感激。