我的包需要ggplot2包,但是我无法修复运行R CMD检查时得到的以下注释.
no visible global function definition for qplot
'library' or 'require' call not declared from: ggplot2
Run Code Online (Sandbox Code Playgroud)
我也有一个.onLoad函数,
.onLoad <- function(libname, pkgname){
.libPaths("~/RLibrary")
require(ggplot2)
}
Run Code Online (Sandbox Code Playgroud)
有关如何解决错误的任何建议?我应该在哪里放置onLoad功能?
谢谢
圣
NSString *s1 = @"string1";
// NSString *s2 = [[NSString alloc]stringWithFormat:@"string2"];
NSString *s2 = [[NSString alloc] initWithFormat:@"string2"];
Run Code Online (Sandbox Code Playgroud)
我知道这是非常基本的概念,但我并不是100%清楚这一点.
第一个不分配内存地址,发送一个分配内存地址...第二个增加变量的引用计数但不增加第一个...尽管我理解这个概念但不知道情况当我应该使用第一个或第二个..
我什么时候应该使用第一个?还应该什么时候用于第二个?
提前致谢..
我在SQL Server Management Studio中使用以下连接字符串.它无法连接:
mycomputer.test.xxx.com:1234\myInstance1
但是下面的一个是好的:
mycomputer.test.xxx.com\myInstance1
那么如何在连接字符串中指定端口号?
我想编写并执行一个将执行多个其他.sql文件的mysql .sql文件.我正在寻找与Oracle相当的东西:
@script1.sql
@script2.sql
@script3.sql
Run Code Online (Sandbox Code Playgroud)
MYSQL有命令吗?
我们可以用Java调用Windows cmd命令吗?例如,在Java程序中调用Windows的"解压缩"命令.这会很困难吗?
我正在通过Gmail SMTP服务器从PHP发送电子邮件.我一直在使用带有SMTP设置的CakePHP电子邮件组件.我最初使用SSL通过端口465工作正常,但发现我的网站主机不允许超过465的传出流量.但他们确实告诉我允许通过端口587的传出连接.
在阅读http://mail.google.com/support/bin/answer.py?answer=13287之后,我认为这就像更改端口号和协议一样简单,但我无法让它工作.
令人讨厌的代码行似乎是一个fsockopen调用:
fsockopen("ssl://smtp.gmail.com", 465, $errNum, $errStr, 30); // WORKS
fsockopen("tls://smtp.gmail.com", 587, $errNum, $errStr, 30); // FAILS
Run Code Online (Sandbox Code Playgroud)
给出的错误是:
Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number in Command line code on line 1
Warning: fsockopen(): Failed to enable crypto in Command line code on line 1
Warning: fsockopen(): unable to connect to tls://smtp.gmail.com:587 (Unknown error) in Command line code on line 1
Run Code Online (Sandbox Code Playgroud)
这是PHP 5.3,phpinfo显示OpenSSL已启用.任何帮助将不胜感激.
如何在XCode中屏蔽不需要的"死店"警告?这就是我有这个代码,我不认为这是一个问题,所以如果是这种情况我不想继续看到警告......(欢迎提供反馈)
代码在这里:
// Position and Size Labels in Cell
CGFloat currVertPos = 0; // Maintain lowest position, i.e. starting vertical point for next cell
// Set Position & Get back next veritical position to use
currVertPos = [self resizeLabel:_mainLabel atVertPos:currVertPos];
currVertPos = [self resizeLabel:_mainLabel2 atVertPos:currVertPos];
currVertPos = [self resizeLabel:_mainLabel3 atVertPos:currVertPos];
currVertPos = [self resizeLabel:self.secondLabel atVertPos:currVertPos]; // WARNING OCCURS HERE
Run Code Online (Sandbox Code Playgroud)
警告详细信息=永远不会读取存储在"currVertPos"处的值.
所以对于最后一行来说,确实不需要"currVertPos",但这真的很重要,如果不是,我怎么能使警告静音?
我有一个模型,PointOfContact其中has_many Systems.从Systems侧面我想要识别PointOfContact为technical_manager或project_manager(或两者).虽然仍然只PointOfContact在DB中保留1次.
我的尝试如下:
class System < ActiveRecord::Base
belongs_to :project_manager, :class_name => 'PointOfContact'
belongs_to :technical_manager, :class_name => 'PointOfContact'
end
class PointOfContact < ActiveRecord::Base
has_many :systems
end
Run Code Online (Sandbox Code Playgroud)
当我运行我的规范(示例如下)时,我可以正确地创建System联系点关联.但是,PointOfContact它并不知道它与System的关联.这是为什么?
@sys = System.create
@tm = PointOfContact.create
@pm = PointOfContact.create
@sys.project_manager = @pm
@sys.technical_manager = @tm
@pm.systems.should have(1).items #> expected 1 items, got 0
Run Code Online (Sandbox Code Playgroud) int foo (int a , int b = 0)
Run Code Online (Sandbox Code Playgroud)
我刚读了这段代码.我不明白"= 0"是什么意思?
我也想知道为什么int foo (int a = 0, int b)不编译.
我知道你可以拿指针,如:
someFunction(const char* &txt)
{
txt++; //Increment the pointer
txt--; //Decrement the pointer
}
Run Code Online (Sandbox Code Playgroud)
我如何回到指针的开头?(不计算我的增量数量并减少该数量)我在想类似的事情:
txt = &(*txt[0]);
Run Code Online (Sandbox Code Playgroud)
但这似乎不起作用(将指针指定到其起始位置).
任何帮助将不胜感激
布雷特