如何使用百万美分解析的URL设置样式标记的背景属性.
我有
<div style="background:url('<url-to-image>')"></div>
Run Code Online (Sandbox Code Playgroud)
<img th:src="${@/<path-to-image>}">在thymeleaf中是否有相应的设置样式属性.
我一直在努力学习C#与HttpClient的异步,并遇到了一个我无法弄清楚发生了什么的问题.
我想做的事:
问题:
每当我一起发送请求列表时,响应似乎要花费更长的时间,但它们应该大致相同.例如:
所用时间:67.9609毫秒所用
时间:89.2413毫秒所用
时间:100.2345毫秒所用
时间:117.7308毫秒所用
时间:127.6843毫秒所用
时间:132.3066毫秒所用
时间:157.3057毫秒
什么时候它们都应该只有70毫米左右...这对于每一批新产品都会重复; 第一个是快速的,然后每个连续的减速.
我的代码
有3个主要部分.我已经简化了它,我可以专注于问题发生的地方(Downloader.cs是我的时间)
Downloader.cs这包含执行实际http查询的方法:
public async Task<string> DownloadData(string requestString)
{
HttpResponseMessage response;
response = await this.httpClient.PostAsync( url, new StringContent( requestString ));
string returnString = await response.Content.ReadAsStringAsync();
return returnString;
}
Run Code Online (Sandbox Code Playgroud)QueryAgent.cs这初始化一个新的Downloader并包含主异步循环调用函数和它在循环中调用的异步方法.
我需要尽快发送新的请求,具体取决于最后一组响应的结果(基本上,请求发出的速率可能会发生变化,所以我不能在结束时执行Task.delay() while循环)
public async Task DownloadLoopAsync()
{
while ( this.isLooping )
{
// I put this here to stop it using lots of cpu.
// Not sure if it is best …Run Code Online (Sandbox Code Playgroud)现在,我有了这个有效的方法,但是它又长又难看:
var details = dc.SunriseShipment
.Where(it => (it.isDeleted == null || it.isDeleted == false));
Run Code Online (Sandbox Code Playgroud)
有一个更好的方法吗?我尝试了“ it.isDeleted!= true”和“ it.isDeleted ?? false == false”,但是它们不起作用。
我对Laravel相当陌生,我曾与Laravel 4一起工作过,但决定将新的Laravel 5花哨的个人项目用于个人项目并真正学习它。
我本想将其发布在Webmasters.SE上,但是找不到关于Laravel的其他任何问题。
我在互联网上找不到任何解决方案,我很乐意提供更多信息。
因此,我只是在本地WAMP服务器上使用他们自己的安装方法安装了一个新的Laravel 5应用程序。我做了整个Composer mumbo-jumbo,一切都完成了,没有出现错误。
问题
现在,这是我的问题,当我使用http://localhost/test.com/public/默认值页面访问网站时,应该会得到默认页面。
在routes.php(如下所示)中,您将看到他们定义了home一条路线。因此,我在网址栏中输入了它,http://localhost/test.com/public/home然后重定向回了http://localhost/test.com/public/auth/login,如下图所示。
(它没有任何样式,我假设它应该像这样吗?)
无论如何,我到达那里,然后将鼠标悬停在Home左下方/右下方的小网址栏上,http://localhost然后单击它将我重定向到WAMP Server主页。
这些是它们链接到的URL:
http://localhosthttp://localhost/auth/loginhttp://localhost/auth/registerhttp://localhost/password/email所需的结果应该是应该将我重定向到 http://localhost/test.com/..
我不知道在哪里,这可能已经造成,我asuming这一点是必须有.htaccess,routes.php或者paths没有正确设置。我曾尝试修改两者.htaccess,routes.php但我显然不具备自己调试此问题的知识。
代码资源(全新安装,未做任何更改)
routes.php
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| …Run Code Online (Sandbox Code Playgroud) c# ×2
async-await ×1
asynchronous ×1
blocking ×1
css ×1
laravel ×1
laravel-5 ×1
linq ×1
task ×1
thymeleaf ×1
wampserver ×1