virtual-address-space 相关问题


表单响应:“无法处理请求 HTTP ERROR 500”。我做错了什么?

我尝试在网站上编写 php 表单,但收到错误 500。我无法弄清楚我做错了什么。你能看一下代码看看我做错了什么吗? PHP: 我尝试在网站上编写 php 表单,但收到错误 500。我无法弄清楚我做错了什么。你能看一下代码看看我做错了什么吗? PHP: <?php // define variables and set to empty values $name = $email = $phone = $enquiry = ""; if ( $_SERVER[ "REQUEST_METHOD" ] == "POST" ) { if ( empty( $_POST[ "name" ] ) ) { $nameErr = "Name is required"; } else { $name = test_input( $_POST[ "name" ] ); // check if name only contains letters and whitespace if ( !preg_match( "/^[a-zA-Z-' ]*$/", $name ) ) { $nameErr = "Only letters and white space allowed"; } } if ( empty( $_POST[ "email" ] ) ) { $emailErr = "Email is required"; } else { $email = test_input( $_POST[ "email" ] ); // check if e-mail address is well-formed if ( !filter_var( $email, FILTER_VALIDATE_EMAIL ) ) { $emailErr = "Invalid email format"; } } if ( empty( $_POST[ "phone" ] ) ) { $comment = ""; } else { $comment = test_input( $_POST[ "phone" ] ); } if ( empty( $_POST[ "enquiry" ] ) ) { $comment = ""; } else { $comment = test_input( $_POST[ "enquiry" ] ); } } // Create the email and send the message $destination = "[email protected]"; $subject = "Website Contact Form Enquiry: $name"; $body = "You have received a new message from your website contact form.\\n\\n"."Here are the details:\\n\\nName: $name\\n\\nEmail: $email\\n\\nPhone: $phone\\n\\nEnquiry:\\n$enquiry"; $header = "From: [email protected]\\n"; $headers = array(); $headers[] = "MIME-Version: 1.0"; $headers[] = "Content-type: text/plain; charset=iso-8859-1"; $headers[] = "From: " . $fromAddress; $headers[] = "Subject: " . $subject; $headers[] = "X-Mailer: PHP/".phpversion(); mail($destination, $subject, $message, implode("\r\n", $headers)); // mail($to,$subject,$msg,$headers); echo "Email successfully sent."; ?> HTML 格式: <form id="contact-form" method="post" action="/contact.php" role="form"> <div class="messages"></div> <div class="controls"> <div class="row"> <div class="col-md-10"> <div class="form-group"> <input id="form_name" type="text" name="name" class="form-control" placeholder="Name*" required="required" data-error="Your name is required." > <div class="help-block with-errors"></div> </div> </div> <div class="col-md-10"> <div class="form-group"> <input id="form_email" type="email" name="email" class="form-control" placeholder="Email*" required="required" data-error="Valid email is required." > <div class="help-block with-errors"></div> </div> </div> <div class="col-md-10"> <div class="form-group"> <input id="form_phone" type="text" name="phone" class="form-control" placeholder="Phone" > <div class="help-block with-errors"></div> </div> </div> </div> <div class="row"> <div class="col-md-10"> <div class="form-group"> <textarea id="form_enquiry" name="enquiry" class="form-control" placeholder="Enquiry*" rows="6" required="required" data-error="Please, leave us a message."></textarea> <div class="help-block with-errors"></div> </div> </div> <div class="col-md-12"> <input class="btn btn-large btn-primary centre mt-10" type="submit" value="Submit" > </div> </div> </div> </form> 我已按照其他人的指示使表单正常工作,但所做的更改仍然会出现错误。 这是一个简单的形式,但我似乎对我做错了什么缺乏了解。 请帮助我。 如果您查看发送邮件的行,这是一个硬行结尾,将 $headers 推到新行上吗?这将调用 500 错误。 查看 /var/log/apache2/error.log(如果您使用的是 Debian)或 /var/log/httpd/error.log(如果使用的是 RHEL 或类似系统)。 您的代码存在许多问题,但首先关注快乐的道路,然后让事情正常运行。


在 iPhone 中打开时,“城市”被检测为电子邮件中的关键字

我已经创建了用 PHP 发送邮件的 API。下面是我的代码 $content = $content."地址: ".$fromUser["address"]; $内容 = $内容。” 我已经创建了 API 来用 PHP 发送邮件。下面是我的代码 $content = $content."<br/><b>Address : </b>".$fromUser["address"]; $content = $content."<br/><b>City : </b>".$fromUser["city"]; $to = '[email protected]'; include('PhpMailer/class.phpmailer.php'); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPAuth = TRUE; $mail->SMTPSecure = "ssl"; $mail->Host = "smtp.gmail.com"; $mail->Port = 465; $mail->Username = "####"; $mail->Password = "####"; $mail->setFrom("[email protected]","abc"); $mail->isHTML(true); $mail->AddAddress($to); $mail->Subject = 'Test'; $mail->MsgHTML($content); if ($mail->Send()) { return 1; } else { return 0; } 我收到电子邮件,但内容中的关键字“城市”显示超链接。我想删除它。 [注意:如果我写“City1”而不是“City”,则链接将被删除] 您的 $fromUser["address"] 以 标签开头,但变量内没有标签结尾。 一种方法是为输出添加 stript_tags() 。 $content = $content."<br/><b>Address : </b>".strip_tags($fromUser["address"]); $content = $content."<br/><b>City : </b>".strip_tags($fromUser["city"]); 更好的方法是在用数据填充 $fromUser 变量时就剥离标签。


以 11 岁孩子的身份解释一下我 - C++ 中的函数指针

请解释一下为什么我应该使用它,当它可能有用时? 当我将它赋予其他函数的参数时,我理解将其用作回调函数,但是有一个关键字“virtual&...


任何人都可以帮助我避免在应用程序上使用模拟位置时被检测到吗,我已经反编译并粘贴了其中的代码,smali 文件

.第 1854 行 invoke-virtual {p1}, Landroid/location/Location;->isFromMockProvider()Z 移动结果 p1 转到:goto_6 .1856号线 :条件_d iget-object p1、p0、Lcom/bel/HYS/FileexplorerActivity$


带有空格的列名称 - Athena

我正在尝试使用 Athena 控制台创建一个列名称为 Space 的表。 示例:“Mag Creative”字符串 错误:此字段为必填字段。不允许有空格!


flink sql 作业抛出 no space left 异常,尽管有足够的空间可用

Flink 版本:1.17.1 环境:EKS Flink Kubernetes Operator Flink SQL 作业,rocksdb 后端的检查点状态小于 10GB。 我们将实例类型从 m5d.2xlarge 更改为 r5d.xl...


为什么我会收到堆释放后使用错误?

为什么我会出现分段错误?当我使用 sanitize=address 进行编译时,我得到了一个我不太明白的堆使用后释放(原因)。 我在地址 xyz 上得到堆释放后使用。 重新...


更改动态表单控制角度的值

我有这个动态表单控件 我有这个动态表单控件 <form [formGroup]="dynamicFormGroup" (ngSubmit)="onSubmit()" > <div class="row" formArrayName="address" *ngFor="let fields of AddressInfo.controls; let i = index"> <ng-container [formGroupName]="i"> <input type="number" class="form-control height-reset" placeholder="Enter Mobile" name="mobile" formControlName="mobile" /> .. </form> 当我尝试更改字段的值时 this.dynamicFormGroup.controls['mobile'].setValue(''); 或 this.dynamicFormGroup.patchValue({ mobile: '444' }); 该值未更新 任何解决方案谢谢 我认为问题在于您在 formGroup 内的 FormArray 内使用 FormControl。 (只需查看简短的代码片段即可) 所以你的代码应该看起来像这样; this.dynamicFormGroup.controls[index].controls['mobile'].setValue(''); <ng-container [formGroupName]="i">也可能会破坏它。 我建议修改表格的结构,然后找到每个表格的正确“路径”。 就您而言,不清楚 AddressInfo 是什么。相反,将您的代码更改为: <div class="row" formArrayName="address" *ngFor="let fields of addressFormArray.controls; let i = index"> <ng-container [formGroupName]="i"> <input type="number" class="form-control height-reset" placeholder="Enter Mobile" name="mobile" formControlName="mobile"> </ng-container> </div> get addressFormArray() { return this.formMain.get('address') as FormArray; } 用户现在可以添加值。 如果您计划以编程方式编辑该值,则 this.dynamicFormGroup.controls['mobile'].setValue(''); 将不起作用,因为 mobile 是 FormArray 中的 FormControl。然后,要么循环遍历该数组以更改所有值,要么必须澄清应该更改哪个值。


替换字符串后在 echo 中运行额外的 php 代码

我想在替换表单中的一些字符串后执行附加的php代码 这是我在 form.php 上的表单代码 我想在替换表单中的一些字符串后执行附加的php代码 这里是我在 form.php 上的表单代码 <form method="post" action="result.php"> <input type="text" name="yourtext"> <input type="submit"> </form> 例如文本是 my name is bagu and i live under a rock thanks 这里是 result.php 代码 <?php $mytext = $_POST['yourtext']; $find = ["my name is","and i live", "thanks"]; $replace = ["<?php open_form('Form/insert') ?><input name='name' type='text' value='","'><br><input name='address' type='text' value='","'><input type='submit'><?php form_close() ?>"]; $intoform = str_replace($find, $replace, $mytext); echo $intoform; ?> 我想要的结果是“bagu”和“under a rock”分别在一个正在工作的文本框中 但问题是 echo 中的 php 代码不起作用(我认为???因为它是) 是的,这是 codeigniter 的表格 谢谢 ====== 编辑:我尝试了没有 echo 和变量的 result.php ,也就是我在 form.php 中提交文本后想要的结果 <?php open_form('Form/insert') ?> <input name='name' type='text' value='bagu'><br> <input name='address' type='text' value='under a rock'> <input type='submit'> <?php form_close() ?> 并且如果“ 使用 preg_match 提取姓名和地址。 die 子句仅用于指示输入字符串格式错误,可以根据需要替换为更友好的提示。 preg_match('/my name is (.+) and i live (.+) thanks/', $mytext, $m) or die('Input text is invalid'); 如果preg_match成功,$m[1]将包含名称,$m[2]将包含地址,然后您可以将值插入表单 <?php open_form('Form/insert') ?> <input name='name' type='text' value='<?=$m[1]?>'><br> <input name='address' type='text' value='<?=$m[2]?>'> <input type='submit'> <?php form_close() ?> 需要补充的是,在实际操作中,应检查用户输入的姓名和地址的合法性。例如,要限制它们仅包含字母和空格,第一步中的正则表达式 (.+) 可以更改为 ([A-Za-z ]+)。


读取带有Java流中其他属性的嵌套列表

我有一个对象列表,例如 Person 依次有几个列表,其中很少有通用属性,如下所示 列表 地址1 = List.of("1","2","5","6& 我有一个对象列表,例如 Person 依次有几个列表,其中很少有通用属性,如下所示 List<Address> address1 = List.of("1","2","5","6") List<Address> address2 = List.of("3","4") List<Email> email1 = List.of("[email protected]","[email protected]", "[email protected]") List<Email> email2 = List.of("[email protected]", "[email protected]") Person person1 = new Person("smith",22, address1, email1) Person person2 = new Person("Alex",30, address2, email2) List<Person> person = List.of(person1, person2) 我想迭代人员列表并获取地址和电子邮件对象的其他两个嵌套列表大小的大小。在上面的例子中,地址大小=6,电子邮件=5,我想返回 是否有可能在单次迭代中在Java流中实现这一点? 是否可以在单次迭代中在 Java 流中实现此目的? 如果您指的是一个循环或类似的构造,是的。如果你的意思是一些 O(1) 解决方案,不!无论是命令式还是声明式完成,都会在某个地方出现迭代。最简单的方法如下: int emailCount = 0; int addressCount = 0; for (Person person : persons) { emailCount += person.email.size(); addressCount += person.address.size(); } System.out.println(emailCount); System.out.println(addressCount); 打印 5 6 这也可以通过流来完成,但开销更大。


带有边框半径和粘性标题的 HTML 表格

我有一个 HTML ,带有边框半径和使用位置的粘性标题:sticky,如下所示: https://codepen.io/muhammadrehansaeed/pen/OJpeeKP 但是,当使用 滚动时 我有一个带有 <table> 的 HTML border-radius 和使用 position: sticky 的粘性标题,如下所示: https://codepen.io/muhammadrehansaeed/pen/OJpeeKP 但是,当使用粘性标题滚动时,表格行会伸出粘性标题的圆角所在的位置。请参阅此图片的左上角: 有没有办法可以在使用粘性标题向下滚动时保持圆角,或者在标题变得粘性并从原始位置向下移动时删除粘性标题?理想情况下,我想要一个CSS解决方案。 您可以使用伪元素隐藏边框的某些部分: table thead th:first-child::before, table thead th:last-child::after { width: 1px; height: 5px; background: white; content: ""; display: block; position: absolute; top: 0px; } table thead th:first-child::before { left: -1px; } table thead th:last-child::after { right: -1px; } 正如Ivan建议的那样,似乎使用伪元素来覆盖标题下方不需要的边框是(令人惊讶的)唯一可行的选择。我建议使用伪不仅用于覆盖“外部”区域,而且还用于绘制弧线和填充“内部”区域。可以使用堆叠背景来做到这一点。应用于原始代码: /* § Additions / Changes */ table thead th { position: relative; } /* Pseudos exceeding header boundary by border width; with rectangle covering half circle and rest of height */ table thead th:last-child::after, table thead th:first-child::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(-1 * var(--global-border-width-1)); width: var(--global-border-radius); background-image: linear-gradient(to bottom, transparent var(--global-border-radius), var(--global-title-color) 0), radial-gradient(circle at var(--global-border-radius) var(--global-border-radius), var(--global-title-color) var(--global-border-radius), var(--global-content-background-color) 0); background-position: top left; background-size: var(--global-border-diameter) 100%, var(--global-border-diameter) var(--global-border-diameter); background-repeat: no-repeat; } table thead th:last-child::after { left: auto; right: calc(-1 * var(--global-border-width-1)); background-position: top right; } /* § Declarations and original style */ html { --global-content-background-color: white; --global-title-color: black; --global-background-color: lightblue; --global-border-color: black; --global-border-radius: 20px; --global-border-width-1: 10px; --global-space-fixed-2: 10px; --global-space-fixed-3: 15px; --global-border-diameter: calc(2 * var(--global-border-radius)); background-color: var(--global-content-background-color); } table { color: var(--global-title-color); background-color: var(--global-content-background-color); border-collapse: separate; border-color: var(--global-title-color); border-style: solid; border-radius: var(--global-border-radius); border-width: 0 var(--global-border-width-1) var(--global-border-width-1) var(--global-border-width-1); border-spacing: 0; width: 100%; } table thead { position: sticky; top: 0; z-index: 10; } table thead th { color: var(--global-background-color); background-color: var(--global-title-color); padding: var(--global-space-fixed-2) var(--global-space-fixed-3); vertical-align: bottom; } table tbody td { border-top: var(--global-border-width-1) solid var(--global-border-color); padding: var(--global-space-fixed-2) var(--global-space-fixed-3); vertical-align: top; } table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--global-border-radius); } table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--global-border-radius); } /* § Unrelated / demo */ * { scroll-margin-top: calc(var(--global-space-fixed-2) * 4 + 1rem); /* = height of sticky thead + top padding of cell, provided text in thead does not wrap */ scroll-margin-bottom: 1em; } td { height: 60vh; } td a { float: right } tr:last-child td { vertical-align: bottom; } a[name]:empty::before { content: attr(name); } th:not(#\0):hover::before { background-image: linear-gradient(to bottom, transparent var(--global-border-radius), #0F08 0), radial-gradient(circle at center, #00F8 var(--global-border-radius), #F2F4 0); background-position: top left; background-size: var(--global-border-diameter) 100%, var(--global-border-diameter) var(--global-border-diameter); } <table> <thead> <tr> <th>Fake non-transparent "border-radius"</th> </tr> </thead> <tbody> <tr> <td> <a href="#⬆️" name="⬇️"></a> For fixed header</td> </tr> <tr> <td> <a href="#⬇️" name="⬆️"></a> Using CSS stacked background images in pseudo elements</td> </tr> </tbody> </table> 只需从表格中删除边框,并为表格主体中的第一个和最后一个表格单元格添加左右边框: tbody td:first-child { border-left: 1px solid black; } tbody td:last-child { border-right: 1px solid black; } tbody tr:last-child td{ border-bottom: 1px solid black; } tbody tr:last-child td:first-child { border-bottom-left-radius: 2px; } tbody tr:last-child td:last-child { border-bottom-right-radius: 2px; } 当然是使用适当的缩进、嵌套和变量! 使用许多伪选择器看起来样式相当丑陋,但似乎可以解决您的问题。 有一个更紧凑的解决方案。只需将具有背景颜色的框阴影添加到第一个 < th > 和最后一个 < th > 即可隐藏元素。 在此示例中,在右侧,您可以看到表格行由于边框半径而可见。在左边,我应用了盒子阴影。 盒子阴影:0 -2.1rem 0 .6rem #E5E7EB; 在这里,它是灰色的,以便您可以看到它的工作原理,但您只需使用与背景相同的颜色即可使其完全不可见。 这是最终结果以及我正在使用的代码: th:第一个孩子 { 边界半径:0.75rem 0 0 0; 左边框:.1rem 实心 $color-gray-200; 框阴影:0 -2.1rem 0 .6rem $color-gray-200; } th:最后一个孩子{ 边界半径:0 0.75rem 0 0; 右边框:.1rem 实心 $color-gray-200; 盒子阴影:1rem -2.1rem 0 .6rem $颜色白色; } 可能需要调整框阴影以隐藏基于所选边框半径的行。 不确定你是否熟悉jquery,如果熟悉的话你可以在滚动内容时动态更改 border-top-left-radius: 等于粘性标题的半径,但这对于新手来说有点棘手jquery/JS。 其次,您可以将粘性标题封闭到父级(例如class="parent")),并将父级背景设置为白色,没有边框。并保持粘性标题的边框半径不变。因此,当您滚动内容时将位于该父级下方(例如 class="parent")。为了确保父级出现在该行上方,您可以给出 z-index: 10


如何在 Abap Simple Transformation 中添加 XML 命名空间

我使用简单转换从内部表中获取 XML。这是输出 XML。 我使用简单转换从内部表中获取 XML。这是输出 XML。 <?xml version="1.0" encoding="UTF-8"?> <Complement> <Document Doc="AAA"> <Locations> <Location> <Origin RFC="URE180429TM6"/> <Address Country="SOME_COUNTRY" /> [....] </Location> </Locations> <Products NumTotal="1"> <Product ValorProduct="12164501" /> [....] </Product> </Products> [....].... </Document> </Complement> 但是现在我需要做的是更改一些 XML 元素名称(重命名它们)..这应该使我的 XML 看起来像这样: 例如,我需要第一个元素(补语)看起来像 cfdi:Complement (在 cfdi 和补语之间使用冒号 :)...等等等等 <cfdi:Complement> <document:Document Doc="AAA"> <document:Locations> <document:Location> <document:Origin RFC="URE180429TM6"/> <document:Domicilio Country="NIGERIA" /> [....] </document:Location> </document:Locations> <document:Products NumTotal="1"> <document:Product ValorProduct="12164501" /> [....] </document:Product> </document:Products> [....].... </document:Document> </cfdi:Complement> 我一直在尝试直接从简单转换代码更改元素名称,但它不起作用: <?sap.transform simple?> <tt:transform xmlns:tt="http://www.sap.com/transformation-templates" xmlns:ddic="http://www.sap.com/abapxml/types/dictionary" xmlns:def="http://www.sap.com/abapxml/types/defined"> <tt:root name="COMPLEMENT" type="ddic:ZCOMPLEMENT"/> <tt:template> <tt:namespace name="cfdi"/> <tt:namespace name="document"/> <cfdi:Complement> "<----- I get error from this lines <document:Document> "<----- I get error from this lines <tt:attribute name="Doc" value-ref=".COMPLEMENT.DOCUMENT.DOC"/> <document:Locations> <Location> <Origin> <tt:attribute name="RFC" value-ref=".COMPLEMENT.DOCUMENT.LOCATIONS.LOCATION.ORIGIN.RFC"/> [....] </Origin> <Address> <tt:attribute name="Country" value-ref=".COMPLEMENT.DOCUMENT.LOCATIONS.LOCATION.ADDRESS.COUNTRY"/> [....] </Address> </Location> </Locations> <Products> <tt:attribute name="NumTotal" value-ref=".COMPLEMENT.DOCUMENT.PRODUCTS.NUMTOTAL"/> <Product> <tt:attribute name="ValorProduct" value-ref="VALORPRODUCT"/> [....] </Product> </Products> [....].... </Document> </Complement> </tt:template> </tt:transform> 这些是我得到的错误: undeclared namespace prefix 'cfdi' 和 undeclared namespace prefix 'document' 这是简单的转换代码: 我只需要更改Element的名称即可。但我不认为这比看起来更难。 请帮我解决这个问题。我是这个 Abap 世界的新人。或者任何想法都会对我有很大帮助。问候 我之前遇到过一些命名空间问题,也许这个线程有帮助。 这是参考代码。正如您所看到的,您必须定义名称空间并按定义方式使用它,此处为 ns1。 <tt:template> <top_element xmlns:ns1="xsd/namespacesForBoxes" xmlns:ns2="xsd/namespacesForCartons" xmlns:ns3="xsd/namespacesForPallets"> <tt:namespace name="ns1"/> <tt:namespace name="ns2"/> <tt:namespace name="ns3"/> <tt:cond s-check="not-initial(ref('.telegram.BOX_ID'))"> <ns1:container> <tt:attribute name="box-id" value-ref=".telegram.BOX_ID"/> </ns1:container> </tt:cond> <tt:cond s-check="not-initial(ref('.telegram.CARTON_ID'))"> <ns2:container> <tt:attribute name="carton-id" value-ref=".telegram.CARTON_ID"/> </ns2:container> </tt:cond> <tt:cond s-check="not-initial(ref('.telegram.PALLET_ID'))"> <ns3:container> <tt:attribute name="pallet-id" value-ref=".telegram.PALLET_ID"/> </ns3:container> </tt:cond> </top_element> </tt:template> 之后应该是这样的: <top_element xmlns:ns1="xsd/namespacesForBoxes" xmlns:ns2="xsd/namespacesForCartons" xmlns:ns3="xsd/namespacesForPallets"> <ns1:container box-id="BOX"/> <ns2:container carton-id="CARTON"/> <ns3:container pallet-id="PALLET"/> </top_element> “tt:cond”只是为了让丢失的 XML 标签或不同顺序的标签不会扰乱你的转换。


NextJS 中 useFormStatus() 始终为 false

我尝试使用 useFormStatus() 在提交表单并等待获取数据时动态更改 UI。 我有一个像这样的表单组件 函数 onSubmit(数据:z.infer 我正在尝试使用 useFormStatus() 在提交表单并等待获取数据时动态更改 UI。 我有一个像这样的表单组件 function onSubmit(data: z.infer<typeof FormSchema>) { requestImg(data).then((imageStringify) => { const binaryData = Buffer.from(imageStringify.image); const imageBase64 = URL.createObjectURL( new Blob([binaryData.buffer], { type: "image/jpeg" } /* (1) */) ); setOpen(true); setSource(imageBase64); }); } if (isDesktop) { return ( <Form {...form}> <form onSubmit={form.handleSubmit(onSubmit)} className="w-2/3 space-y-6" > ... 其中 requestImg(data) 是服务器操作。 然后,我将 Button 组件嵌套在不同的 Button.tsx 文件中的 <form> 中 import { useFormStatus } from "react-dom"; import { Button } from "@/components/ui/button"; export default function ButtonSub() { const { pending } = useFormStatus(); console.log(pending); return ( <Button className="w-full" type="submit" aria-disabled={pending}> {pending ? "Processing..." : "Submit"} </Button> ); } 问题是,当我单击提交时,按钮文本不会更改为“正在处理...” 编辑 似乎仅当您在表单上使用操作关键字时才有效。我试过了 <form action={async (formData: FormData) => { requestImg(formData).then((imageStringify) => { const binaryData = Buffer.from(imageStringify.image); const imageBase64 = URL.createObjectURL( new Blob([binaryData.buffer], { type: "image/jpeg" } /* (1) */) ); setSource(imageBase64); setOpen(true); }); }} className="w-2/3 space-y-6" > 但是现在使用 byte8Array 生成的图像已损坏。 我有一个带有动态 src 的图像,其中充满了 const [source, setSource] = useState(""); <img src={source}/> 似乎只有在您使用 action 关键字时才有效 形式。 确实如此。 useFormStatus 必须在表单的子组件内使用,它可以监视服务器操作的状态变化。但据我所知,它会监听 action。 action 定义提交后表单数据的服务器端目的地。在服务器操作的上下文中,服务器操作向当前 URL 发出 post 请求。所以它没有监听表单 onSubmit,这就是为什么你的第一个代码执行不起作用。 现在服务器操作在服务器上下文中运行,它们在服务器上执行,但setState是客户端特定的代码


如何使用 XSLT 删除基于值的特定 XML 元素

假设我们有要转换的 XML: 测试 / 假设我们有要转换的 XML: <?xml version="1.0" encoding="UTF-8"?> <node> <field1>test</field1> <field2>/</field2> <field3>test2</field3> <field4>/<field4> </node> 我想使用 XSLT 1.0 对其进行转换,以便复制整个结构和所有值,除了具有值“/”的元素。 到目前为止,我已经找到了这个,我认为这离我需要的并不遥远,但它还没有工作。 <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:strip-space elements="*"/> <xsl:output indent="yes"/> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="//text()='/'" /> </xsl:transform> 所以我期望的输出是这样的: <?xml version="1.0" encoding="UTF-8"?> <node> <field1>test</field1> <field3>test2</field3> </node> 尝试此操作时,我收到未指定的错误(因为我正在使用免费的在线工具进行转换)。 //text()='/' 不是有效的位置路径。 在任何情况下,您想要删除元素,而不是文本节点 - 所以您应该使用类似的东西: <xsl:template match="*[.='/']" />


Valgrind:仅对于较大的输入值,地址 0x0 不会被堆栈、分配或(最近)释放

我正在尝试实现 Dijikstra,这是我拥有的图形生成代码 #包括 #包括 #包括 #包括 我正在尝试实现 Dijikstra,这是我拥有的图形生成代码 #include <stdlib.h> #include <stdio.h> #include <limits.h> #include <math.h> #define MAX 300 int main (int argc, char *argv[]){ int v = atoi(argv[1]); int SIZE = v*v; int* adjMatrix = malloc(sizeof(int)* SIZE); graphGeneration(adjMatrix, v); free(adjMatrix); return 0; } void graphGeneration(int* adj, int numV){ int i, j, r; for(i = 0; i< numV; i++){ for(j=0; j < numV; j++){ if(i == j){ adj[i * numV + j] = 0; } else{ r = rand() % MAX; adj[i * numV + j] = r; adj[j * numV + i] = r; } } } } 当我尝试输入 1000 的 v 值时,它似乎工作正常,但是当我尝试输入 v = 10,000+ 的值时,我遇到了段错误(特别是我注意到的数字是 50,000)。运行 valgrind 会导致我在该方法的标题中出现错误。 为了方便起见,重新发布在这里: Invalid write of size 4 at 0x400800: graphGeneration by 0x4006E3: main Address 0x0 is not stack'd, malloc'd or (recently) free'd Access not within mapped region at address 0x0 有人对如何调试这个有任何想法或者这里是否有任何明显的错误? 我也在 valgrind 中注意到了这一点 Warning: silly arg (-7179869184) to malloc() 我不确定这是否相关,但这似乎也是一件奇怪的事情。 看看一些 malloc() 手册:它的参数是 size_t 类型是有原因的。 int 不能保证容纳任何可能的对象大小,size_t 可以。顺便说一句,它是无符号的——负大小没有多大意义。 所以就写吧 size_t SIZE = ((size_t)v) * v; 因为你的 v 是一个 int 你必须通过强制转换参数之一来强制这个乘法作为 size_t 完成。 稍微好一点的方法是将 v 制作为 unsigned long 并使用 strtoul() 代替 atoi()。 然后,在使用之前检查您的malloc()的结果。即使使用正确的大小参数,它仍然可能返回 NULL。如果是这样,这仅仅意味着您当时没有足够的可用内存。 毕竟,使用 v=10000 并假设 int 占用四个字节(这很常见),您已经尝试一次分配 400 MB。 他是中本聪..但是这是构建项目的投资组合 不要试图理解这一点..这会让你很快发疯..


如何在React Prime DataTable中添加超链接?

我有一个数据表,我正在使用 React prime 库, 我的要求是在一个特定列中添加一个链接。 我有一个数据表,我正在使用 React prime 库, 我的要求是在一个特定列中添加一个链接。 <DataTable paginator rows={tableRowPage} value={products} tableStyle={{ minWidth: "30rem" }} ><Column key={field} field={field} header={header} style={{ width: "25%" }} /> </DataTable> 我需要特定单元格中的超链接 我在数据表中遇到了同样的问题,不幸的是,根据我的研究,他们似乎不提供对此的支持。 但是,我已经设法通过这种方式解决了这个问题: 数据表添加链接逻辑: <Column field="code" header="Code" body={(rowData) => { return ( <div sx={{ display: "flex", justifyContent: "space-between", alignItems: "center", }} > <div style={{ color: "#3F00FF", textDecoration: "underline", cursor: "pointer", "&:hover": { color: "#23297A", }, }} onClick={() => window.open("www.google.com", "_blank").focus()} > {rowData.code} </div> </div> ); }} ></Column>; 我已经使用 Prime React Column 组件中的 body 渲染了数据。我应用 CSS 将其设置为链接样式,并添加了 onClick 事件以进行重定向。您可以根据您的要求修改逻辑。 完整代码链接:https://codesandbox.io/s/primereact-demo-forked-kqtdvs?file=/src/App.jsx 如果您还有任何疑问,请告诉我。


显示多行文本的正确方法是什么?

我有一个 HTML 文档,其中有一些不同的文本行,是否有一些确定的正确方法来显示它们? 例子: 这里有 一些线路 文本的 我应该为每一行使用 标签,还是...... 我有一个 HTML 文档,其中包含一些不同的文本行,是否有一些确定的正确方法来显示它们? 示例: Here are some lines of text 我应该为每一行使用 <p> 标签,还是有其他/更好的方法来做到这一点? 示例: <p>Here are</p> <p>some lines</p> <p>of text</p> 或 <p> Here are <br> some lines <br> of text <br> </p> 或者完全不同的东西? CSS 和其他东西目前并不真正相关,我只是想知道哪种是“最正确”的使用方式。 如果您想在 div 中显示包含新行的字符串,则可以使用 white-space: pre-wrap css 样式: .multiline { white-space: pre-wrap; } <div class="multiline"> A multiline text for demo purpose </div> 或者你可以尝试this而不用标签换行每行: <div style="white-space:pre"> Here are some lines of text </div> 正确的做事方法是使用为你需要的东西而制作的东西。 如果您想要换行(输入),请使用 <br>; 如果要定义段落,请使用 <p>。 根据this,<br>元素用于插入换行符而不开始新段落。因此,与第一个解决方案相比,您应该更喜欢第二个解决方案。 w3schools 附带了一篇关于风格指南和编码约定的精彩文章。 规范非常清楚地表明,永远不要使用<br>,除非换行符实际上是形成单个文本单元的内容的一部分。 由于这些是不同的文本行,而不是恰好包含换行符的单个单元,因此需要将它们拆分为单独的 <p> 元素。 不存在最正确的方式,至少根据您当前的需求规范。是的,您可以使用 <p></p> 标签将它们全部放在单独的段落中,或者您可以通过每行的 <br> 标签将它们分开。您还可以将 span 与空白 CSS 属性结合使用,这样您就有很多选择。要选择最适合您的选项,您需要尝试一下,看看什么最适合您的要求。 如果您想创建一个多行段落来保持代码中的行分隔,而不到处乱扔。只需使用 html 标签即可。 使用 <pre> 标签就是您想要的: <pre> Text in a pre element is displayed in a fixed-width font, and it preserves both spaces and line breaks </pre> “pre”代表“预格式化文本” https://www.w3schools.com/tags/tag_pre.asp


如何使整个跨度落入新行?

这个片段显示了我想要的: http://jsfiddle.net/945Df/3/ 阿根廷圣达菲罗萨里奥。 这个片段显示了我想要的: http://jsfiddle.net/945Df/3/ <div class="sup" id="pr"> <strong> <a href="#">Rosario, Santa Fe, Argentina.</a> <span class="date">17 de septiembre de 2013.</span></strong> </div> <div class="sup"> <strong> <a href="#">Rosario, Santa Fe, Argentina.</a> <span class="date">17 de septiembre de 2013.</span> </strong> </div> 当div的宽度(在项目中,视口)没有更多空间时,我希望跨度落入新行。 抱歉我的解释不好。我不知道该怎么做。谢谢! 编辑:在第二个示例中,短语“SEPTIEMBRE DE 2013”。落入新行。但“17 DE”字样仍位于上行。我想要“2013 年 9 月 17 日”。落入新行。明白了吗? 如果您希望跨度不换行,而是完全移动到其他文本下方,您可以使用 white-space: nowrap; .date { text-transform: uppercase; color:#848484; white-space:nowrap; } 演示 要让span在空间不足时跳到下一行,可以设置为display: inline-block; .date { display: inline-block; ... } 检查这个:http://jsfiddle.net/945Df/7/ 这就是我实现它的方法: #spantomovedown{ clear: both; display: inline-block; width: 100%; } .date{display:inline-block;} 当日期比div长时,换行显示 示例:http://jsfiddle.net/TqRyK/ 如果你漂浮:对;当不再有空间容纳整个内容时,它应该落到下一行。 之后您将需要一个清除元件。 我通过以下方式实现了它 word-wrap: break word;


Google 识别的 JSON LD 格式的 Schema.org,但 Facebook Pixel Helper 无法检测到它

我使用添加了JSON LD格式的schema.org标签,当我使用Google结构化数据测试工具测试我的页面时,我可以看到我的所有标签。 但是,当我安装 Facebook Pixel Helper 时 </desc> <question vote="15"> <p>我使用<pre><code>JSON LD</code></pre>以<pre><code>&lt;script&gt;</code></pre>格式添加了schema.org标签,当我使用<a href="https://search.google.com/structured-data/testing-tool/u/0/" rel="noreferrer">Google结构化数据测试工具</a>测试我的页面时,我可以看到我的所有标签。</p> <p>但是,当我安装 <a href="https://chrome.google.com/webstore/detail/facebook-pixel-helper/fdgfkebogiimcoedlicjlajpkdmockpc?hl=en" rel="noreferrer">Facebook Pixel helper chrome 扩展</a> 来测试我的页面时,schema.org 标签显示为空白。不知道为什么 Facebook Pixel Helper 无法检测到它。</p> <p>非常感谢任何帮助。</p> </question> <answer tick="false" vote="9"> <p>我发现Facebook Pixel对结构化数据的解析更加严格。字段中的空白换行将导致它发出警告。当我在地址中进行换行时,我就发生了这种情况。谷歌正确解释了该地址,但 Facebook Pixel 在控制台中发出了警告。</p> <p>添加以下代码解决了我的情况:</p> <pre><code>$address = preg_replace( &#34;/\r|\n/&#34;, &#34; &#34;, $address ); </code></pre> <p>当然,正如这里指出的那样<a href="https://stackoverflow.com/questions/2392766/multiline-strings-in-json">JSON不支持真正的换行符</a>。</p> </answer> <answer tick="false" vote="3"> <p>聚会迟到了,但对于来这里的人来说仍然如此。 FB Pixel 现在支持 JSON-LD:<a href="https://www.facebook.com/business/help/1175004275966513" rel="nofollow noreferrer">https://www.facebook.com/business/help/1175004275966513</a></p> </answer> <answer tick="false" vote="3"> <p>对我来说,多个空格都有错误(据我所知)。 <br/>因此,我使用这段代码:</p> <pre><code>$description = preg_replace(&#34;#\r|\n|(\s+)#iu&#34;, &#34; &#34;, $description); </code></pre> </answer> <answer tick="false" vote="0"> <p>JSON 扩展还为所有其他网页添加了 JSON-LD 格式的架构标记,这是 Google 喜欢的。 “Facebook Pixel”不读取架构元标签或 JSON-LD(Pinterest 读取架构元标签,但不读取 JSON-LD)。</p> <p>听起来您可能有点困惑 – Facebook 不读取架构标记 – Facebook 读取开放图元标签。您可以在这里找到该标准的详细信息:<a href="http://ogp.me/" rel="nofollow noreferrer">http://ogp.me/</a>。</p> <p>仅供参考 <a href="https://www.withintheflow.com/facebook-pixel-helper/" rel="nofollow noreferrer">https://www.withintheflow.com/facebook-pixel-helper/</a></p> </answer> <answer tick="false" vote="0"> <p>您可能碰巧在 init 调用中有 <pre><code>fbq(&#39;set&#39;, &#39;autoConfig&#39;, &#39;false&#39;)</code></pre>。 </p> <p>Facebook Pixel 会将元数据发送到您的 Pixel 设置,但在初始化代码中,如果您将 <pre><code>autoConfig</code></pre> 设置为 <pre><code>false</code></pre>,Facebook Pixel 将不会发送此附加信息。</p> </answer> <answer tick="false" vote="0"> <p>我还使用 Json-LD 脚本标签。就我而言,实际上是在标签开始发送此数据之前移动 Facebook 像素脚本!</p> </answer> </body></html>


使用 libcurl 时出现“SSL CA 证书问题”错误

我使用--openssldir=< path to ssl >/ssl(链接到/etc/ssl)构建了openssl 1.1.1,并使用--with-ssl=< path to openssl >构建了curl 7.76.1。 编译了以下代码: #包括 我使用--openssldir=< path to ssl >/ssl(链接到/etc/ssl)构建了openssl 1.1.1,并使用--with-ssl=< path to openssl >构建了curl 7.76.1。 编译了以下代码: #include <iostream> #include <curl/curl.h> int main() { CURL *curl = curl_easy_init(); if (curl) { struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Accept: */*"); headers = curl_slist_append(headers, "Content-Type: application/json"); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(curl, CURLOPT_URL, "https://<address>"); curl_easy_setopt(curl, CURLOPT_POST, 1); curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "<some data>"); curl_easy_perform(curl); curl_slist_free_all(headers) } curl_easy_cleanup(curl); } 当我运行此代码时,出现错误: curl_easy_operation() failed : Problem with the SSL CA cert (path? access rights?) 我在 strace 中看到,它正在尝试打开“/etc/pki/tls/certs/ca-bundle.crt” 但在我的机器(Ubuntu 12 和 Ubuntu 14)中没有文件夹“/etc/pki”。 为什么curl使用“/etc/pki”而不是“/etc/ssl”?我怎样才能强制它使用“/etc/ssl”? 我尝试使用 --without-nss 构建curl,但没有成功。 编辑: 我的解决方案是添加以下代码: ifstream caBundleFile("/etc/pki/tls/certs/ca-bundle.crt"); if (caBundleFile.good()) { curl_easy_setopt(curl, CURLOPT_CAINFO, "/etc/pki/tls/certs/ca-bundle.crt"); caBundleFile.close(); } else { curl_easy_setopt(curl, CURLOPT_CAPATH, "/etc/ssl/certs"); } 有两种流行的存储根证书的格式。第一个适用于 RHEL/Centos 等,第二个适用于 Ubuntu 等发行版。 对于未来的读者,答案是设置curl CA路径 #include <iostream> #include <curl/curl.h> const std::string curlCertPath = "./keys/curl-ca-bundle.crt"; int main() { CURL *curl; CURLcode res; curl_global_init(CURL_GLOBAL_ALL); curl = curl_easy_init(); if (curl) { curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); curl_easy_setopt(curl, CURLOPT_CAINFO, curlCertPath.c_str()); res = curl_easy_perform(curl); if (res == CURLE_OK) { std::cout << "Curl worked" << std::endl; } else { std::cout << "Error: curl failed: " << curl_easy_strerror(res) << std::endl; } curl_easy_cleanup(curl); } curl_global_cleanup(); return 0; }


.NET MAUI:自定义Shell TitleView并绑定到当前页面标题

我想用我自己的自定义布局替换默认的 Shell 标头,如下所示: 我想用我自己的自定义布局替换默认的 Shell 标头,如下所示: <?xml version="1.0" encoding="UTF-8" ?> <Shell x:Class="MyNamespace.App.AppShell" xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:MyNamespace.App" xmlns:pages="clr-namespace:MyNamespace.App.Pages" BindingContext="{x:Static local:MainView.Instance}" Shell.FlyoutBehavior="{Binding ShellFlyoutType}" x:Name="shellMain"> <Shell.TitleView> <Grid ColumnDefinitions="*,200"> <Label BindingContext="{x:Reference shellMain}" Text="{Binding Path=CurrentPage.Title, Mode=OneWay}" FontSize="Large" TextColor="White" /> <ActivityIndicator IsRunning="{Binding IsBusy}" Color="Orange" Grid.Column="1" HorizontalOptions="End" /> </Grid> </Shell.TitleView> <ShellContent Title=" Login" ContentTemplate="{DataTemplate local:MainPage}" Route="login" FlyoutItemIsVisible="False" /> <ShellContent Title="Dashboard" ContentTemplate="{DataTemplate pages:DashboardPage}" Route="dashboard" /> </Shell> 我无法绑定当前页面标题。 我的 AppShell.xaml Shell 声明如下 <Shell ... x:Name="shellMain"> 作为替代方案,您可以在 OnNaviged 方法中设置 titleview : 在 AppShell.xaml 中,定义标签的名称 <Shell.TitleView> <Grid ColumnDefinitions="*,200"> <Label BindingContext="{x:Reference shellMain}" x:Name="mylabel" FontSize="Large" TextColor="White" /> <ActivityIndicator IsRunning="{Binding IsBusy}" Color="Orange" Grid.Column="1" HorizontalOptions="End" /> </Grid> </Shell.TitleView> 在AppShell.xaml.cs中,重写OnNaviged方法,获取当前项目 protected override void OnNavigated(ShellNavigatedEventArgs args) { base.OnNavigated(args); var shellItem = Shell.Current?.CurrentItem; string title = shellItem?.Title; int iterationCount = 0; while (shellItem != null && title == null) { title = shellItem.Title; shellItem = shellItem.CurrentItem; if (iterationCount > 10) break; // max nesting reached iterationCount++; } myLabel.Text = title; } 希望它对你有用。 我正在尝试同样的方法来修改 TitleView 的外观。它可以在 iOS 上运行,尽管那里还有另一个错误。但在 Android 上我遇到了同样的问题。在前进导航中,它会更新标题,但当您按后退按钮时,标题不会更新。我已经打开了一个问题并添加了一个存储库。 https://github.com/dotnet/maui/issues/12416#issuecomment-1372627514 还有其他方法可以修改TitleView的外观吗? 我使用视图模型开发了这个解决方法,主要不是为了提供 MVVM 解决方案,而是因为其他建议的答案对我不起作用。 (我怀疑 Liqun Shen 2 月 15 日针对他自己的问题的评论中的建议会起作用。但我没有注意到这一点,直到我自己修复)。 当前页面的标题保存在可由 shell 的视图模型和每个内容页面的视图模型访问的类中: public class ServiceHelper { private static ServiceHelper? _default; public static ServiceHelper Default => _default ??= new ServiceHelper(); internal string CurrentPageTitle { get; set; } = string.Empty; } shell 中每个内容页面的视图模型提供其页面标题。为了促进这一点,大部分工作都是由基本视图模型完成的,它们都是从该模型派生而来的: public abstract class ViewModelBase(string title) : ObservableObject { private ServiceHelper? _serviceHelper; public string Title { get; } = title; internal ServiceHelper ServiceHelper { get => _serviceHelper ??= ServiceHelper.Default; set => _serviceHelper = value; // For unit testing. } public virtual void OnAppearing() { ServiceHelper.CurrentPageTitle = Title; } } 每个 shell 内容页面视图模型只需要让其基础视图模型知道它的标题: public class LocationsViewModel : ViewModelBase { public LocationsViewModel() : base("Locations") { } } 每个 shell 内容页面都需要在其视图模型中触发所需的事件响应方法: public partial class LocationsPage : ContentPage { private LocationsViewModel? _viewModel; public LocationsPage() { InitializeComponent(); } private LocationsViewModel ViewModel => _viewModel ??= (LocationsViewModel)BindingContext; protected override void OnAppearing() { base.OnAppearing(); ViewModel.OnAppearing(); } } Shell 的视图模型为标题栏提供当前页面的标题: public class AppShellViewModel() : ViewModelBase(Global.ApplicationTitle) { private string _currentPageTitle = string.Empty; public string CurrentPageTitle { get => _currentPageTitle; set { _currentPageTitle = value; OnPropertyChanged(); } } public void OnNavigated() { CurrentPageTitle = ServiceHelper.CurrentPageTitle; } } Shell 需要在其视图模型中触发所需的事件响应方法: public partial class AppShell : Shell { private AppShellViewModel? _viewModel; public AppShell() { InitializeComponent(); } private AppShellViewModel ViewModel => _viewModel ??= (AppShellViewModel)BindingContext; protected override void OnNavigated(ShellNavigatedEventArgs args) { base.OnNavigated(args); ViewModel.OnNavigated(); } } 最后,Shell 的 XAML 在标题栏/导航栏上显示由 Shell 视图模型提供的当前页面的标题: <Shell.TitleView> <HorizontalStackLayout VerticalOptions="Fill"> <Image Source="falcon_svg_repo_com.png" HeightRequest="50"/> <Label x:Name="CurrentPageTitleLabel" Text="{Binding CurrentPageTitle}" FontSize="24" Margin="10,0" VerticalTextAlignment="Center"/> </HorizontalStackLayout> </Shell.TitleView>


用 Bootsrap 制作的网站右侧的空间不会消失吗?

无论我做什么,我用 Bootsrap 制作的网站右侧的空白都没有消失。如果有解决办法请告诉我 无论我做什么,我用 Bootsrap 制作的网站右侧的空白都没有消失。如果有解决办法请告诉我 <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Contact | Enba Camping</title> <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous"> <link rel="stylesheet" href="style/style.css"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> </head> <body> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script> <!-- NAV --> <div class="container-fluid"> <div class="row"> <div class="col-sm-12 p-0"> <nav class="navbar navbar-expand-lg bg-body-tertiary p-0 "> <div class="container-fluid bg-dark "> <a class="navbar-brand text-light mb-2" href="index.html">Enba Camping</a> <button class="navbar-toggler btn btn-light btn btn-outline-light bg-light m-2" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon "></span> </button> <div class="collapse navbar-collapse" id="navbarNavAltMarkup"> <div class="navbar-nav ms-auto"> <a class="nav-link text-light text-center" aria-current="page" href="index.html">Home</a> <a class="nav-link text-light text-center" href="aboutus.html">About us</a> <a class="nav-link active text-light text-center" href="contact.html" aria-disabled="true">Contact</a> </div> </div> </div> </nav> </div> </div> </div> <!-- NAV END --> <!-- ABOUT US --> <div class="container-fluid p-0 bg-dark text-light"> <div class="row"> <div class="col-sm-6 ps-0"> <img src="images/lesly-derksen-F4fH5dAfZnE-unsplash.jpg" alt="" class=" d-block w-100 c-img "> </div> <div class="col-sm-6 d-flex justify-content-center align-items-center "> <div class="text-center"> <h2 class="fw-bold display-4 ">Bize Ulaşın</h2> <!-- ABOUT US --> <div class="mb-3"> <label for="exampleFormControlInput1" class="form-label">Adınız</label> <input type="email" class="form-control" id="exampleFormControlInput1" placeholder="Name"> </div> <div class="mb-3"> <label for="exampleFormControlInput1" class="form-label">Email Adres</label> <input type="email" class="form-control" id="exampleFormControlInput1" placeholder="Email Address"> </div> <div class="mb-3"> <label for="exampleFormControlTextarea1" class="form-label">Mesajınız</label> <textarea class="form-control" id="exampleFormControlTextarea1" placeholder="Message" rows="3"></textarea> </div> <div class=" gap-2 d-md-block "> <button class="btn btn-light " type="button">Send</button> </div> </div> </div> </div> </div> <!-- ABOUT US END --> <!-- PRODUCT --> <div class="container mt-sm-5"> <div class="row text-center "> <h1 class="d-flex justify-content-center">Mekanlarımız</h1> <hr> <div class="col-sm-4 mb-2"> <div class="card"> <img src="images/card2.jpg" class="card-img-top" alt="..."> <div class="card-body"> <h5 class="card-title">Orman İçi Karavan Parkı</h5> <p class="card-text">Ormanın içinde konumlanan karavan parkımız, tam anlamıyla bir doğa kaçamağı sunuyor. Ormanın huzurlu atmosferinde kendinizi kaybedin. Karavanınızla konforlu bir konaklama deneyimi yaşayın.</p> <a href="#" class="btn btn-dark">Rezervasyon için tıklayınız </a> </div> </div> </div> <div class="col-sm-4 mb-2"> <div class="card"> <img src="images/card3.jpg" class="card-img-top" alt="..."> <div class="card-body"> <h5 class="card-title">Orman İçi Çadırlı Kamp</h5> <p class="card-text">Orman içi çadırlı kamp alanımız, doğa severler için bir cennet. Gölgeli ağaçlar arasında konumlanan çadırlarımızda, kuş cıvıltıları ve huzur içinde bir konaklama deneyimi sizi bekliyor.</p> <a href="#" class="btn btn-dark">Rezervasyon için tıklayınız</a> </div> </div> </div> <div class="col-sm-4 mb-2"> <div class="card"> <img src="images/card1.jpg" class="card-img-top" alt="..."> <div class="card-body"> <h5 class="card-title">Dağ Evi </h5> <p class="card-text">Dağ evimiz, şehrin gürültüsünden uzak,huzurlu bir konaklama imkanı sunuyor. Ferah odalarımızda dağ manzarasının keyfini çıkarabilir, gölet kenarındaki aktivitelerle vakit geçirebilirsiniz.</p> <a href="#" class="btn btn-dark">Rezervasyon için tıklayınız</a> </div> </div> </div> </div> </div> <!-- PRODUCT END --> <!-- PROJECT --> <div class="row my-4"> <div class="col-sm-12"> <h1 class="d-flex justify-content-center">Galeri</h1> <hr> </div> <div class="col-sm col-6 mb-1"><img src="images/galeri/hichem-meghachou-7I-Rj_E9ihI-unsplash.jpg" alt="" class="w-100 img-thumbnail"> </div> <div class="col-sm col-6 mb-1"><img src="images/galeri/jimmy-conover-J_XuXX9m0KM-unsplash.jpg" alt="" class="w-100 img-thumbnail"> </div> <div class="col-sm col-6 mb-1"><img src="images/galeri/josh-campbell-UbbjVyibFuc-unsplash.jpg" alt="" class="w-100 img-thumbnail"> </div> <div class="col-sm col-6 mb-1"><img src="images/galeri/shelby-cohron-ESNV6KmLJMg-unsplash.jpg" alt="" class="w-100 img-thumbnail"> </div> <div class="col-sm col-6 mb-1"><img src="images/galeri/tegan-mierle-fDostElVhN8-unsplash.jpg" alt="" class="w-100 img-thumbnail"> </div> <div class="col-sm col-6 mb-1"><img src="images/galeri/toa-heftiba-x9I-6yoXrXE-unsplash.jpg" alt="" class="w-100 img-thumbnail"> </div> </div> <!-- PROJECT END --> <!-- FOOTER --> <div class="bg-dark text-light"> <div class="container"> <footer class="pt-5 mt-5 "> <div class="row "> <div class="col-6 col-md-2 mb-3"> <h5>Section</h5> <ul class="nav flex-column "> <li class="nav-item mb-2"><a href="#" class="nav-link p-0 text-light">Home</a></li> <li class="nav-item mb-2"><a href="#" class="nav-link p-0 text-light">Features</a> </li> <li class="nav-item mb-2"><a href="#" class="nav-link p-0 text-light">Pricing</a> </li> <li class="nav-item mb-2"><a href="#" class="nav-link p-0 text-light">FAQs</a></li> <li class="nav-item mb-2"><a href="#" class="nav-link p-0 text-light">About</a> </li> </ul> </div> <div class="col-6 col-md-2 mb-3"> <h5>Section</h5> <ul class="nav flex-column"> <li class="nav-item mb-2"><a href="#" class="nav-link p-0 text-light">Home</a></li> <li class="nav-item mb-2"><a href="#" class="nav-link p-0 text-light">Features</a> </li> <li class="nav-item mb-2"><a href="#" class="nav-link p-0 text-light">Pricing</a> </li> <li class="nav-item mb-2"><a href="#" class="nav-link p-0 text-light">FAQs</a></li> <li class="nav-item mb-2"><a href="#" class="nav-link p-0 text-light">About</a> </li> </ul> </div> <div class="col-6 col-md-2 mb-3"> <h5>Section</h5> <ul class="nav flex-column"> <li class="nav-item mb-2"><a href="#" class="nav-link p-0 text-light">Home</a></li> <li class="nav-item mb-2"><a href="#" class="nav-link p-0 text-light">Features</a> </li> <li class="nav-item mb-2"><a href="#" class="nav-link p-0 text-light">Pricing</a> </li> <li class="nav-item mb-2"><a href="#" class="nav-link p-0 text-light">FAQs</a></li> <li class="nav-item mb-2"><a href="#" class="nav-link p-0 text-light">About</a> </li> </ul> </div> <div class="col-md-5 offset-md-1 mb-3"> <form> <h4> Abone Ol ve Doğanın Güzelliklerini Kaçırma!</h4> <p class="fs-6">Doğanın kucaklayıcı atmosferine adım atmak, huzurla dolu anlar yaşamak ve Enba Camping'in sunduğu özel fırsatları kaçırmamak için hemen abone ol! Sitemize abone olarak, doğanın gizemli güzellikleri, özel indirimler ve etkinliklerden ilk sen haberdar olacaksın.</p> <p class="fs-6"> Unutulmaz anılar biriktirmek ve doğanın kollarında huzurlu bir deneyim yaşamak için abone ol, Enba Camping'in eşsiz dünyasına adımını at! 🏕️✨ </p> <div class="d-flex flex-column flex-sm-row w-100 gap-2"> <label for="newsletter1" class="visually-hidden">Email address</label> <input id="newsletter1" type="text" class="form-control" placeholder="Email address"> <button class="btn btn-primary" type="button">Subscribe</button> </div> </form> </div> </div> <div class="d-flex flex-column flex-sm-row justify-content-between border-top"> <p>© 2023 Company, Inc. All rights reserved.</p> <ul class="list-unstyled d-flex"> <li class="ms-3"><a class="link-body-emphasis" href="#"><svg class="bi" width="24" height="24"> <use xlink:href="#twitter"></use> </svg></a></li> <li class="ms-3"><a class="link-body-emphasis" href="#"><svg class="bi" width="24" height="24"> <use xlink:href="#instagram"></use> </svg></a></li> <li class="ms-3"><a class="link-body-emphasis" href="#"><svg class="bi" width="24" height="24"> <use xlink:href="#facebook"></use> </svg></a></li> </ul> </div> </footer> </div> </div> <!-- FOOTER END --> </body> </html> 和CSS .jumb { vertical-align: inherit; } p { font-size: 24px; } .c-item { height: 480px; } .c-img { height: 100%; object-fit: cover; filter:brightness(0.9) } 这里。我不希望页面左右移动。我想让它适合全屏,但容器结构溢出了 请将这段代码添加到您的 CSS 文件中。然后,它就会起作用。 .row{ margin-right: 0px; }


MatToolbar:尝试组合不同的工具栏模式

出现以下错误: MatToolbar:尝试组合不同的工具栏模式。显式指定多个 元素或仅将内容放置在 中 出现以下错误: MatToolbar:尝试组合不同的工具栏模式。要么显式指定多个 <mat-toolbar-row> 元素,要么仅将内容放置在单行的 <mat-toolbar> 中。 我的代码已经在 mat-toolbar 中应用了 mat-toolbar-row。然而,该错误仍然存在。 html文件的代码片段如下: <div class="wallpaper"> <mat-toolbar color="primary"> <mat-toolbar-row> <span>Welcome, User</span> <span class="example-fill-remaining-space"></span> <span class="align-center"></span> <span class="example-spacer"></span> <button mat-button>Create Incident </button> <a [routerLink]="['/closed']"><button mat-button style="color: white">Closed Incident</button></a> <span class="example-spacer"></span> <a [routerLink]="['/login']"><button mat-button>Logout</button></a> <img src="../../assets/hsbc_logo3.png" class="logo-hsbc"/> </mat-toolbar-row> <h1>INCIDENT MANAGEMENT SYSTEM</h1> </mat-toolbar> <h1>Welcome to Incident Management System</h1> <mat-card style="background: transparent"> <!-- Title of an Card --> <mat-card-title>Incident Details</mat-card-title> <mat-card-content> <form> <table > <tr> <td> <mat-form-field class="demo-full-width"> <mat-label >Description</mat-label> <textarea [(ngModel)]="incident.description" name="description" cdkTextareaAutosize cdkAutosizeMinRows="1" cdkAutosizeMaxRows="5" matInput></textarea> </mat-form-field> </td> <td> <h4>{{message}}</h4> </td> </tr> <tr> <td> <mat-form-field class="demo-full-width"> <input matInput [matDatepicker]="picker" placeholder="Incident Date" [(ngModel)]="incident.date" name="date" > <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle> <mat-datepicker touchUi="true" #picker></mat-datepicker> </mat-form-field> </td> </tr> <tr> <td colspan="2"> <mat-form-field class="demo-full-width"> <input matInput placeholder="Incident Category" [(ngModel)]="incident.category" name="category"> </mat-form-field> </td> </tr> <tr> <td > <mat-form-field class="demo-full-width"> <mat-select placeholder="Application Owner" [(ngModel)]="incident.owner" name="owner"> <mat-option style="background-color:grey">-- Select--</mat-option> <mat-option style="background-color:cornsilk" value="1">BRV</mat-option> <mat-option style="background-color:cornsilk" value="2">FRTB</mat-option> <mat-option style="background-color:cornsilk" value="3">FSA</mat-option> </mat-select> </mat-form-field> </td> <td> <mat-form-field> <mat-select placeholder="Symphony Group" [(ngModel)]="incident.symphony_group" name="symphony_group"> <mat-option style="background-color:grey">-- Select --</mat-option> <mat-option style="background-color:cornsilk" value="1">MMO SheHacks</mat-option> <mat-option style="background-color: cornsilk" value="2">MMO IT INDIA</mat-option> </mat-select> </mat-form-field> </td> </tr> <tr> <td> <mat-form-field> <mat-select placeholder="Application" [(ngModel)]="incident.application" name="application"> <mat-option style="background-color:grey">-- Select--</mat-option> <mat-option style="background-color:cornsilk" value="1">BRV</mat-option> <mat-option style="background-color:cornsilk" value="2">FRTB</mat-option> <mat-option style="background-color:cornsilk" value="3">FSA</mat-option> </mat-select> </mat-form-field> </td> <td> <mat-form-field> <mat-select placeholder="Status" [(value)]="status" [(ngModel)]="incident.status" name="status"> <mat-option style="background-color:grey">-- Select --</mat-option> <mat-option style="background-color: green" value="1">Available</mat-option> <mat-option style="background-color: orange" value="2">Reduced</mat-option> <mat-option style="background-color: red" value="3">Unavailable</mat-option> </mat-select> </mat-form-field> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2" class="content-center"> <button style="margin:5px" mat-raised-button color="accent" (click)="submit()">Submit Incident</button> <button style="margin:5px" mat-raised-button color="accent" (click)="reset()">Clear</button> <button style="margin:5px" mat-raised-button color="accent">Raise BGCR</button> <button style="margin:5px" mat-raised-button color="accent">Raise Jira</button> </td> </tr> </table> </form> </mat-card-content> </mat-card> </div> 您需要移除 <h1>INCIDENT MANAGEMENT SYSTEM</h1> 或将其放入 <mat-toolbar-row> 内。 我无法在垫子工具栏中填充图像 有什么帮助吗?


如何在C#中正确导入不同项目的Proto文件?

我的解决方案中有 2 个项目 /Common/Common.csproj /数据/Data.csproj 我的 Data.csproj 中有一个 Proto 文件: 我的解决方案中有 2 个项目 /通用/Common.csproj /数据/Data.csproj 我的 Data.csproj 中有一个 Proto 文件: <Protobuf Include=".\Protos\UserService.proto" GrpcServices="Server" /> 看起来像这样: service UserService { rpc AddUser (UserRequest) returns (SimpleResponse); } .... 现在应该从 Common 导入 SimpleReponse,所以我在这个项目中的路径 /Common/Protos/common.proto 中创建了一个 common.proto,我想导入它: 导入“common.proto”; 服务用户服务{ rpc AddUser(UserRequest) 返回(SimpleResponse); } .... 然后 Rider 显示 SimpleResponse 仍为红色,以及 common.proto 导入。当我快捷键 Space + .它会向我显示我所做的“添加到原始导入”。 因此,在全局设置中,路径现在已正确设置 - 原型和响应不再是红色,我可以按 F12 来查看它们。当我现在尝试构建时,我仍然收到错误: 我尝试在csproj中添加路径 <Protobuf Include="..\Common\Protos\common.proto" Link="..\Common\Protos\common.proto" /> 但仍然是同样的错误。 有什么想法吗? 从不同项目导入原始文件非常棘手,我发现这个解决方案非常费力。所以我想与社区分享 我正在使用微服务架构,我希望我的消息 ProtoFiles 应该在 SharedProto 项目中并在不同的项目中使用它们 假设我在 SharedProto 中有消息 Proto 文件 SharedProto --Protos ----company_dto.proto ----branch_dto.proto ---- ... company_dto.proto的内容 syntax = "proto3"; option csharp_namespace = "SharedProto.Protos"; package sharedproto.protos; // *** DTO message CompanyDto { int32 Id = 1; string Code = 2; string Name = 3; string Logo = 4; string Website = 5; } SharedProto.csproj 的内容 .... <ItemGroup> <Protobuf Include="Protos\company_dto.proto" GrpcServices="None"> <Protobuf Include="Protos\branch_dto.proto" GrpcServices="None"> </ItemGroup> .... 我拥有服务原型的项目组织 Organization ... --Protos ----company_rpc.proto ----branch_rpc.proto ... 我想将 comapany_dto.proto(属于 SharedProto 项目的一部分)导入到 comapany_rpc.proto(属于 Organization 项目的一部分)。让我们看看 .csproj 文件,因为所有的技巧都在这里: 组织.csproj的内容 <ItemGroup> <ProjectReference Include="..\SharedProto\SharedProto.csproj"> <GlobalPropertiesToRemove></GlobalPropertiesToRemove> </ProjectReference> </ItemGroup> <ItemGroup> <!-- DTOs --> <Protobuf Include="..\SharedProto\Protos\company_dto.proto" ProtoRoot=".." GrpcServices="None" Link="Protos\company_dto.proto" /> <Protobuf Include="Protos\company_rpc.proto" AdditionalImportDirs="../SharedProto" GrpcServices="Server" /> </ItemGroup> 如果您看到上面的 Organzation.csproj 文件,那么您需要了解一些非常重要的要点,以避免 file not found error 从其他项目导入 proto 文件。 ProtoRoot=".." 和 Link="Protos\company_dto.proto" 之后,将此 AdditionalImportDirs="../SharedProto" 添加到要导入文件的 <Protobuf Include=.... 上。但是,在这些设置之后,您可以在其他项目中导入 SharedProto 文件,在我的例子中它是组织项目。看看吧 company_rpc.proto内容 syntax = "proto3"; import "google/protobuf/empty.proto"; import "Protos/company_dto.proto"; package organization.companyrpc; // *** Rpc-Service service CompanyRpcService { // Retrieve All rpc GetAllCompanies (google.protobuf.Empty) returns (GetCompanyListResponse){ } .... } // Response: Retrieve All message GetCompanyListResponse { repeated sharedproto.protos.CompanyDto DtoRows = 1; string Message = 2; } 如果您看到我的company_rpc.proto文件,您就会了解我如何导入它(import "Protos/company_dto.proto";)以及我如何使用它(sharedproto.protos.CompanyDto DtoRows) 记住这个sharedproto.protos来自company_dto.proto文件中的包名称 上述设置适用于我的 .net core grpc 2.60.0 和 .net core 8


SecurityException:不允许启动服务Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms (有额外功能)}

我尝试从 Google 获取我的 GCM 注册 ID。 我的代码: 字符串SENDER_ID =“722*****53”; /** * 向 GCM 服务器异步注册应用程序。 * * 存储注册信息... 我尝试从 Google 获取我的 GCM 注册 ID。 我的代码: String SENDER_ID = "722******53"; /** * Registers the application with GCM servers asynchronously. * <p> * Stores the registration ID and the app versionCode in the application's * shared preferences. */ private void registerInBackground() { new AsyncTask<Void, Void, String>() { @Override protected String doInBackground(Void... params) { String msg = ""; try { if (gcm == null) { gcm = GoogleCloudMessaging.getInstance(context); } regid = gcm.register(SENDER_ID); msg = "Device registered, registration ID=" + regid; // You should send the registration ID to your server over // HTTP, so it // can use GCM/HTTP or CCS to send messages to your app. sendRegistrationIdToBackend(); // For this demo: we don't need to send it because the // device will send // upstream messages to a server that echo back the message // using the // 'from' address in the message. // Persist the regID - no need to register again. storeRegistrationId(context, regid); } catch (IOException ex) { msg = "Error :" + ex.getMessage(); // If there is an error, don't just keep trying to register. // Require the user to click a button again, or perform // exponential back-off. } return msg; } @Override protected void onPostExecute(String msg) { mDisplay.append(msg + "\n"); } }.execute(null, null, null); } 我收到错误: 03-01 19:15:36.261: E/AndroidRuntime(3467): FATAL EXCEPTION: AsyncTask #1 03-01 19:15:36.261: E/AndroidRuntime(3467): java.lang.RuntimeException: An error occured while executing doInBackground() 03-01 19:15:36.261: E/AndroidRuntime(3467): at android.os.AsyncTask$3.done(AsyncTask.java:299) 03-01 19:15:36.261: E/AndroidRuntime(3467): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352) 03-01 19:15:36.261: E/AndroidRuntime(3467): at java.util.concurrent.FutureTask.setException(FutureTask.java:219) 03-01 19:15:36.261: E/AndroidRuntime(3467): at java.util.concurrent.FutureTask.run(FutureTask.java:239) 03-01 19:15:36.261: E/AndroidRuntime(3467): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230) 03-01 19:15:36.261: E/AndroidRuntime(3467): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 03-01 19:15:36.261: E/AndroidRuntime(3467): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 03-01 19:15:36.261: E/AndroidRuntime(3467): at java.lang.Thread.run(Thread.java:841) 03-01 19:15:36.261: E/AndroidRuntime(3467): Caused by: java.lang.SecurityException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms (has extras) } without permission com.google.android.c2dm.permission.RECEIVE 03-01 19:15:36.261: E/AndroidRuntime(3467): at android.app.ContextImpl.startServiceAsUser(ContextImpl.java:1800) 03-01 19:15:36.261: E/AndroidRuntime(3467): at android.app.ContextImpl.startService(ContextImpl.java:1772) 03-01 19:15:36.261: E/AndroidRuntime(3467): at android.content.ContextWrapper.startService(ContextWrapper.java:480) 03-01 19:15:36.261: E/AndroidRuntime(3467): at com.google.android.gms.gcm.GoogleCloudMessaging.b(Unknown Source) 03-01 19:15:36.261: E/AndroidRuntime(3467): at com.google.android.gms.gcm.GoogleCloudMessaging.register(Unknown Source) 03-01 19:15:36.261: E/AndroidRuntime(3467): at com.example.gcm.DemoActivity$1.doInBackground(DemoActivity.java:177) 03-01 19:15:36.261: E/AndroidRuntime(3467): at com.example.gcm.DemoActivity$1.doInBackground(DemoActivity.java:1) 03-01 19:15:36.261: E/AndroidRuntime(3467): at android.os.AsyncTask$2.call(AsyncTask.java:287) 03-01 19:15:36.261: E/AndroidRuntime(3467): at java.util.concurrent.FutureTask.run(FutureTask.java:234) 03-01 19:15:36.261: E/AndroidRuntime(3467): ... 4 more 这是我的清单: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.manyexampleapp" android:installLocation="preferExternal" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="18" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="com.example.manyexampleapp.c2dm.permission.RECEIVE" /> <uses-permission android:name="com.example.manyexampleapp.gcm.permission.C2D_MESSAGE" /> <permission android:name="com.example.manyexampleapp.gcm.permission.C2D_MESSAGE" android:protectionLevel="signature" /> <application android:name="com.zoomer.ifs.BaseApplication" android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> <activity android:name="com.zoomer.ifs.MainActivity" android:label="@string/app_name" android:configChanges="orientation|keyboardHidden|screenSize" android:launchMode="singleTop"> <!-- <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> --> </activity> <!-- PUSH --> <!-- WakefulBroadcastReceiver that will receive intents from GCM services and hand them to the custom IntentService. The com.google.android.c2dm.permission.SEND permission is necessary so only GCM services can send data messages for the app. --> <receiver android:name="com.example.gcm.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" > <intent-filter> <!-- Receives the actual messages. --> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <category android:name="com.example.manyexampleapp" /> </intent-filter> </receiver> <service android:name="com.example.gcm.GcmIntentService" /> <activity android:name="com.example.gcm.DemoActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <!-- DB --> <activity android:name="com.example.db.DbActivity" android:label="@string/app_name" > <intent-filter> </intent-filter> </activity> <activity android:name="com.example.http.RestGetActivity" android:label="@string/app_name" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" > </activity> <activity android:name="com.example.fb.FacebookLoginActivity" android:label="@string/app_name" > <!-- <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> --> </activity> <activity android:name="com.example.http.SendFeedbackActivity" android:label="@string/app_name" > <!-- <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> --> </activity> <activity android:name="com.zoomer.general.SearchNearbyOffersActivity" android:label="@string/app_name" > <intent-filter> </intent-filter> </activity> <activity android:name="com.facebook.LoginActivity" android:label="@string/app_name" > <intent-filter> </intent-filter> </activity> <activity android:name="com.example.manyexampleapp.StoresListActivity" > <intent-filter> </intent-filter> </activity> <activity android:name="com.example.fb.ShareActivity" > <intent-filter> </intent-filter> </activity> <activity android:name="com.example.notifications.NotificationsActivity" > <intent-filter> </intent-filter> </activity> <activity android:name="com.example.fb2.no_use.MainActivity" > <intent-filter> </intent-filter> </activity> <activity android:name="com.zoomer.offers.OffersListActivity" > <!-- <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> --> </activity> <activity android:name="com.example.http.SearchNearbyOffersActivity" > <!-- <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> --> </activity> <service android:name="com.example.geo.LocationService" android:enabled="true" /> <receiver android:name="com.example.manyexampleapp.BootReceiver" > <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> <action android:name="com.example.manyexampleapp.LocationService.LOCATION_BROAD_MSG" /> </intent-filter> </receiver> <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id" /> </application> </manifest> 改变 <uses-permission android:name="com.example.manyexampleapp.c2dm.permission.RECEIVE" /> 到 <!-- This app has permission to register and receive data message. --> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> 您收到异常是因为您尚未定义所需的权限 如果应用程序开发后安装了播放服务, 可能会发生 com.google.android.c2dm.permission.RECEIVE 权限已被授予但 android 仍在抱怨同样的错误。 在这种情况下,您必须完全重新安装开发的应用程序才能使此权限发挥作用。 我认为你必须检查 Kotlin 版本兼容性。


© www.soinside.com 2019 - 2024. All rights reserved.