我有一个以下的html片段:
<div onClick="javascript:getComments(this);" store-id="143568" class="CountryRow" style="padding: 4px;"><div class="flag flag_az"></div> Azerbaijan</div>
Run Code Online (Sandbox Code Playgroud)
我想创建一个jquery函数来获取值store-id.我有以下但是它不起作用:
getComments = function(input) {
fValue = $(input).val( $(input).attr("store-id") );
alert('the ID :'+fValue);
}
Run Code Online (Sandbox Code Playgroud)
有人能够善意地告诉我,我做错了什么.
我有以下代码:(注意:newsImageURL是NSArray)
NSString *imagesURL = @"http://aud.edu/images/newsimage01.png,http://aud.edu/images/newsimage04.png,http://aud.edu/images/newsimage02.png,http://aud.edu/images/newsimage03.png,http://aud.edu/images/newsimage01.png,http://aud.edu/images/newsimage04.png,http://aud.edu/images/newsimage01.png,http://aud.edu/images/newsimage04.png,http://aud.edu/images/newsimage01.png,http://aud.edu/images/newsimage04.png,";
newsImageURL = [[NSArray alloc] initWithArray:[AllNewsHeadLine componentsSeparatedByString:@","]];
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用以下代码将这些图像加载到单元格中:
NSData* imageData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString: [newsImageURL objectAtIndex:indexPath.row]]];
cell.image = [UIImage imageWithData:imageData];
Run Code Online (Sandbox Code Playgroud)
相反,当我使用此行时,图像加载正常:
cell.image = [UIImage imageNamed:@"imagename.png"];
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
我创造了一个box2d世界,我想限制世界的高度.我确实搜索了谷歌,显然在之前版本的box2d中有一个选项,你必须定义你的世界的大小,但我不确定你是否能够设置世界的高度,但在当前版本中他们有完全关闭了该选项.
所以我只是想找到一种方法来限制高度,因为我的球员是一个上下跳跃的球,我想限制它能跳多高(跳跃是由物理和重力以及球的速度完成的经过几次良好的跳跃之后,随着速度的增加,球跳得非常高,我不想限制速度)并且让边界说出来y=900.
我有一个Form1和我添加的另一个.Form1正在由program.cs在开始时运行.我需要通过按下按钮来隐藏Form1和显示options表格.
private void submitPassword_Click(object sender, EventArgs e)
{
options optionForm = new options();
optionForm.Show();
}
Run Code Online (Sandbox Code Playgroud)
上面的代码在顶部打开选项表单,但我需要它来替换当前表单.我该怎么做到这一点?
我知道标题可能不清楚,我为此道歉.所以我在visual studio中有2个表单,在第一个表单中用户登录到系统,第二个表单是其他一切发生的地方.
我已经调用了info以第一种形式调用的类,并且该类负责收集用户信息并检查登录等.当用户登录系统时,该类获取用户ID并将其存储到私有字符串中.从那里程序进入第二种形式.
现在这里是我的问题,我如何使这个类全局,所以我可以从第二个表单访问存储的userID?我可以创建另一个类(info myinfo = new info())的实例吗?
PS我是面向对象概念的新手,所以请用户轻松的条款.
我有以下PHP代码:
$db_host = "localhost";
$db_user = "root";
$db_pass = "";
$db_name = "photos";
define(DB_SERVER,$db_host);
define(DB_USER,$db_user);
define(DB_PASS,$db_pass);
define(DB_NAME,$db_name);
Run Code Online (Sandbox Code Playgroud)
DB_SERVER正如您在上面所见,我正在定义和所有其他的,但由于某种原因,我得到以下错误:
Notice: Use of undefined constant DB_SERVER - assumed 'DB_SERVER' in /Users/ahoura/Sites/photos/include/config.php on line 34 Notice: Use of undefined constant DB_USER - assumed 'DB_USER' in /Users/ahoura/Sites/photos/include/config.php on line 35 Notice: Use of undefined constant DB_PASS - assumed 'DB_PASS' in /Users/ahoura/Sites/photos/include/config.php on line 36 Notice: Use of undefined constant DB_NAME - assumed 'DB_NAME' in /Users/ahoura/Sites/photos/include/config.php on line 37
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么!?!?!
我想比较一个字符串和一个像下面的字符:
char filter = " " // <<== this is a tab space, so I am assuming its one char
if ( line[counter] == filter[0]){
}
Run Code Online (Sandbox Code Playgroud)
注意,行等被定义一个正常的字符串:string line;.由于某种原因,即使没有语法错误,该语句也永远不会成立.
UPDATE
内线是:
string line = "1 90 74 84 48 76 76 80 85";
第二次更新
这是我写的完整函数:
void getResults(string line){
int tmpSize = line.length();
int counter = 0;
int tmpCounter = 0;
while(counter != MAX_No_Of_Grades){
if(line[counter] == '\t\t'){
counter++;
}else{
cout << tmpCounter << ". this is : " << line[tmpCounter] …Run Code Online (Sandbox Code Playgroud) 我想知道如何在我的perl设置中添加一个新目录,以便搜索要包含的模块?
当我运行这一行时:
perl -w /var/www/cgi-bin/upload.cgi
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
Can't locate config.pm in @INC (@INC contains: . /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8) at /var/www/cgi-bin/upload.cgi line 5.
BEGIN failed--compilation aborted at /var/www/cgi-bin/upload.cgi line 5.
Run Code Online (Sandbox Code Playgroud)
我搜索了Google,显然我应该将其/var/www/cgi-bin作为文件夹包含在内,以便Perl可以找到并包含它.
更多信息
以下是该计划的前几行:
use strict;
use lib '.';
use XFSConfig; #this was fixed by using -I command line switch
use XUpload; # this returns as an error!!!
use CGI::Carp qw(fatalsToBrowser);
use CGI;
use LWP::UserAgent;
Run Code Online (Sandbox Code Playgroud) 我在我的网站上添加了"AddThis",这是我使用过的代码:
<!-- AddThis Button BEGIN -->
<a class="addthis_button_facebook_like" addthis:url="http://facebook.com/MySpills" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4fabf4922f71c398"></script>
<!-- AddThis Button END -->
Run Code Online (Sandbox Code Playgroud)
现在出于某种原因,每次我去网页时都会出现这个问题:
http://domain/page#.T7FTDJ8ti28
Run Code Online (Sandbox Code Playgroud)
的#.T7FTDJ8ti28变化我每次刷新页面,我担心这可能混淆谷歌或其他搜索引擎.它也只是在URL中看起来不太好,所以我怎么能摆脱它?
我正在尝试使用以下代码逐行读取文件:
void main()
{
cout << "b";
getGrades("C:\Users\TOUCHMATE\Documents\VS projects\GradeSystem\input.txt");
}
void getGrades(string file){
string buf;
string line;
ifstream in(file);
if (in.fail())
{
cout << "Input file error !!!\n";
return;
}
while(getline(in, line))
{
cout << "read : " << buf << "\n";
}
}
Run Code Online (Sandbox Code Playgroud)
由于某种原因,它不断返回"输入文件错误!!!".我已尝试完整路径和相对路径(通过使用文件的名称,因为它位于与项目相同的文件夹中).我究竟做错了什么?