我在编译一些C代码时遇到了麻烦.当我编译时,我得到这个错误:
player.c: In function ‘login’:
player.c:54:17: error: void value not ignored as it ought to be
Run Code Online (Sandbox Code Playgroud)
这是错误的代码:
static bool login(const char *username, const char *password) {
sp_error err = sp_session_login(g_sess, username, password, remember_me);
printf("Signing in...\n");
if (SP_ERROR_OK != err) {
printf("Could not signin\n");
return 0;
}
return 1;
}
Run Code Online (Sandbox Code Playgroud)
有什么方法可以绕过这种错误吗?
谢谢
编辑: 所有sp_函数都来自libspotify
我在选择6个随机朋友时遇到问题
这是我到目前为止的查询:
$result = num_rows("SELECT * FROM friends WHERE member_id = '".$_SESSION['userid']."'");
if($result >= 6) {
$f_num = 6;
} else {
$f_num = $result;
}
for($i = 1; $i <= $f_num; $i++) {
$q_get_member_friends = mysql_query("SELECT * FROM friends WHERE member_id = '".$_SESSION['userid']."' ORDER BY rand() LIMIT 1");
$r_get_member_friends = mysql_fetch_array($q_get_member_friends);
echo $r_get_member_friends['friend_with'];
}
Run Code Online (Sandbox Code Playgroud)
如果登录用户有多于或等于6个朋友,我想选择6个随机朋友
坚持这一段时间了:/
谢谢你的帮助 :)
我已经搜索了超过4个小时的关于如何在付款完成后使用PayPal进行回拨的问题.
问题是,我有一个网站销售LAN Party的门票,唯一的支付方式是PayPal.
这是我的PayPal购买按钮代码:
<form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="_MY_PAYPAL_EMAIL_">
<input type="hidden" name="item_number" value="<?php echo mktime(); ?>">
<input type="hidden" name="cn" value="<?php echo $_SESSION['userid']; ?>">
<input type="hidden" name="return" value="http://80.202.213.240/apps/tickets/buy/success/" />
<input type="hidden" name="cancel_return" value="http://80.202.213.240/apps/tickets/buy/cancelled/" />
<input type="hidden" name="notify_url" value="http://80.202.213.240/apps/tickets/buy/ipn/" />
<input type="hidden" name="lc" value="NO">
<input type="hidden" name="item_name" value="BitHack - Standard Ticket">
<input type="hidden" name="amount" value="100.00">
<input type="hidden" name="currency_code" value="NOK">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="button_subtype" value="Tickets">
<input type="hidden" name="add" value="1"> …Run Code Online (Sandbox Code Playgroud) 我遇到了一些麻烦 in_array()
$list = array(
"files/" => "/system/application/files/_index.php",
"misc/chat/" => "/system/application/misc/chat/_index.php"
);
Run Code Online (Sandbox Code Playgroud)
我有这个$_GET['f']持有字符串files/.
如何在数组中搜索可能的匹配?
如果在数组中找到该字符串,则应包含该文件
谢谢你的帮助 :)
当我有8GB可用时,我的虚拟内存不会高于2GB.
我正在运行安装了Java JRE 1.6_25的Ubuntu 10.10 x86.
当我尝试启动.jar文件时,它只会立即崩溃.
当我将VM设置为时,它工作正常.2048M
这些是我用来定义VM的参数-Xmx4096M -Xms4096M
感谢任何帮助:)