我最近对PHP 5.4进行了更新,我收到有关静态和非静态代码的错误.
这是错误:
PHP Strict Standards: Non-static method VTimer::get()
should not be called statically in /home/jaco/public_html/include/function_smarty.php on line 371
Run Code Online (Sandbox Code Playgroud)
这是第371行:
$timer = VTimer::get($options['magic']);
Run Code Online (Sandbox Code Playgroud)
我希望有人可以提供帮助.
我有固定版本2.3.3的Galaxy标签GT-P1000 7英寸和运行Android 2.2的电话.在这两个版本中,当我试图从GPS获得时间时,它显示从2012年1月1日起提前1天.相同的代码在三星,LG和摩托罗拉电话上工作正常.
该应用程序的示例代码是,
package com.vxceed.dateTime;
import java.util.Calendar;
import android.app.Activity;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
public class SampleDateTimeActivity extends Activity {
private LocationManager locationManager;
private TextView tv;
String varTime="";
/**
* Location Listener
*/
LocationListener locationListener = new LocationListener() {
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
}
@Override
public void onProviderEnabled(String provider) {
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
}
@Override
public void onProviderDisabled(String provider) {
Toast.makeText(SampleDateTimeActivity.this,"GPS …
Run Code Online (Sandbox Code Playgroud) 我有一个问题,更快的是什么......
我编写了一个小引擎,在Canvas2D中使用javascript显示5个精灵.一切正常,并完全优化.
FPS在30到60之间波动 - 但有趣的是,它在google javascript控制台打开时以恒定的60 fps表示!
有没有其他身体经历过这个?
我正在使用requestAnimationFrame
编辑:
示例:http: //jsfiddle.net/jrPNy/1
玩"粒子"数字,所以你的fps大约是40-50.比打开控制台,它最高可达60 fps.(Chrome 21.0.1180.83)
我想在imageView
应用程序启动后5秒内更改图像.
这是我到目前为止尝试的代码:
public class MainActivity extends Activity {
ImageView screen;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
screen=(ImageView)findViewById(R.id.imageView1);
screen.setImageResource(R.drawable.ic_launcher);
}
}
Run Code Online (Sandbox Code Playgroud) 如何扩展jQuery插件?
目前我正在使用multiopen手风琴插件.
我需要添加新功能,例如一旦展开/折叠完成,我需要像jquery ui accordion插件中的更改事件一样回调函数.
如何在此插件中添加此功能.
javascript jquery jquery-ui jquery-plugins jquery-ui-accordion
如何在WPF TreeView中清除TreeView选项?我已经尝试循环TreeNodes
并清除IsSelected
属性,但这是一个ReadOnly
属性.有任何想法吗?
的TreeView
是使用XML通过绑定XMLDataProvider
对象.
鉴于ES 5.1标准规定......
1)在http://es5.github.com/#x13.2脚下注意
NOTE A prototype property is automatically created for every function,
to allow for the possibility that the function will be used as a constructor.
Run Code Online (Sandbox Code Playgroud)
2)http://es5.github.com/#x15.3.5.2
NOTE Function objects created using Function.prototype.bind do not have
a prototype property.
Run Code Online (Sandbox Code Playgroud)
(这暗示所有其他功能都有)
...为什么内置函数不再具有原型属性?:
[].push.prototype; //undefined
Math.max.prototype; //undefined
Run Code Online (Sandbox Code Playgroud)
此外,即使为这些内置函数分配了一个原型属性,它们也不能用作构造函数:
[].push.prototype = {};
[].push.prototype; //[object Object]
new [].push(); //TypeError: function push() { [native code] } is not a constructor
Run Code Online (Sandbox Code Playgroud)
相反,从用户定义的对象中删除prototype属性仍然允许它用作构造函数,并且实际上将一个通用对象分配给生成的实例的[[prototype]]:
var A = function() {};
A.prototype = undefined;
A.prototype; //undefined …
Run Code Online (Sandbox Code Playgroud) 当我触摸圆形区域时我想播放媒体,但我怎样才能确定我的触摸位置是否在圆圈中?
到目前为止,我扩展view
并实现了onTouchEvent
,我需要算法来确定位置是在圆圈内部还是外部.
我的Node.js代码如下所示
CODE1:下面
var http=require('http');
var MySQL = require('mysql');
mysql = MySQL.createConnection(...)
http.createServer(function(req, res){
// the query will take several seconds
mysql.query("SELECT SLEEP(1)", function....)
});
http.listen(...);
Run Code Online (Sandbox Code Playgroud)
问题是当我刷新页面太快时服务器将崩溃.我认为是node-mysql模块的问题,它在队列中处理查询.所以我尝试创建一个连接池.
CODE2:下面
....
var pool = require('generic-pool');
var mp = pool.Pool({
...
create: function(cb){
client = MySQL.createConnection(...);
cb(null, client)
},
max: 10, // up to 10 connection
min: 2,
...
});
....
mp.acquire(function(err, mysql){
// the query will take several seconds
mysql.query("SELECT SLEEP(1)", function....)
mp.release(mysql);
});
....
Run Code Online (Sandbox Code Playgroud)
但问题还存在,为什么?我怎样才能解决这个问题.
编辑:我发出100个并发100个请求,预计10秒.但它需要20秒.为什么?该池最多只支持5个连接吗?
android ×3
javascript ×3
php ×2
.net ×1
arrays ×1
ecmascript-5 ×1
galaxy-tab ×1
geometry ×1
gps ×1
html5-canvas ×1
jquery ×1
jquery-ui ×1
mysql ×1
nmea ×1
node-mysql ×1
node.js ×1
non-static ×1
static ×1
touch ×1
treeview ×1
variables ×1
wpf ×1