您可以检查解决方案。使用的flexbox以及有关响应性,只有文本大小会影响,因此请相应地调整文本大小。还要注意,为了样式目的,我在标记中添加了一些更改。让我知道它是否回答了您的问题。
/* style.css */
body {
color: #000;
font-family: 'Source Sans Pro', sans-serif;
}
h1, h2, h3, h4, h5, h6, p {
font-family: 'Source Sans Pro', sans-serif;
}
.focus_area {
width: 100%;
display: flex;
justify-content: center;
}
.focus_area .left {
display: flex;
flex-direction: column;
max-width: 66.66666%;
justify-content: space-between;
}
.focus_area .right {
display: flex;
flex-wrap: wrap;
max-width: 33.33333%;
}
.left-top, .left-bottom {
display: flex;
}
.left .focus {
flex: 50%;
}
.focus_text {
background: rgb(156, 166, 104);
color: #fff;
flex: 2;
display: flex;
margin: 2px;
}
.focus_text h2 {
text-align: center;
text-transform: uppercase;
align-items: center;
margin: auto;
font-size: 16px;
}
.focus {
position: relative;
padding: 2px;
}
.right .focus img {
max-width: 100%;
height: auto;
}
.left .focus img {
max-width: 100%;
height: auto;
}
.focus p {
color: #fff;
text-shadow: 0 0 black;
font-size: 22px;
position: absolute;
bottom: 0px;
padding-left: 15px;
font-size: 14px;
}
/* tablet styles */
@media screen and (max-width: 768px) and (min-width: 481px) {
.focus_area {
flex-direction: column;
}
.focus_area .left, .focus_area .right {
max-width: 100%;
}
.focus_text {
padding: 50px 0px;
}
.focus_area .right {
flex-wrap: nowrap;
}
} /* end of tablet styles */
/* styles for mobile devices */
@media screen and (max-width: 480px) {
.focus_area {
flex-direction: column;
}
.focus_area .left, .focus_area .right {
max-width: 100%;
}
.left-top, .left-bottom {
display: block;
}
.focus_text {
padding: 50px 0px;
}
} /* end of mobile styles */
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@200;300;400;700&display=swap" rel="stylesheet" />
</head>
<body>
<div class="container py-5">
<div class="row">
<div class="col-md-12">
<h2 class="text-center">Some Title</h2>
</div>
</div>
</div>
<div class="container">
<div class="focus_area">
<div class="left">
<div class="left-top">
<div class="focus">
<img src="https://i.ibb.co/wdRy4Wv/cities-and-shelter.png" alt="" class="img-fluid" />
<p>Cities & Shelters</p>
</div>
<div class="focus">
<img src="https://i.ibb.co/VCbRdbx/education-and-training.png" alt="" class="img-fluid" />
<p>Education & Training</p>
</div>
</div>
<div class="focus_text">
<h2>Delivering Humanitarian Relief Throughout The World</h2>
</div>
<div class="left-bottom">
<div class="focus">
<img src="https://i.ibb.co/0BT5vp5/energy-and-environment.png" alt="" class="img-fluid" />
<p>Energy & Environment</p>
</div>
<div class="focus">
<img src="https://i.ibb.co/bWpystL/jobs-and-business.png" alt="" class="img-fluid" />
<p>Jobs & Business</p>
</div>
</div>
</div>
<div class="right">
<div class="focus">
<img src="https://i.ibb.co/XX9Y7yH/health-and-fitness.png" alt="" class="img-fluid" />
<p>Health & Fitness</p>
</div>
<div class="focus">
<img src="https://i.ibb.co/3NSF6hj/food-and-water.png" alt="" class="img-fluid" />
<p>Food & Water</p>
</div>
</div>
</div>
</div>
<div class="container py-5">
<div class="row">
<div class="col-md-12">
<h2 class="text-center">Some Title</h2>
</div>
</div>
</div>
</body>
</html>
请检查是否可以重定向以用HTTP上下文签名,以配置启动类的服务。
options.Events.OnSignedOutCallbackRedirect = async context =>
{
context.HttpContext.Response.Redirect(context.Options.SignedOutRedirectUri);
context.HandleResponse();
};
并且请检查是否可以添加控制器以这种方式签字&gt; azure-b2c-logout-implentation-in-ass-ass-asp-net-core < /a>
参考:
如果您解释了要样式的样式,我可能会提供一个更好的示例,但是您可以用* 25%
用/4
替换吗?这对我有用。
例子:
如果您使用的是承诺,则此答案适合您。
这意味着Angularjs,jQuery(带延迟),本机 xhr“> xhr”> xhr href =“ https://en.wikipedia.org/wiki/ember.js” rel =“ noreferrer”> ember.js , backbone.js 's保存或任何 noreferrer“ .js 返回承诺的库。
您的代码应该与此相似:
function foo() {
var data;
// Or $.get(...).then, or request(...).then, or query(...).then
fetch("/echo/json").then(function(response){
data = response.json();
});
return data;
}
var result = foo(); // 'result' is always undefined no matter what.
Felix Kling做得很好为使用jQuery和回调的人写答案。我有一个本地XHR的答案。这个答案是用于对前端或后端上承诺的一般用法。
核心问题
在浏览器和服务器上使用node.js/io.js在服务器中的JavaScript并发模型是 asynchronous 和反应性。
每当您调用返回诺言的方法时,然后
处理程序始终异步执行 - 也就是说, 下方的代码不是在中。然后
处理程序。
这意味着,当您返回数据
处理程序尚未执行。反过来,这意味着您要返回的值尚未设置为正确的值。
这是一个简单的类比:
function getFive(){
var data;
setTimeout(function(){ // Set a timer for one second in the future
data = 5; // After a second, do this
}, 1000);
return data;
}
document.body.innerHTML = getFive(); // `undefined` here and not 5
data
的值是不确定的
,因为 data = 5
零件尚未执行。它可能会在一秒钟内执行,但是到那时,它与返回的值无关。
由于该操作尚未发生(AJAX,服务器调用,I/O和计时器),您在请求有机会告诉您的代码是什么值之前返回值。
解决此问题的一种可能解决方案是代码 ,告诉您的程序完成计算后该怎么办。承诺通过本质上是暂时的(时间敏感)来积极实现这一目标。
快速回顾承诺的
承诺是随时间的价值。承诺有状态。他们从没有价值的待审开始,可以安定下来:
- 实现意味着计算成功完成。
- 拒绝意味着计算失败。
诺言只能改变状态 之后,它将永远保持在同一状态。您可以将附加
处理程序附加,以承诺提取其价值并处理错误。 然后
处理程序允许 chaning> chaning> chaning 。承诺由使用返回它们。例如,更现代的AJAX替换 Fetch
或jQuery的 $。get
返回承诺。
当我们调用。如果我们回报另一个诺言,我们会得到令人惊奇的事情,但让我们握住马匹。
有了承诺,
让我们看看如何通过承诺解决上述问题。首先,让我们通过使用 Promise构造函数用于创建延迟函数:
function delay(ms){ // Takes amount of milliseconds
// Returns a new promise
return new Promise(function(resolve, reject){
setTimeout(function(){ // When the time is up,
resolve(); // change the promise to the fulfilled state
}, ms);
});
}
现在,在我们转换的settimeout 要使用诺言,我们可以使用然后
来计算:
function delay(ms){ // Takes amount of milliseconds
// Returns a new promise
return new Promise(function(resolve, reject){
setTimeout(function(){ // When the time is up,
resolve(); // change the promise to the fulfilled state
}, ms);
});
}
function getFive(){
// We're RETURNING the promise. Remember, a promise is a wrapper over our value
return delay(100).then(function(){ // When the promise is ready,
return 5; // return the value 5. Promises are all about return values
})
}
// We _have_ to wrap it like this in the call site, and we can't access the plain value
getFive().then(function(five){
document.body.innerHTML = five;
});
基本上,而不是返回 value ,我们由于并发模型而无法做,而是我们返回a wrapper ,以获取我们可以 unwrap <的值/em>带有<代码>然后。就像一个框,您可以使用然后
打开。
在原始API调用中应用
此信息相同,您可以:
function foo() {
// RETURN the promise
return fetch("/echo/json").then(function(response){
return response.json(); // Process it inside the `then`
});
}
foo().then(function(response){
// Access the value inside the `then`
})
这样也可以。我们已经了解到,我们无法从已经异步的调用中返回值,但是我们可以使用诺言并将其链接来执行处理。现在,我们知道如何从异步呼叫中返回响应。
ES2015(ES6)
ES6引入是可以在中间返回然后恢复其点的功能。例如,这通常对于序列很有用,例如:
function* foo(){ // Notice the star. This is ES6, so new browsers, Nodes.js, and io.js only
yield 1;
yield 2;
while(true) yield 3;
}
是一个函数,该函数可以通过序列返回序列 1,2,3,3,3,3,....
可以迭代。尽管这本身很有趣,并为很多可能性打开了空间,但有一个特别的案例。
如果我们要产生的序列是一系列动作,而不是数字 - 我们可以在恢复函数之前等待动作并等待该功能。因此,我们需要一个 future 值的序列,而不是数字序列,也就是说:承诺。
这有点棘手,但非常有力的技巧让我们以同步的方式编写异步代码。有几个“跑步者”为您做到这一点。写一条是几行代码,但它超出了该答案的范围。我将在此处使用Bluebird的 Promise.coroutine
,但是还有其他包装器,例如 co </code>或
q.async
。
var foo = coroutine(function*(){
var data = yield fetch("/echo/json"); // Notice the yield
// The code here only executes _after_ the request is done
return data.json(); // 'data' is defined
});
此方法返回了一个承诺本身,我们可以从其他coroutines中消费。例如:
var main = coroutine(function*(){
var bar = yield foo(); // Wait our earlier coroutine. It returns a promise
// The server call is done here, and the code below executes when done
var baz = yield fetch("/api/users/" + bar.userid); // Depends on foo's result
console.log(baz); // Runs after both requests are done
});
main();
ES7中的ES2016(ES7)
,这是进一步标准化的。现在有几个建议,但是在所有建议中,您都可以等待
承诺。这只是上述ES6提案的“糖”(较好的语法),通过添加 async
和等待
关键字。进行上面的示例:
async function foo(){
var data = await fetch("/echo/json"); // Notice the await
// code here only executes _after_ the request is done
return data.json(); // 'data' is defined
}
它仍然返回承诺同样的示例:)
...
- apiVersion: apps/v1
fieldsType: FieldsV1
fieldsV1:
f:spec:
f:replicas: {} # <-- replicas count has changed
manager: kubectl
operation: Update
time: "2022-06-24T11:37:22Z" # <-- at this time
...
kubectl量表状态满足sts-test -replicas = 0
默认情况下不会创建新的历史记录。
您可以尝试此条件以浏览不同的页面,
RaisedButton(
child: Text('check'),
onPressed: () async {
if (condition) {
// navigate to the desired route
Navigator.pushNamed(context, 'page1');
} else if (condition) {
// navigate to the desired route
Navigator.pushNamed(context, 'page2');
}
},
)
您可以使用此功能:
def aggregate_over_questions( df ):
data = pd.DataFrame()
#get the number of questions
questions = df.loc[:,df.columns.str.contains("^Q")].columns.tolist()
for q in questions:
temp = df.pivot_table(index=f"{q}", columns=['Gender'], values['ID'], aggfunc='count', fill_value=0)
temp = (temp.join(out[['ID']].div(temp['ID'].sum(axis=1).values, axis=0)
.mul(100)
.rename(columns={'ID':'%Respondents'})))
data = pd.concat( [data, temp], axis=0 )
return data
我设法通过(并且知道这听起来很奇怪)将问题重命名为 pages
目录到 page
。我的猜测是,Cloudflare正在做一些奇怪的事情,但我真的不确定。
这是因为这一行:
self.PatientInsuranceCarrierImages = ko.observableArray(items);
您只是将一系列项目放入可观察的数组中。这样,您的 imageType
每个项目中的属性都不是可观察到的
,因此敲除不会跟踪其更改。
要解决此问题,您需要将项目
映射到代码段顶部的定义对象的集合:
self.PatientInsuranceCarrierImages = ko.observableArray(items.map(i => new PatientInsuranceCarrierImage(i)));
function PatientInsuranceCarrierImage(plainInsuranceImage) {
var self = this;
self.ImageTypes = ko.observableArray(plainInsuranceImage.ImageTypes);
self.ImageType = ko.observable(plainInsuranceImage.ImageType);
}
function PatientInsuranceCarrierImageViewModel(items) {
var self = this;
self.PatientInsuranceCarrierImages = ko.observableArray(items.map(i => new PatientInsuranceCarrierImage(i)));
var innerImageTypes = JSON.parse('[{\"ID\":\"BackImage\",\"Name\":\"Back Image\"},{\"ID\":\"FrontImage\",\"Name\":\"Front Image\"},{\"ID\":\"Other\",\"Name\":\"Other\"}]');
const newPatientInsuranceCarrierImage = {
ImageType: "Other",
ImageTypes: [],
};
for (let i = 0; i < innerImageTypes.length; i++) {
newPatientInsuranceCarrierImage.ImageTypes.push(innerImageTypes[i]);
}
// Operations
self.addpatientInsuranceCarrierImage = function() {
self.PatientInsuranceCarrierImages.push(new PatientInsuranceCarrierImage(newPatientInsuranceCarrierImage));
}
}
var plainImages = JSON.parse('[{\"ImageType\":\"Other\",\"ImageTypes\":[{\"ID\":\"BackImage\",\"Name\":\"Back Image\"},{\"ID\":\"FrontImage\",\"Name\":\"Front Image\"},{\"ID\":\"Other\",\"Name\":\"Other\"}]},{\"ImageType\":\"Other\",\"ImageTypes\":[{\"ID\":\"BackImage\",\"Name\":\"Back Image\"},{\"ID\":\"FrontImage\",\"Name\":\"Front Image\"},{\"ID\":\"Other\",\"Name\":\"Other\"}]},{\"ImageType\":\"Other\",\"ImageTypes\":[{\"ID\":\"BackImage\",\"Name\":\"Back Image\"},{\"ID\":\"FrontImage\",\"Name\":\"Front Image\"},{\"ID\":\"Other\",\"Name\":\"Other\"}]},{\"ImageType\":\"Other\",\"ImageTypes\":[{\"ID\":\"BackImage\",\"Name\":\"Back Image\"},{\"ID\":\"FrontImage\",\"Name\":\"Front Image\"},{\"ID\":\"Other\",\"Name\":\"Other\"}]}]');
var patientInsuranceCarrierImagesViewModel = new PatientInsuranceCarrierImageViewModel(plainImages);
ko.applyBindings(patientInsuranceCarrierImagesViewModel);
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.4.2/knockout-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div style="float: right; vertical-align: top; padding-bottom: 5px;">
<a data-bind="click: addpatientInsuranceCarrierImage" href="#" class="button">Add New Image</a>
</div>
<table id="patientInsuranceImages" style="width: 100%;" class="alt1">
<thead>
<tr>
<th class="Table_Top" style="width: 80px;">
Back/Front
</th>
</tr>
</thead>
<!-- ko if: PatientInsuranceCarrierImages().length > 0 -->
<tbody data-bind="foreach: PatientInsuranceCarrierImages">
<tr>
<td>
<select
data-bind="options: ImageTypes, value: ImageType, optionsValue: 'ID', optionsText:'Name'"
class="txtinput"
style="margin-top: 0px;">
</select>
<input type="hidden" data-bind="value: ImageType, attr: {name: 'images[' + $index() + '].ImageType'}" />
<span data-bind="text: ImageType"></span>
</td>
</tr>
</tbody>
<!-- /ko -->
</table>
如果您想在数字结束时摆脱0,则可以将其除以10,直到最后一个数字不是0或数字为0,以便您不会属于无限循环。
function removeZeros(n){
while(n%10 === 0 && n!=0){
n = Math.floor(n/10);
}
return n;
}
console.log(removeZeros(100));
console.log(removeZeros(1001));
console.log(removeZeros(-200));
console.log(removeZeros(-200200));
但是,如果您想删除所有零,则可以将数字转换为字符串,然后将所有“ 0”替换为“”。之后,您可以将其转换回数字:
function removeZeros(n){
return Number(String(n).replaceAll("0",""));
}
console.log(removeZeros(100));
console.log(removeZeros(1001));
console.log(removeZeros(-200));
console.log(removeZeros(-200200));
无需在,
之间,网格 - 板块列
值。
您也可以将其更改为自动
,而不是自己进行计算,如果它们都相同并指定 25%
。
现在看看
let x = 0;
do{
const square = document.createElement("div");
square.className = "squares";
square.setAttribute("id","block");
document.getElementById("container").appendChild(square);
x++;
}
while(x < 16);
html,body{
height: 100%;
margin: none;
}
#heading{
height: 250px;
}
#wrapper{
width: 600px;
height: 600px;
margin-left: auto;
margin-right: auto;
}
#container{
border: solid 1px;
display: grid;
grid-template-columns: auto auto auto auto;
height: 600px;
width: auto;
}
.squares{
border: solid 1px rgba(0, 0, 0, 0.3);
}
<div id="container">
</div>
如 anoop rana 指出,只能默认特殊会员函数,并且,AS yksisarvinen 仅适用于内置类型。
超载运营商的冗余是一个长期以来的问题。
提供CRTP的常见过载,
包括操作员 - &gt;模仿内置行为:
#include <boost/operators.hpp>
struct S { int m;};
struct P : boost::dereferenceable< P, const S*>
{ auto& operator*() const { return s;}
S s;
};
int main()
{ P p;
p->m;
}
不幸的是,需要拼写返回类型。
(不应需要恕我直言。)
独自一人并不是向前迈出的一大步,但是
它被捆绑在通常需要的组中,例如 input_iteratable
。
当您想执行此操作时?
如果您想在ngoninit中使用此命令,此错误将为您出现。
您可以在ngafterviewinit上使用它,也可以在settimeout上使用它,例如
settimeout(()=&gt; {this.fileinput.click();},500);
>
我尚未设法获得 image_dataset_from_directory
可以开箱即用的多标签。我最终要做的是创建一个没有标签的数据集,例如:
ds = tf.keras.utils.image_dataset_from_directory(
image_dir,
labels=None,
...
)
然后,我将手动创建的多标签列表划过以下:
ds = tf.data.Dataset.zip((ds, tf.data.Dataset.from_tensor_slices(labels_list)))
根据此文档 它说,它说,它说,
HTTP :// localhost:portnumber
该请求将发送到同一设备,我们按照此 msdoc localhost重定向uris有一些例外
可接受的参考文献:
https://www.ionos.com/digitalguide/server/server/know-how/localhost/
https://learn.microsoft.com/en-us/azure/azure/active-directory/develop/develop/reply-rreply-url #localhost-exceptions
As per this Document it says,
http://localhost:portnumber
the request will be sent to the same device where we are accessing the appAs per this MSDoc there are some exceptions for localhost redirect URIs
Taken References from:
https://www.ionos.com/digitalguide/server/know-how/localhost/
https://learn.microsoft.com/en-us/azure/active-directory/develop/reply-url#localhost-exceptions
什么是“ localhost” Azure重定向URL中的服务器