syntax-error

Nesting an object in a class [closed]

吃可爱长大的小学妹 提交于 2019-12-13 22:23:26
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Using C++ I'm trying to nest an object of one class inside another class and I get a syntax error on line 6 of CarpetClass.h that says Error: fuction "Rectangle" is not a type name myclass.h class Rectangle{ private: double length; double width; public: void setLength(double len){ length = len; } void setWidth

null pointer exception error using action listener

百般思念 提交于 2019-12-13 22:11:54
问题 I'm getting the error message null pointer exception on the line img.setIcon(bg); in the controller class in my action listener and I'm not sure why. I've commented where the error is highlighted. Any ideas on why? public class Display { public ImageIcon bg; public JLabel img; public void UI() { Controller listener = new Controller(); bg = new ImageIcon("prophase.png"); img = new JLabel(bg, JLabel.CENTER); JFrame gameFrame = new JFrame(); JPanel top = new JPanel(); JPanel bottom = new JPanel(

Rectangle Class for BlueJ

左心房为你撑大大i 提交于 2019-12-13 22:11:20
问题 I am trying to write code for a rectangle class in BlueJ. When I compile my code I get the error "constructor Rectangle in class Rectangle cannot be applied to given types; required: no arguments; found: int, int, int, int; reason: actual and formal argument list differ in length". Also, I am confused on where to put the formula for a rectangle - width x height. I am trying to create class called rectangle that I could use in another class called picture. I am trying to use this class to make

MySQL compatibility

人走茶凉 提交于 2019-12-13 21:17:08
问题 I have a script that I got online that I wanted to try out. Everything has worked so far except for the last step which is to import a .sql file using phpmyadmin. The .sql script is CREATE TABLE lil_urls ( id varchar(255) NOT NULL default '', url text, date timestamp(14) NOT NULL, PRIMARY KEY (id) ) TYPE=MyISAM; My server version is 5.5.34-cll - MySQL Community Server (GPL) The error I get says #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL

mysql create procedure syntax issue line 1

懵懂的女人 提交于 2019-12-13 19:55:14
问题 I get a syntax error on line 1 of the following procedure: DELIMITER | CREATE PROCEDURE sp_autocallFillCallQueue BEGIN DECLARE maxCalls TINYINT(1); SELECT autocall_maxCalls INTO maxCalls FROM `options` LIMIT 0,1; REPEAT INSERT INTO `callQueue` (`phoneNumber`, 'waiting') SELECT `phoneNumber` FROM `phoneNumbers` WHERE `accessRestriction` != 'blacklist' && `flagAutocall` = 1; SET maxCalls = maxCalls - 1; UNTIL maxCalls = 0 END REPEAT; END; | I am setting the delimiter before and after this. I

Activating virtualenv from within Python script

不羁的心 提交于 2019-12-13 18:49:51
问题 I am trying to activate my virtualenv (already existing) using the following python code: Test.py import os, sys filename = "activate" exec(compile(open(filename, "rb").read(), filename, 'exec'), globals, locals) print(os.system('pwd')) if hasattr(sys, 'real_prefix'): print('success') else: print('failed') I then run this script via the terminal: python Test.py which then produces this error: Traceback (most recent call last): File "activate_this.py", line 3, in <module> exec(compile(open

Why my rules of bison don't work

余生颓废 提交于 2019-12-13 18:41:26
问题 Every time I run my parser, it will appear "syntax error in line 1 near <>" (Because there is a subroutine yyerror(char *s)). I think that's because there is something wrong with my rules in bison. The file (c17.isc) I want to parse. *c17 iscas example (to test conversion program only) *--------------------------------------------------- * * * total number of lines in the netlist .............. 17 * simplistically reduced equivalent fault set size = 22 * lines from primary input gates .......

windows “.lnk” shortcuts and batches don't mix

血红的双手。 提交于 2019-12-13 16:25:44
问题 I have a batch file which is used by dragging a folder containing .mp3s into the batch. @echo off cd %~dp0 setlocal enabledelayedexpansion enableextensions set FLDR="%1" if not defined FLDR ( echo Drag a folder to the batch to play its contents. pause goto:EOF ) for %%x in (%FLDR%\*.mp3) do set "MP3=!MP3! "%%x"" mp3player %MP3% pause It works fine with actual folders, but when dragging shortcuts, the variable %FLDR% ends up as "c:\link location\folder.lnk" instead of the actual folder

Lisp - replace all the appereances of an element in a list [duplicate]

孤人 提交于 2019-12-13 15:21:54
问题 This question already has answers here : Common lisp error: “should be lambda expression” (4 answers) Closed 2 years ago . I try to replace a certain element E in a list with another list K at all the main list levels. (defun replaceList(l e k) (cond ((null l) nil) ((equal e (car l)) (cons k (replaceList (cdr l) e k))) ((listp (car l)) ((equal e (car (car l))) (cons k (replaceList (cdr (car l)) e k)))) (t (cons (car l) (replaceList (cdr l) e k))))) Example: (replaceList '(3 1 2 (6 1) 7 (5 (5

Strange C++ compile error with valarrays

半城伤御伤魂 提交于 2019-12-13 14:47:22
问题 I have a strange compile error using valarrays in C++. This is a stripped down version of my code: #include <iostream> #include <valarray> using namespace std; bool test(const int &x,const valarray<int> &a,const valarray<int> &b) { return a*x==b; } int main() { int a1[3]= {1,2,3}; int b1[3]= {2,4,6}; valarray<int> a(a1,3); valarray<int> b(b1,3); int x=2; cout<<test(x,a,b); return 0; } Expected behavior: outputs some variant of true or 1 The compile error (using g++): main.cpp: In function