我正在将网站移动到新服务器,我现在收到此错误!
警告:
session_start()[function.session-start]:无法发送会话缓存限制器 - 已在第5行发送的标头(输出从/home/com10002/public_html/bank/index.php:29 开始)/home/com10002/public_html/bank/includes/quickform.php
我已经把session_start()它放在顶部,但它仍然无法在谷歌Chrome浏览器中使用!我猜它与Captcha有关,但它在旧服务器上工作正常!
我正在学习Perl,同时我正在为我的家庭活动创建一个程序,但是当我尝试使用随机化过程的数组时,我遇到了一些错误,你可以看到:
[ubuntu@eeepc:~/Desktop/mail] ./get.pl -h pop.vix.terra.com.br -u nathanpc -p (:D)
Global symbol "$random_name" requires explicit package name at ./get.pl line 17.
Execution of ./get.pl aborted due to compilation errors.
[ubuntu@eeepc:~/Desktop/mail]
Run Code Online (Sandbox Code Playgroud)
我的代码是这样的:
#!/usr/bin/perl
# import packages
use Net::POP3;
use Getopt::Long;
use Mail::Message;
use List::Util qw(shuffle);
use strict;
use warnings;
# Variable declaration
my $host;
my $user;
my $pass;
my $email_file;
my $msg;
my @array = shuffle(<$random_name>);
# read command line options
# display usage message in case of error
GetOptions ('h|host=s' => …Run Code Online (Sandbox Code Playgroud) 我过去一直在使用矢量,我对它们非常熟悉.我听说ArrayLists更快更灵活.我是使用ArrayLists和Java Generics的新手.我目前正在使用它们如下并接收有关参数化的警告(我认为我通过声明它们来做到了这一点<String>.
ArrayList<String> arrayList = new ArrayList <String> ();
...
//then within a method
arrayList.add(file.getName()); //<-This line triggers the warning.
Run Code Online (Sandbox Code Playgroud)
我在网上发现,可以通过抑制方法中的警告来避免这种情况,如下所示.但是,这是一个解决方法,我宁愿了解arraylists如何正常工作和使用它们,而不是禁止警告错误地使用它们.
@SuppressWarnings("unchecked")
Run Code Online (Sandbox Code Playgroud)
并且,如果有关于使用ArrayLists的某种约定或标准,我也很想了解这些.
编辑: 我收到的警告如下:类型安全:方法add(Object)属于原始类型ArrayList.应该参数化对泛型类型ArrayList的引用
大家好!我正在尝试创建一个内存管理系统,以便用户可以调用myMalloc,这是我创建的一个方法.我有一个链表,跟踪我的空闲记忆.我的问题是当我试图在链表中找到空闲位的结尾时.我试图将该部分中的内存大小(在链接列表中)添加到指向可用空间前面的指针,就像这样.
void *tailEnd = previousPlace->head_ptr + ((previousPlace->size+1)*(sizeof(int));
Run Code Online (Sandbox Code Playgroud)
我希望这会给我一个指向该段末尾的指针.但是,我一直收到警告:
"算术中使用的'void*'类型的指针"
有没有更好的方法呢?谢谢!
我有一个问题是我得到的警告信息.对于这一行,使用qsort库函数:
qsort(catalog, MAX ,sizeof catalog, struct_cmp_by_amount);
Run Code Online (Sandbox Code Playgroud)
我收到这个警告:
警告:传递'qsort'的参数4使得指针来自整数而没有强制转换
编辑:
struct_cmp_by_amount是程序中的以下函数.(--->)catalog是一个struct,MAX定义为100
但是,对于具有相同代码的另一个程序,具有完全相同的struct_cmp_by_amount函数,我不会得到第4个参数的警告!
编辑:我也必须说,在这两个程序我没有使用功能的原型!但对于第二个程序,它通常与第一个程序相反.
qsort(structs, structs_len, sizeof(struct st_ex), struct_cmp_by_amount);
Run Code Online (Sandbox Code Playgroud)
编辑:
st_ex是一个结构
struct st_ex structs[]={./*elements*/..}
size_t structs_len = sizeof(structs) / sizeof(struct st_ex);
int struct_cmp_by_amount(const void *a, const void *b)
{
struct catalogue *ia = (struct catalogue *)a;
struct catalogue *ib = (struct catalogue *)b;
return (int)(100.f*ia->amount - 100.f*ib->amount);
}
Run Code Online (Sandbox Code Playgroud)
我在徘徊为什么会发生这种情况.你有什么想法吗?
在我的代码中,我使用的xyz是10个对象的数组.当我尝试使用unsigned int index访问数组元素时xyz[level],我得到'Buffer overrun '警告.从逻辑上讲,我很确定该级别不会超过10.如何避免此警告?
我不断收到此警告警告:传递'CGPathMoveToPoint'的参数1会丢弃指针目标类型的限定符
我正在调用这个函数
const CGAffineTransform m = CGAffineTransformIdentity;
CGPathMoveToPoint(path, &m , nextPos.x, nextPos.y);
Run Code Online (Sandbox Code Playgroud)
我已经试过了
CGPathMoveToPoint(path, NULL , nextPos.x, nextPos.y);
Run Code Online (Sandbox Code Playgroud)
要么
CGAffineTransform m = CGAffineTransformIdentity;
CGPathMoveToPoint(path, &m , nextPos.x, nextPos.y);
Run Code Online (Sandbox Code Playgroud)
但我总是得到这个错误,我怎么摆脱它?
当我写了下面,我得到这样的警告,它不匹配任何东西,但我敢肯定,这$row_search['content']包含$value...
preg_match_all("/[^\s]*".preg_quote($value)."[^\s]*/iu", $row_search['content'], $final_matched);
WARNING:preg_match_all() [function.preg-match-all]: Unknown modifier '/' in C:\xampp\htdocs\finance\search\search.php on line 82
Run Code Online (Sandbox Code Playgroud)
为什么我收到这样的警告信息?
谢谢
我有这个代码
#include <iostream>
using namespace std;
class time{
public:
time(); //constructor
void settime(int,int,int);
void print();
private:
int hour,min,sec;
};
//constructor
time::time(){
hour=min=sec=0;
}
int main(){
int num;
time t1;//line1
time t2;//line2
cout<<"hello"<<endl;
cin>>num;
return 0;}
Run Code Online (Sandbox Code Playgroud)
这些行中的错误是:
预期`;' 在"t1"之前
[警告]声明是一个参考,而不是调用,以函数"时间"
对于每一行
有什么问题???
我从我的主要Perl程序调用以下脚本.该脚本采用进程名称并返回其PID.该脚本包含在我的主要perl代码中,使用require关键字:
require "getPid.pl";
Run Code Online (Sandbox Code Playgroud)
并使用:
&pidGetter($processName);
Run Code Online (Sandbox Code Playgroud)
getPid.pl是:
#!/usr/bin/perl -w
use strict;
use warnings;
use Proc::ProcessTable;
pidGetter($ARGV[0]);
sub pidGetter
{
my $ret="PROCESS ID NOT FOUND\n";
my $t = new Proc::ProcessTable;
my $procName = $_[0];
foreach my $p (@{$t->table})
{
if ($p->fname =~ /$procName/)
{
$ret = $p->pid;
}
}
return $ret;
}
Run Code Online (Sandbox Code Playgroud)
但是,当调用脚本时,我收到以下警告:
在getPid.pl第19行的regexp编译中使用未初始化的值$ procName
脚本的其余部分似乎运行正常.我的理解是$ procName由$ procName =&_ [0]初始化;
我已将print语句放入调试中,并$procName确实返回一个值,因此它已初始化.有谁知道为什么我收到这些警告?