标签: error-handling

我的代码的最后一行出了什么问题?

以下代码适用于我的大学项目.当我作为网页运行时,最后一行有错误...我需要有关如何解决此问题的帮助.

<?php
include_once 'ShapeClass.php';    
class Square extends Shape
      print "<h2>This square's side is not bigger than the parallelogram's height</h2>";
   }
break;
}
?>
Run Code Online (Sandbox Code Playgroud)

php oop error-handling function

0
推荐指数
1
解决办法
61
查看次数

亵渎过滤器不起作用(PHP)

代码:

<?php
$con=mysqli_connect("mysql17.000webhost.com","login","pwd","db");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysql_connect_error();
  }

$filter = mysqli_query($con,"SELECT * FROM bad_words");

$content = mysqli_fetch_array( $filter );

$old_word = $_POST("input");
$old_word = str_ireplace($content['word'], '[foul]', $old_word);

$filtered_word = $old_word;
Print($filtered_word);

mysqli_close($con);
?>
Run Code Online (Sandbox Code Playgroud)

错误信息 :

致命错误:函数名称必须是第13行/home/a7593238/public_html/bad_filter.php中的字符串

请帮忙.

php mysql arrays error-handling function

0
推荐指数
1
解决办法
181
查看次数

获取警告"默认情况下,TimeSeries沿DataFrame索引广播已弃用"

我正在使用Python 2.7并继续得到以下错误.如果您需要完整的代码,请告诉我,但它有点长.谢谢您的帮助.

Warning (from warnings module):
  File "C:\Python27\lib\site-packages\pandas\core\frame.py", line 3619
FutureWarning)
FutureWarning: TimeSeries broadcasting along DataFrame index by default is deprecated.     
Please use DataFrame.<op> to explicitly broadcast arithmetic operations along the index
Run Code Online (Sandbox Code Playgroud)

这是班级投资组合

class Portfolio(object):
"""An abstract base class representing a portfolio of 
positions (including both instruments and cash), determined
on the basis of a set of signals provided by a Strategy."""

__metaclass__ = abc.ABCMeta

@abc.abstractmethod
def generate_positions(self):
    raise NotImplementedError("Should implement generate_positions()!")

@abc.abstractmethod
def backtest_portfolio(self):
    raise NotImplementedError("Should implement backtest_portfolio()!")
Run Code Online (Sandbox Code Playgroud)

这是在<<<< …

python error-handling module pandas

0
推荐指数
1
解决办法
2406
查看次数

标题('位置:')它无法正常工作

我试图开发一个搜索系统,我有一个问题..

我在同一目录中有一个index.php文件和一个search.php文件,我希望当用户在搜索字段中写入并提交时我想转到我的搜索页面.

但是我不明白发生了什么,因为我转到这个页面:localhost/project/tpl/search /但是一切都是白色的,我没有错误,但没有显示我的"search.php"文件的背景!

我尝试过:header('Location: http://localhost/project/tpl/search/');但我有同样的问题!

那里有人知道可能会发生什么?

 <?php
        if(isset($_POST['search']))
        {
            $search = $_POST['s'];
            $search = setUri($search);
            header('http://localhost/project/tpl/search/');
            echo $search;
        }
        ?>
             <form  name="search" method="post" >
                <input id="test" type="search" name="s" placeholder="Search..." required="required" onfocus="if(this.placeholder == 'Search...') {this.placeholder=''}" onblur="if(this.placeholder == ''){this.placeholder ='Search...'}" />
                <input type="submit" class="expand" name="search"></button>
             </form>
Run Code Online (Sandbox Code Playgroud)

我的项目文件夹在htdocs中,我的项目文件夹是这样的:

在此输入图像描述

然后search.php在tpl文件夹中,如下所示:

在此输入图像描述

php error-handling function output

0
推荐指数
1
解决办法
56
查看次数

在完成所有错误检查之前,如何防止在Go中生成输出?

可能是一个简单的问题,但我在延迟请求处理函数中的输出时遇到问题.当我执行我的模板而不是响应编写器时,我正在使用"bufio"写入,但似乎缓冲区只能在它吐出来之前保持这么多.我担心它会吐出部分页面,然后遇到错误,留下不完整和难以理解的响应.什么是确保一切都保持缓冲直到它准备好被释放到野外的最佳策略?

error-handling buffer templates go

0
推荐指数
1
解决办法
87
查看次数

错误:错误1错误LNK2019:函数___tmainCRTStartup中引用的未解析的外部符号_WinMain @ 16

我该如何解决此错误:

Error 1 error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup 
Run Code Online (Sandbox Code Playgroud)

我还定义了cai.cpp中的所有函数.但是由于代码行太多,我没有上传它.我确实将.h文件包含在cai.cpp中.我对这个错误的问题感到困惑.

main.cpp文件

#include "cai.h"

int main()
{
    CAI test;
    test.StartTest();

}
Run Code Online (Sandbox Code Playgroud)

cai.h文件

class CAI
{
public:

    void StartTest();
    bool AskRandomMultiplicationQuestion();
    bool AskRandomDivisioQuestion();


private:
    void PrintRandomGoodJob();
    void PrintRandomEncouragementMessage();
    int ChooseRandomNumber();
    void PrintTestSummary(int, int, int);

};
Run Code Online (Sandbox Code Playgroud)

c++ error-handling linker-errors

0
推荐指数
1
解决办法
1万
查看次数

数组工作在localhost但不在服务器上

我正在开发一个客户端调查应用程序,我需要从我的服务器中获取大量的图像和ID,我以阵列格式从我们站点的rails控制台获取了我的图像.

我的代码是

<?php
$links=[[64, "https://oyo-dev.s3.amazonaws.com/uploads/hotel_image/9/photo__4_.jpg"], [63, "https://oyo-dev.s3.amazonaws.com/uploads/hotel_image/9/photo__1_.jpg"], [62, "https://oyo-dev.s3.amazonaws.com/uploads/hotel_image/9/photo__2_.jpg"], [61, "https://oyo-dev.s3.amazonaws.com/uploads/hotel_image/9/photo__7_.jpg"], [60, "https://oyo-dev.s3.amazonaws.com/uploads/hotel_image/9/photo__5_.jpg"]; //and 200  more images//

$n=(count($links));

for($i=0;$i<=$n;$i++)
{
    echo $links[$i][0].'->'.$links[$i][1]."<br/>";
}
?>
Run Code Online (Sandbox Code Playgroud)

它在我的本地主机上运行很酷但是当我推送到服务器时它显示错误

"解析错误:语法错误,意外'['在第25行的/srv/disk4/1225087/www/dcvit.co.nf/survey.php"

php arrays error-handling parsing

0
推荐指数
1
解决办法
211
查看次数

Excel VBA - 是否可以在出错时调用sub?

我一直在寻找,但我找不到能回答这个问题的东西.

我收到了一个错误,我知道它是什么造成的,这不是一个真正的问题.如果发生此错误,它只需要在运行下一行代码之前运行另一个子代码.所以这让我想知道:

有可能做这样的事情:

On Error Call Sheet1.TestSub
Run Code Online (Sandbox Code Playgroud)

提前致谢!

error-handling excel vba excel-vba

0
推荐指数
1
解决办法
1万
查看次数

我的java编码与数字和字符串有问题

我尝试使用netbeans开发一个java程序,其中GUI接受来自五个文本字段的主题标记,并在各自的文本字段中显示总标记,百分比和等级.问题是我在执行GUI时遇到错误.我尝试用double替换int来保存百分比的百分比,但这没有帮助.我无法找到任何错误,因为我是初学者,我无法理解我的netbeans在监视器中给出的错误.请帮忙.

ERRORS: Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For input string: "           34"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:481)
    at java.lang.Integer.parseInt(Integer.java:527)
    at NewJFrame.submit_buttonActionPerformed(NewJFrame.java:173)
    at NewJFrame.access$000(NewJFrame.java:4)
    at NewJFrame$1.actionPerformed(NewJFrame.java:60)
Run Code Online (Sandbox Code Playgroud)

这是我做过的编码.

        int sub1_ = Integer.parseInt(sub1.getText());
    int sub2_ = Integer.parseInt(sub2.getText());
    int sub3_ = Integer.parseInt(sub3.getText());
    int sub4_ = Integer.parseInt(sub4.getText());
    int sub5_ = Integer.parseInt(sub5.getText());

    // Here each subject holds a max. of 100 marks.

    int a = sub1_+sub2_+sub3_+sub4_+sub5_;
    total_marks.setText(""+a);

    // Since each subject holds a max. of 100 marks, the total marks of five subjects sums up to 500. …
Run Code Online (Sandbox Code Playgroud)

java error-handling double integer if-statement

0
推荐指数
1
解决办法
231
查看次数

直接发送字符串比将字符串指针发送到函数有什么区别?

直接发送字符串比将字符串指针发送到函数有什么区别?

例如:

void foo(char * a){//suppose foo reads and/or writes to the passed string
    ...
}

int main(){
    foo("asdf");//what is the difference between this

    char a[]="asdf";
    foo(a);//and this?
}
Run Code Online (Sandbox Code Playgroud)

第一个我得到各种访问违规错误,而第二个我没有,所以这两者有什么区别?

c syntax error-handling

0
推荐指数
1
解决办法
61
查看次数