我需要一种方法(使用内置的PHP库)从URL下拉图像并将其保存到本地磁盘,调整大小/缩放WIDTH到150px.我一直在尝试这个:
function makeThumbnails($updir, $img, $id)
{
$thumbnail_width = 134;
$thumbnail_height = 189;
$thumb_beforeword = "thumb";
$arr_image_details = getimagesize("$updir" . $id . '_' . "$img"); // pass id to thumb name
$original_width = $arr_image_details[0];
$original_height = $arr_image_details[1];
if ($original_width > $original_height) {
$new_width = $thumbnail_width;
$new_height = intval($original_height * $new_width / $original_width);
} else {
$new_height = $thumbnail_height;
$new_width = intval($original_width * $new_height / $original_height);
}
$dest_x = intval(($thumbnail_width - $new_width) / 2);
$dest_y = intval(($thumbnail_height - $new_height) / 2); …Run Code Online (Sandbox Code Playgroud) 我已经阅读了很多关于如何在SQL Server 2012上配置镜像的文章.我完成了所有步骤,一切正常,直到最后一步,这不起作用.
当我在校长上运行时:
ALTER DATABASE MyDBName SET PARTNER ='TCP://1.2.3.4:5022';
我收到此错误:
无法访问或不存在服务器网络地址"TCP://1.2.3.4:5022".
当我运行上面显示的对应的ALTER语句,但在镜像上,它工作正常.
我已经尝试了本故障排除文章中的所有步骤.
重点:
寻找关于这个的一些想法.
我有一个看起来像这样的html表:
<table style="border-spacing: 10px">
<tr style='background-color:red'>
<td><b>Member</b></td>
<td><b>Account #</b></td>
<td><b>Site</b></td>
<td><b>Date</b></td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
元素之间的填充很好,但背景颜色似乎只填充TD,并且由于填充/间距而留下大量间隙.如何使TR背景颜色填充整行,并流过10px边框间距?
我正在尝试将ChromeDriver 2.4.226107与Selenium 2.45,Google Chrome 42.0.2311.135,Visual Studio 2012和.NET 4.5一起使用.我的小测试应用程序编译并运行,但是当它启动一个新的Chrome窗口时,我收到此错误:
"You are using an unsupported command-line flag: --ignore-certifiate-errors. Stability and security will suffer."
Run Code Online (Sandbox Code Playgroud)
我仔细阅读了这篇文章并尝试了许多建议的修复,但没有任何效果.我一次又一次地看到建议的解决方法/解决方案是这样做的:
options.AddArgument("test-type");
Run Code Online (Sandbox Code Playgroud)
这对Chrome 42.0没有任何作用.这是我的C#代码(控制台应用程序):
using(var driver = new ChromeDriver()) {
driver.Navigate().GoToUrl("http://localhost/test.aspx");
}
Run Code Online (Sandbox Code Playgroud)
黄色栏内有错误的Chrome窗口如下所示:

我的应用内商品全部设置为通过ti.storekit在iTunes Connect中购买:

我的Appcelerator 4.0应用程序编译并部署到我的设备(开发配置文件).ti.storekit链接到我的应用程序并进行编译.在没有未处理的异常方面,它似乎也正确执行.但它告诉我它无法找到我的应用内购买产品.我已经尝试将"15键"和"15Keys"交给ti.storekit.我不确定它想要哪一个(参考名称或产品ID) - 但无论如何都不起作用.
这是ti.storekit中的函数,它产生错误消息:
function requestProduct(identifier, success)
{
Storekit.requestProducts([identifier], function (evt) {
if (!evt.success) {
alert('ERROR: We failed to talk to Apple!');
}
else if (evt.invalid) {
alert('ERROR: Invalid product: ' + identifier);
}
else {
success(evt.products[0]);
}
});
}
Run Code Online (Sandbox Code Playgroud)
正在执行"else if"行:alert('ERROR: Invalid product: ' + identifier);
我做错了什么?我应该提供参考名称(15键)或产品ID(15Keys)吗?既然我已经尝试了两者而且都不起作用,我该如何解决这个问题呢?我究竟做错了什么?
编辑:
我不清楚3件事:
1-我应该在我的ipad上进入设置并使用我的TEST USER苹果沙箱帐户登录itunes/store吗?我无法这样做,因为它一直要求我输入信用卡.我过去使用的测试信用卡(在其他非iOS系统上),如4111111111111111不起作用,我无法继续并登录.甚至不确定我是否应该这样做.如果是这样,我可以使用哪些CC凭据?我应该使用REAL CC吗?基于我在其他文章和帖子中阅读的所有内容,它表示永远不会将测试帐户链接到CC编号...那么为什么苹果不允许我登录我的测试用户到我的苹果设备(在设置内)进入信用卡?
2-我没有按照https://github.com/appcelerator-modules/ti.storekit/blob/master/ios/example/app.js中的步骤进行操作,因为在我的应用程序中没有任何内容可供下载,没有任何内容在我的应用程序中,用户可以购买密钥,这些密钥只是我应用程序中的数字实体 - 无需下载.所以我删除了与下载/托管有关的所有代码/步骤.
3-我的应用程序版本1.0.0正在等待应用程序商店中的审核.此版本没有ti.storekit,也没有应用内购买.没有.但是我正在开发一个更新的版本,包含我最新的appcelerator 4.0项目中的所有storekit和应用内购买内容.这不应该在我的开发环境中,在我连接的ipad上,在开发构建中工作吗?我有1.0.0等待审查的事实,没有storekit的东西,应该与我在我的开发帐户中使用storekit的新版本无关,对吧?我也对这条消息感到困惑:

在我的DEV商店包装工作之前,我是否需要向Apple提交新版本?如果是这样,这似乎很奇怪,好像app-store候选版本与我在本地环境中开发的东西相关联.这条消息表明为什么我的dev storekit东西不起作用?我的应用内购买产品似乎已正确配置,但我不应该在dev/sandbox中与此连接,无论应用程序商店中等待审核的1.0应用程序(没有商店套件)?
谢谢大家的帮助......我必须错过一些我没有看到的关键步骤.
多年来,我一直在我的php应用程序中大量使用mcrypt,无论是在win/IIS还是在linux上.虽然我在我的linux服务器上运行PHP 5.4.28,但我刚刚在Windows 8.1 IIS框中升级到PHP 5.6.11.并且mcrypt不再有效.它不会抛出我能看到的任何错误; 它只是不起作用.这是我的加密功能:
function Encrypt($text){
global $salt;
if($text != "")
return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $salt, $text, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));
else
return "";
}
Run Code Online (Sandbox Code Playgroud)
这在我的Linux服务器上工作正常,但在我的本地Windows框中返回空白.根据我的阅读,mcrypt内置于php 5.6 for windows中,因此不应该使用扩展或ini文件.
我错过了什么?
我需要用moment.js减去2次(得到差异),然后用这个结果减去一些额外的分钟(简单的int).它用于计算时间表.几个例子:
Example #1:
Start time: 10:00 AM (represented in js as "10:00")
End time: 2:00 PM (represented in js as "14:00")
Lunch: 30 minutes ("30")
Expected result: "3:30" (10am - 2pm is 4 hours, minus 30 minutes for lunch = 3hrs 30 mins -- and I need it output as "3:30")
Example #2:
Start time: 6:15 AM (represented in js as "6:15")
End time: 4:45 PM (represented in js as "16:45")
Lunch: 0 minutes ("0")
Expected result: "10:30"
Run Code Online (Sandbox Code Playgroud)
我知道moment.js可以做到这一点,但我很难获得预期的结果.我一直在尝试这个:
function …Run Code Online (Sandbox Code Playgroud) 我想使用最新的PHPMailer库,require_once()而不是搞乱Composer.我想要一个纯粹的xcopy部署,最小的麻烦.
这是我正在尝试做的事情:
require_once("src/PHPMailer.php");
$mail = new PHPMailer;
$mail->isSMTP();
$mail->SMTPDebug = 2;
$mail->Host = "smtp.gmail.com";
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
$mail->SMTPAuth = true;
$mail->Username = $smtpUsername;
$mail->Password = $smtpPassword;
$mail->setFrom($emailFrom, $emailFromName);
$mail->addAddress($emailTo, $emailToName);
$mail->Subject = 'PHPMailer GMail SMTP test';
$mail->msgHTML("test body");
$mail->AltBody = 'HTML messaging not supported';
if(!$mail->send()){
echo "Mailer Error: " . $mail->ErrorInfo;
}else{
echo "Message sent!";
}
Run Code Online (Sandbox Code Playgroud)
我收到错误消息: Fatal error: Class PHPMailer not found in [....]\EmailTester.php on line 21
第21行是这样的: $mail = new PHPMailer; …
我有一个Twitter引导程序轮播在我的网页上工作得很好,但我不能让侧箭头表现我想要的方式.我的CSS知识可能是10分中的5分.
目前,"字形"箭头绝对位于窗口的左右边缘.当我缩小或增大窗口时,这些箭头与窗口边缘保持完全相同的距离.这是奇怪和错误的,因为它们遍布旋转木马图像的顶部.我希望它们保持在旋转木马图像上的固定位置,而不是在浏览器窗口上.此外,我需要将字体字形更改为透明图像.
左键和右箭头在单击时滚动旋转木马.它们不是图像,它们是字形,我猜它是某种奇怪的字体.这是HTML:
<a href="#myCarousel" class="left carousel-control" data-slide="prev" style="width:0px"><span class="glyphicon glyphicon-chevron-left"></span></a>
<a href="#myCarousel" class="right carousel-control" data-slide="next" style="width:0px"><span class="glyphicon glyphicon-chevron-right"></span></a>
Run Code Online (Sandbox Code Playgroud)
这是href的css:
.carousel-control {
background: #343432;
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 15%;
font-size: 20px;
color: #ffffff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
Run Code Online (Sandbox Code Playgroud)
这是内跨的css:
.glyphicon-chevron-right {
position: absolute;
top: 50%;
z-index: 5;
display: inline-block;
}
Run Code Online (Sandbox Code Playgroud)
和:
.glyphicon {
font-family: 'Glyphicons Halflings';
-webkit-font-smoothing: antialiased;
font-style: normal;
font-weight: normal;
line-height: 1;
-moz-osx-font-smoothing: grayscale;
}
Run Code Online (Sandbox Code Playgroud)
虽然它没有在原始html中显示,但在查看Chrome开发工具栏检查器时,在跨度内我看到了:
::before
Run Code Online (Sandbox Code Playgroud)
因此,我需要知道如何更改箭头位置以保持相对于轮播图像而不是浏览器窗口的固定.我需要将字形更改为我拥有的一些透明箭头. …
如果您查看我的网页,您会看到顶级视频(红鼻子的中世纪男人)播放完美,包括视频和音频。
但是如果你看底部(第二个)视频,当你播放它时,只有音频。您看到的“视频图像”实际上不是视频本身,而是使用“海报”html 标签的 png。
这是两个视频的html:
<video src="http://shapeshed.com/examples/HTML5-video-element/video/320x240.m4v" poster="http://shapeshed.com/examples/HTML5-video-element/images/posters/les.jpg" controls="true" width="320" height="240">
Your browser doesn't support the video tag. You can <a href="/video/your_video.ogg">download the video here.</a>
</video>
<video src="videos/Play.mov" poster="videos/Play.png" controls="true" width="800" height="600">
Your browser doesn't support the video tag. You can <a href="videos/Play.mov">download the video here.</a>
</video>
Run Code Online (Sandbox Code Playgroud)
第二个视频是我关心的视频,但我无法让视频在 Chrome 中工作——它只播放音频。但在 Mac Safari 上,视频效果很好。难道我做错了什么?看来我正在实施我的第二个视频,正是第一个视频。为什么 1 有效而 2 无效?
编辑:我得到了进一步的发展,但现在仅在 iPad 中(Chrome 工作,iphone 工作)我得到视频但没有音频。有任何想法吗?
编辑 #2:我需要我的 2 个视频才能在 Apple Safari 上正确播放——其他都无关紧要,因为除 Apple 设备之外的所有用户都会看到 YouTube 嵌入的视频。谁能告诉我将 AVI 转换为保证在 Apple Safari 中工作的视频格式的确切步骤?
php ×3
css ×2
appcelerator ×1
c# ×1
css3 ×1
encryption ×1
github ×1
html ×1
html5-video ×1
iis ×1
javascript ×1
mcrypt ×1
momentjs ×1
phpmailer ×1
selenium ×1
sql-server ×1
titanium ×1