我想确保我想要优化并使我的网站很容易维护我的网站的不同版本.
我的网站版本很少:
我使用ubuntu服务器与MySQL 5,PHP 5和Apache + Memcache.
实现我的网站的最佳方式是什么,所以他们都使用相同的基本功能:
谢谢
我在PHP中有一个cronjob计算一些业务规则(例如:净转速,总转速,估计转速等...使用标准偏差和其他数学算法)
这个cronjob使用exec调用多个cron调用3个php脚本
对于每次调用,我在后台启动一个进程并告诉系统x已启动.例如:
这是我的逻辑
start
main cron start - message
cron sub 1 start - message
run cron sub 1
cron sub 1 end - message
wait until cron sub 1 stop
process stuff
cron sub 2 start - message
run background cron sub 2 // this will automaticaly send a message when this jobs end
cron sub 3 start - message
run background cron sub 3 // this will automaticaly send a message when this jobs end
main cron …Run Code Online (Sandbox Code Playgroud) 在我的网站上我有3 css
<link rel="stylesheet" type="text/css" media="screen" href="screen.css" />
<link rel="stylesheet" type="text/css" media="print" href="print.css" />
<link rel="stylesheet" type="text/css" media="handheld" href="handheld.css" />
Run Code Online (Sandbox Code Playgroud)
我认为媒体掌上电脑将自动加载我的网站格式化设备
当我用我的android加载我的网站时,我仍然看到"site.css"为什么它不加载handheld.css?
是否可以使用GD在PHP中创建此图像?我知道我需要使用GD和imagecreate,imagecolorallocate,imagedestroy等...但我不知道如何做曲线
我需要用这些模式创建多个箭头
编辑:这样我就不必在互联网上查看箭头(基于用户/客户端规格).然后我会在图像中添加文字(例如:点击下一个或按照箭头).因为我不是平面设计师,使用gd创建这些iamges对我来说会更容易.
例如:
http://kennebecvalleycoaching.com/red_arrow_curve.JPG
http://s3.amazonaws.com/satisfaction-production/s3_images/13664/curved_inline.png
Run Code Online (Sandbox Code Playgroud)
谢谢
我在美国(纽约)有2个服务员1,在欧洲(伦敦)有1个服务器
我的服务器尽可能接近同步.现在,当来自欧洲的某人访问我的网站时,它会使用伦敦服务器和美洲的相同想法.
我不时地在我的网站上进行维护,因此我将流量重定向到其他服务器.因为时区差异我需要让它对用户透明,所以如果来自美国的人被重定向到伦敦的服务器(由于维护),我需要向他展示EDT时区
我的问题.我有查询我从mysql运行日期(一个是记录的最后日期)
我想正确显示它,所以我的问题是
我应该使用mysql来转换日期或PHP吗?哪一个更好更快?
谢谢
我在PDO上阅读并在StackOverFlow上搜索了关于pdo和prepare语句的内容.我想知道什么是好处或使用准备声明.例如:
$sql = 'SELECT name, colour, calories FROM fruit WHERE calories < :calories AND colour = :colour';
$sth = $dbh->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
$sth->execute(array(':calories' => 150, ':colour' => 'red'));
$red = $sth->fetchAll();
Run Code Online (Sandbox Code Playgroud)
VS
$sql = "SELECT name, colour, calories FROM fruit WHERE calories < $calories AND colour = $colour";
$result = $connection->query($query);
$row = $result->fetch(PDO::FETCH_ASSOC);
Run Code Online (Sandbox Code Playgroud)
两个查询都会返回相同的结果,所以为什么要使用prepare,对我来说看起来它会慢一点,因为你必须执行一个额外的步骤.
谢谢
我需要一个简单c结构的帮助,但无法找到它为什么不编译使用gcc(opensuse 11.4)
我有这个代码:
struct Image {
int w;
int h;
// other code
};
Run Code Online (Sandbox Code Playgroud)
在同一个文件中,我有另一个结构数组,如下所示:
struct ShapeImage
{
Image image[10];
// other code
};
Run Code Online (Sandbox Code Playgroud)
当我编译时,我得到:
syntax error before [' token`
Run Code Online (Sandbox Code Playgroud)
为什么我收到此错误如果指定图像中的数字10 image[10];看起来对我好,有什么问题?
我正在研究pantelides算法,我需要一些关于正则表达式的帮助,主要包的索引.php中的pantelides alorithm @ http://jpye.dyndns.org/pantelides/
在index.php文件中,我看到:
if(preg_match_all("#\\b([a-z][a-z_0-9]*)(?!\\()\\b#i",$str,$matches)){
Run Code Online (Sandbox Code Playgroud)
现在,我不是reg exp的专家,但我知道[az]意味着什么,但这\\b意味着什么?