我最近重建了我的网站,现在我收到了这个错误:
警告:mysql_result():提供的参数不是28行/home/xx/public_html/asdf.com/comsel.php中的有效MySQL结果资源
警告:mysql_result():提供的参数不是第29行/home/xx/public_html/asdf.com/comsel.php中的有效MySQL结果资源
警告:mysql_result():提供的参数不是第30行/home/xx/public_html/asdf.com/comsel.php中的有效MySQL结果资源
警告:mysql_result():提供的参数不是31行/home/xx/public_html/asdf.com/comsel.php中的有效MySQL结果资源
这些行如下:
mysql_connect($dbhost,$dbuser,$dbpass)
or die("Error: Failed to connect to database");
mysql_select_db($dbname)
or die("Error: Failed to select databse");
$query = "SELECT * FROM foxlose ORDER BY RAND ( ) LIMIT 1";
$result = mysql_query($query);
$title = mysql_result($result,$i,"title");
$link = mysql_result($result,$i,"link");
$nomen = mysql_result($result,$i,"name");
$text = mysql_result($result,$i,"text");
mysql_close();
Run Code Online (Sandbox Code Playgroud)
mysql_close()之前的最后四行; 是28-31行.
只有这里的东西:我的网站的旧版本中的那些行是相同的,他们工作.我无法弄清楚改变了什么.当我将计算机用作服务器并在本地托管时,代码也能正常工作.
知道这个错误试图告诉我的是什么吗?
编辑:添加文档中的所有mysql.
我使用以下代码运行"ls -l ./"并将结果放在暂存缓冲区中.
(start-process "my-process" "*scratch*" "ls" "-l" "./")
Run Code Online (Sandbox Code Playgroud)
现在,每当我使用svn进行提交时,我都使用-m选项输入修订的日志注释.但是,如果我长期从事修订工作,我可能会忘记这些事情.有没有办法在修改时为修订标记注释,这样我在提交时就不必输入它们了?
我不是软件人,但我真的可以使用一些建议.
我正在编写一个C程序(在下面剪切/粘贴)以建立从我的Mac Pro到基于Windows XP的测试仪器的TCP套接字连接,该测试仪器通过LAN(以太网)坐在它旁边.该程序编译时没有任何警告或错误.但是使用GNU Debugger执行代码,我可以看到它在'exit(2)'退出,即"if(connect(MySocket"行).没有超时,它只是立即退出.
我编译使用:gcc -g -Wall talk2me.c -o talk2me但我没有在输出中得到任何提示,也没有调试到可能是什么问题.
我确定10.0.1.100和端口5025是正确的(使用Matlab代码我可以使用这些参数进行良好的通信).知道我还有什么地方可以调试吗?
在代码本身之外,是否还需要满足任何其他要求(可能是系统级)(比如从某个目录运行代码,或者在unix中设置参数以允许连接等)?我可能是一个显而易见的东西,因为我是一个硬件人,所以请随意假设我做了一些愚蠢的事情.我可以运行'hello world'程序,它有帮助.提前谢谢,ggk
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <netinet/tcp.h>
#include <netinet/in.h>
#include <arpa/inet.h> //for inet_addr
#include <unistd.h> // for function 'close'
int main(void)
{
int MySocket;
if((MySocket=socket(PF_INET,SOCK_STREAM,0))==-1) exit(1);
struct in_addr {
unsigned long s_addr;
};
struct sockaddr_in {
short int sin_family; // Address family
unsigned short int sin_port; // Port number
struct in_addr sin_addr; // Internet address
unsigned char sin_zero[8]; // Padding
};
struct sockaddr_in MyAddress;
// …Run Code Online (Sandbox Code Playgroud) 我的问题是在GLSL着色器中可以访问多个纹理.这是我正在做的事情:
着色器:
uniform sampler2D sampler0;
uniform sampler2D sampler1;
uniform float blend;
void main( void )
{
vec2 coords = gl_TexCoord[0];
vec4 col = texture2D(sampler0, coords);
vec4 col2 = texture2D(sampler1, coords);
if (blend > 0.5){
gl_FragColor = col;
} else {
gl_FragColor = col2;
}
};
Run Code Online (Sandbox Code Playgroud)
因此,我只需根据统一变量在两个颜色值之间进行选择.足够简单(这是一个测试),但是当混合<= 0.5时,我得到全黑,而不是预期的行为.
OpenGL代码:
m_sampler0location = m_shader.FindUniform("sampler0");
m_sampler1location = m_shader.FindUniform("sampler1");
m_blendlocation = m_shader.FindUniform("blend");
glActiveTexture(GL_TEXTURE0);
glEnable(GL_TEXTURE_2D);
m_extensions.glUniform1iARB(m_sampler0location, 0);
glBindTexture(GL_TEXTURE_2D, Texture0.Handle);
glActiveTexture(GL_TEXTURE1);
glEnable(GL_TEXTURE_2D);
m_extensions.glUniform1iARB(m_sampler1location, 1);
glBindTexture(GL_TEXTURE_2D, Texture1.Handle);
glBegin(GL_QUADS);
//lower left
glTexCoord2f(0, 0);
glVertex2f(-1.0, -1.0);
//upper left …Run Code Online (Sandbox Code Playgroud) 我有两个元素,每个元素都有一个类名.在某些事件上,我希望他们换班.
所以基本上我想做这样的事情:
$("#div1").switchClassWith("#div2");
<div id="div1" class="someStylingClass">...content...</div>
<div id="div2" class="someOtherClass">...content...</div>
Run Code Online (Sandbox Code Playgroud)
这将导致#div1拥有someOtherClass其类名,并#div2有someStylingClass......任何建议?
我从eclipse导出了一个apk.如果我将它复制到手机的SD卡,我可以毫无问题地安装它.
当试图通过手机(Galaxy S)浏览器下载时,我得到:"下载失败".
我在mime.types中设置了mime类型的application/vnd.android.package-archive,重启了apache,结果仍然相同.还尝试过:
<a href="downloads/my_apk.apk" type="application/vnd.android.package-archive">Download App</a>
Run Code Online (Sandbox Code Playgroud)
仍然没有运气.
我可以从Android市场下载和安装应用程序.我怀疑apache没有发送mime类型,但这只是在黑暗中拍摄.如何解决问题并能够从我的Web服务器安装APK?(或至少检查apache是否使用mime类型发送正确的标头)
任何帮助将不胜感激.
package supa.mack.doppler;
import java.util.Set;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.bluetooth.*;
import android.widget.Toast;
public class doppler_test extends Activity {
TextView out;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
out = (TextView) findViewById(R.id.out);
// Getting the Bluetooth adapter
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
out.append("\nAdapter: " + adapter);
// Check for Bluetooth support in the first place
// Emulator doesn't support Bluetooth and will return null …Run Code Online (Sandbox Code Playgroud) 查看为ASP.NET MVC2编写的http://lukesampson.com/post/471548689/entering-and-exiting-https-with-asp-net-mvc中的示例代码,我注意到他们可以检查自定义属性是否为通过访问filterContext.ActionDescriptor和filterContext.ActionDescriptor.ControllerDescriptor分别应用于当前操作或控制器:
public class ExitHttpsIfNotRequiredAttribute : FilterAttribute, IAuthorizationFilter {
public void OnAuthorization(AuthorizationContext filterContext) {
// snip
// abort if a [RequireHttps] attribute is applied to controller or action
if(filterContext.ActionDescriptor.ControllerDescriptor.GetCustomAttributes(typeof(RequireHttpsAttribute), true).Length > 0) return;
if(filterContext.ActionDescriptor.GetCustomAttributes(typeof(RequireHttpsAttribute), true).Length > 0) return;
// snip
}
}
Run Code Online (Sandbox Code Playgroud)
检查自定义属性的操作和控制器的ASP.NET MVC 1方法是什么?在ASP.NET MVC 1中filterContext.ActionDescriptor,我无法分辨.
我在javascript中有一种方法可以使页面跳转到页面上的特定位置,例如
<span id='jump_to_this_location'></span>
Run Code Online (Sandbox Code Playgroud)
我不想重新加载页面,